Indexing Graphics

User avatar
Kyran
Posts: 499
Joined: Sat Dec 31, 2011 5:19 pm
Location: Australia
Contact:

Indexing Graphics

Postby Kyran » Tue Aug 20, 2013 10:28 am

Okay, so I have this graphic in GIMP. What do I need to do to make it colour cycle?
Attachments
chesspieces.png
CC-BY-SA 3.0 - Nem_
Saturday, April 14, 2012 - 11:34
http://opengameart.org/content/chess-pieces-1
chesspieces.png (2.4 KiB) Viewed 2033 times
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: Indexing Graphics

Postby Andrettin » Tue Aug 20, 2013 3:27 pm

Kyran wrote:Okay, so I have this graphic in GIMP. What do I need to do to make it colour cycle?
You would need to change the order of the colors, putting the colors you want to be cycled in the numbers 38-47 (there is a tool for changing the order of colors in GIMP).
User avatar
b_o
Posts: 328
Joined: Sun Jan 01, 2012 12:07 pm

Re: Indexing Graphics

Postby b_o » Tue Aug 20, 2013 3:32 pm

Kyran wrote:Okay, so I have this graphic in GIMP. What do I need to do to make it colour cycle?
What do you mean by color cycle? Your sprite is currently set as a team color.

In the palette tutorial on this forum it said: "Private palettes didn't support color cycling, this must be simulated with
animation's."

If you are not using a private palette(I'm not sure what that entails), then you can change some of the colors to use some of the following index numbers:

Color cycling info for Warcraft 2:
3 flash red/green(attacked building on minimap)
38-47 cycle (water)
48-56 cycle (water-coast boundary)
202 pulsates red(Circle of Power)
240-244 cycle (water around ships, Runestone, Dark Portal)

Color cycling info for stratagus, (I might be mistaken on this)
38-47 cycle (water)
252 pulsates red
240-244 cycle (water of some sort)

stratagus.lua in wargus says the following:
AddColorCyclingRange(38, 47) -- water
AddColorCyclingRange(205, 207) -- building
AddColorCyclingRange(240, 244) -- icon

To change the index color you are using in the image, you first need to load the 256 color palette ( the one you are using in stratagus) into the image you want to edit(note, this can corrupt your image if you use a poor quality program, I suggest irfanview for this task even if you use another program for image editing). Then open an image of the palette contents with the same 256 color palette loaded into that image:
war2.png
image of war2 palette with war2 palette loaded in the image
war2.png (2.11 KiB) Viewed 2027 times
. Then use a color replacer tool to make sure that you stick the correct color with the correct index in the correct location of the image.
samp.png
samp.png (26.93 KiB) Viewed 2027 times
If you want to change the colors that are cycled, then you have to move those colors to the correct indexes by editing the actual palette file like Andrettin suggested, which is not the editing of a graphic of the palette, but rather using a special palette editing tool to reassign different RGB values to different indexes of a palette file.
Last edited by b_o on Fri Aug 23, 2013 5:09 am, edited 1 time in total.
User avatar
Kyran
Posts: 499
Joined: Sat Dec 31, 2011 5:19 pm
Location: Australia
Contact:

Re: Indexing Graphics

Postby Kyran » Tue Aug 20, 2013 5:31 pm

Okay, thanks! Looks like it's working great.
Attachments
chesspieces.png
CC-BY-SA 3.0 - Nem_
Saturday, April 14, 2012 - 11:34
http://opengameart.org/content/chess-pieces-1

Palette modified for Aleona's Tales by Kyran Jackson.
chesspieces.png (1.58 KiB) Viewed 2024 times
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me

Who is online

Users browsing this forum: No registered users and 1 guest