Page 1 of 1

Image dyeing ...

Posted: 20 Jan 2008, 21:08
by zick
I was reading about image dyeing in the wiki and had a question. If we use an image with "|W" is the palette applied to it the same thing as a gradient map in photoshop?
Thanks for any answers ...

Posted: 20 Jan 2008, 21:32
by Crush
I don't know exactly how gradient maps work in photoshop (I am a GIMP user) but it sounds like a quite similar system.

The color palette created is a gradient (in RGB space) evenly distributed over the brightness values. When you have 4 color values, for example, the colors between 0% brightness and 33% brightness are replaced by a gradient between the 1st and 2nd color, the colors between 33% and 66% by a gradient between 2nd and 3rd color and the colors between 66% and 100% by a gradient between the 3rd and 4th color.

Note that pure black (#000000) is added to the beginning of the color list in the palette definition. So when you got "|#0000ff,00ff00,ff0000" as a palette you will get a gradient from black to blue to green to red.

Posted: 21 Jan 2008, 01:25
by zick
How well does it work with alpha blended anti-aliased images? I don't see a whole lot of the artists here using images with those properties. Most have very hard edges between colors, and single transparency.

Posted: 21 Jan 2008, 02:42
by Crush
It works perfectly with alpha transparency.

Posted: 21 Jan 2008, 03:51
by zick
And what about anti-aliasing (or regions of color blending into another color) ... Sorry to ask so many questions.

Posted: 21 Jan 2008, 04:21
by Crush
Only pixels with a "pure color" will be colored. A "pure" color in the RGB color model is a color where all three RGB components are either 0 or identical. In the HSV color model a "pure" color got either 100% or 0% saturation and a hue divisible by 60. When the color value of a pixel isn't "pure" it won't be colored.

I think this should answer your question.

Posted: 21 Jan 2008, 17:18
by zick
What about pure greyscale ... you could use grey colors where all the RGB values are the same.

EDIT: I think I just answered my own question ... If I use greys like #333333, #666666, #999999, or really any grey for that matter.

Posted: 22 Jan 2008, 17:56
by zick
In theory, could you make ground tiles greyscale and apply a palette to them that simulates a time of day (morning, noon, dusk, night)?

Posted: 22 Jan 2008, 18:48
by Crush
Tilesets can't be dyed yet (AFAIK) but it would be no problem to enable it. So theoretically it would be possible. But the practical problem would be the coloring at daytime.