Re: XPM versus PNG

Brian Duff <[email protected]> Sun, 16 Dec 2001 08:08:51 -0800 (GMT-08:00)
Newsgroups gmane.games.freeciv.java
Message-ID <[email protected]>
Hi Artur,

The reason I switched over to xpm was mainly that this seems to be the format the UNIX clients are using and I wanted to avoid having to convert the images. I didn't realize the win32 client is using png. I agree png is a far better image format (in particular, it supports alpha blending, which works like a charm in Java).

In addition, I was unable to get Java's built in image loaders to recognize xpm files: I know we discussed this a (long) while back. I ended up writing my own parser to support xpm.

It would be very easy for the client to support PNG in addition to XPM. All that's required is to write a class implementing the Sprite interface then alter TileSpec.loadImage( URL ) so that it recognizes the PNG / GIF / JPG extensions and uses this implementation... In fact, I might have a go at doing this after I'm through checking my email...

Brian


-----
I was trying to run jfreeciv client yesterday, but it turned out that 
data I have downloaded with win32 client is in png format and jfreeciv 
understands only xpm.

I know that there were some historical reasons, for from 1.3+, java 
itself understands gif,jpg,png and xpm. It is possible to support all 
these 4 formats using same code. How much work would it be to convert 
current loaders to use default java image toolkit ?

Artur