xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Deweese <thomas.dewe...@kodak.com>
Subject How do I encode SVG into PNG with lower color depth
Date Tue, 13 Aug 2002 15:38:58 GMT
>>>>> "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


Mime
View raw message