Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: (PR#2269) PNG for freeciv
Home

[Freeciv-Dev] Re: (PR#2269) PNG for freeciv

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2269) PNG for freeciv
From: "Vasco Alexandre Da Silva Costa via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 4 Nov 2002 14:14:48 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, 4 Nov 2002, Jason Short via RT wrote:
> Raimar Falke via RT wrote:
> > On Mon, Nov 04, 2002 at 03:04:06AM -0800, Jason Short via RT wrote:
> >
> > So what does Xaw+this patch support and what is missing? Do all images
> > have to have the same palette (as mentioned before)?
>
> Well, I can't answer this definitively; perhaps Vasco can.  I don't even
> know if PNG has the concept of the "same palette"; if all images use the
> same 32 colors it might all just work out.

Basically what this does is it tries to allocate each colour in the
palette with a XAllocColor call. If it fails (i.e. all colour cells have
been used) we use the closest colour in the current palette instead.

It is a bit crude but it works. Even if the pixmaps have the palette
shuffled around. Of course you need to use the same colours or you will
eventually run out of colour space.


I suggest you do the conversion of the images to PNG this way:

For trident assuming you use the GIMP v1.2:

Download:
http://www.freeciv.org/graphics/utils/palettes.tar.gz

Extract this tarball into ~/.gimp-1.2/palettes/.

Open, for example, data/trident/tiles.xpm in GIMP.

Press the RMB over the image window. Select Image -> Mode -> Indexed...
from the popup menu.

Select "Use Custom Palette". Choose the freeciv_trident_tiles palette.
Choose "No Color Dithering", Uncheck the "Remove Unused Colors from Final
Palette" box. Press the OK button.

Save as PNG.

Repeat for the other files.


I can do this if you do not want to bother :)

> I suspect that in Trident's case there will be no problem anyway - since
> trident uses so few colors.  For tilesets with more colors I don't know.
>
> > Also the patch violates a lot of the coding style guide points.
>
> Fixed; new patch attached.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa




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