adonthell-artwork
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-artwork] Image format and custom coloring


From: Alexandre Courbot
Subject: [Adonthell-artwork] Image format and custom coloring
Date: 04 Mar 2002 14:39:28 +0100

Hi there!

This is a point we quickly talked about once, but I think I have a
solution for it now.

As you know, we need many different characters. We want some of them to
be very ressemblant, excepted for some colours that may vary.
In multiplayer game in particular, we need that two players doesn't have
the exact same character. Well, you see where I want to come: having
some parts of a character (or any object) that color can be freely
chosen.

While doing such things is very easy with paletized images, this is not
the case with our true-color ones. One solution would be to switch our
small gfxs to a paletized format, but I already see you gfx guys
bringing me to a tree and passing a rope around my neck! ;) Fortunately,
there seems to be another choice that is suitable for true-color images.

The idea is that at the end of the image you'd have an (optionnal) bits
matrix which size is the same of the image. If a bit is 0, the
corresponding pixel is handled like a classic one. If it is 1, then the
two bytes of the pixel have a different meaning:

-Byte 0: a density value, from 0 to 255.
-Byte 1: a special color index.

And this is where magic happens: such images at load time could be given
a list of base colors to apply to the special colors. Say that if you
define your image so that the jacket of a character is using special
color 0, when applying, say, red to this color, the jacket will turn of
course red. But using the density byte, we can know whether it should be
dark or intense red. See what I mean? That way, we could, say, isolate
the pixels that make the clothes or hairs and allow the user to choose
colors for them. Blond hairs and blue jacket or dark hairs with red
jacket, it's up to you to choose! :) A character's representation on the
map would be a model file, and several colours to apply on it.

Of course, this couldn't be applied everywhere. Characters faces, for
example, (those used during dialogs) wouldn't look good if we apply such
transformations, because they are much more detailled. But as the
resolution will be much higher in the next release (and therefore
characters will be more detailled), maybe we can do without.

Of course, this is only a first thought. There may be a better file
format for this - suggestion are welcome. Also, we have to find a way to
select the pixels that will be part of such special colors - and a way
to represent them when no color is applied (grayscale seems fine at
first sight). Moreover I'm quite busy with the map engine (finally, I'm
about to get out of the client/server maze!), so finding someone
motivated to start work on this would be very, very good.

Opinions?
Alex.
-- 
http://www.gnurou.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]