xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Huang Haitao-G17843 <haitaohu...@motorola.com>
Subject RE: How do I encode SVG into PNG with lower color depth
Date Tue, 13 Aug 2002 16:31:36 GMT
I didn' find class IndexImage, did you mean java.awt.image.IndexColorModel which is used by
PNGEncodeParam?
Could you explain in a little more detail on how I would make the changes?
I just started looking at all the code, and am quite confused on following issues:
I thought the default depth is 16 because PNGEncodeParam.RGB.setBitDepth only accept 8 or
16, and PNGEncodeParam.RGB is the only one used in PNGTranscoder.writeImage() method.
If I use indexed PNG, is 8 the lowest depth I can get?
Do I need use PNGEncodeParam.Gray or PNGEncodeParam.Palette?
Which part of the code should I plug in the IndexImage you talked about?
Would it matter if the SVG specifies color in RGB?

Thanks again for help.
Haitao 

-----Original Message-----
From: Thomas E Deweese [mailto:thomas.deweese@kodak.com]
Sent: Tuesday, August 13, 2002 8:39 AM
To: Batik Users
Subject: How do I encode SVG into PNG with lower color depth


>>>>> "HH" == Huang Haitao-G17843 <haitaohuang@motorola.com> writes:

HH> The default color depth used by PNG transcoder is 16. 

    Actually the default depth is 24/32 bits per pixel.  You
can have it write an 'indexed' PNG that uses 256 colors or 8 bits
with the -indexed parameter.

HH> I wonder if there is a way to change it to lower value such as
HH> 1,2,4?  Thanks for any help.  Haitao Huang

    Currently there is no interface for this although it should be
fairly trivial to add (all the support is there, the glue code etc
just hasn't been written).  If this is interest to you I suggest you
look at 'batik.transcoder.image.PNGTranscoder' and
'batik.ext.awt.image.rendered.IndexImage').

    Basically you would want to make the KEY_INDEXED hint an integer
(defaulting to 256), and have IndexImage take this number as the
number of color cubes to generate (256 is hardcoded in a few places).

    Good luck.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message