xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Art Welch <ar...@EASTPOINT.COM>
Subject RE: JDK 1.1 and Images EUREKA!!! (commit please)
Date Fri, 08 Sep 2000 18:17:40 GMT
To support grayscale images I would need to add palette support. A grayscale
BMP is just an eight bit per pixel image where the palette values all happen
to be shades of gray. Normally (but not necessarily) the palette would just
be the values from 0 - 255 (so I could cheat). I will see what can be done.

If I add palette support, it should be easy enough later on to change
BmpImage to return the palette data to IndexedColorSpace instead of
converting it to RGB.

I am a bit busy at the moment, so it may not happen right away.

-----Original Message-----
From: Eric SCHAEFFER [mailto:eschaeffer@posterconseil.com]
Sent: Friday, September 08, 2000 1:53 PM
To: fop-dev@xml.apache.org
Subject: Re: JDK 1.1 and Images EUREKA!!! (commit please)

----- Original Message -----
From: "Art Welch" <art_w@EASTPOINT.COM>
To: <fop-dev@xml.apache.org>
Sent: Friday, September 08, 2000 6:27 PM
Subject: RE: JDK 1.1 and Images EUREKA!!! (commit please)

> This is a relief. Monochrome (one bit per pixel/black and white) images
> worked in my testing, so if they did not work for you it would have been
> of those icky hard to reproduce problems.
> The grayscale image was probably eight bits per pixel. For these images to
> display properly you need to read the palette information from the BMP
> and map the pixel color to the palette value. I have not done this yet. It
> is not that difficult to do, but not a priority at the moment. Since FOP
> uses 24 bpp internally anyway if someone had a 2, 4, or 8 BPP BMP that
> wanted to display they could just convert it to 24 BPP. But if someone did
> have a need for this, they could let me (or the list) know and I (or
> someone) could probably add this. BmpImage is open to this addition.

I'd like to add support for color indexed images, but keeping the palette
(not converting the image into full RGB). But for this, I need to implement
an IndexedColorSpace class... (don't have the time, maybe next week...)

> The green is because for 8 BPP images I just loaded the pixel value into
> green channel.
> Do you think that it would be better to throw an exception, print a
> or something if we get a BMP format that is not really properly supported?
> was just leaving it open for the addition of more complete support.

If it isn't supported, throw an exception. But for greycaled bmp images, it
works a bit... Can you change your class to load grayscaled images in the
proper way ?



View raw message