"Chase, Andrew" on wrote...
| Hello hello,
|
| > Now that you defined your problem exactly, I can give you a
| > solution with semi-transparent red for pixels that are grey.
| >
|
| Haha, I'm still working on that exact definition :-). The solution I came up
with, providing a colormap and converting from grayscale, did work to get me 2
color images with 256 color table. However, it was giving me gif-style
transparency, where the transparent color is defined (from what I can tell) as
a key-value pair. After looking at the working example I get back from
IrfanView, and reading some of the png spec, what I really want (what my
renderer seems to be best optimized for) is RGBA-Palette, as defined here:
| http://www.libpng.org/pub/png/book/chapter08.html#png.ch08.div.5.2
|
I suggest you create a IM forum developers request with exactly that
request. Hopefully either Chrisy or Glenn can come up with the
nessary solution.
| I have now found that I can generate a 2 color png and then, using
| TweakPNG, I can insert a tRNS chunk into the png, then edit the color
| palette and set the alpha value of black, in the palette, to 0.
|
| Once I had that working, I then had to figure out how to insert the
| tRNS chunk programmatically. Can this be done with ImageMagick? The
| solution I'm using now, on a windows machine, involves the png utility
| "PNGCRUSH". Since I'm using the netscape: color palette I know the
| first color in my color palette will be black, so I just run pngcrush
| like this and I get an RGBA-Palette image: pngcrush -trns_array 1 0
| test2.png test3.png
|
| The -trns_array will generate alpha values for the first N colors in
| the color palette, so 1 0 sets the first color (black) to transparent.
|
| If anyone else is having problems with Java rendering 8bit png's
| slowly, or if the png's are taking up too much memory, I would
| recommend this approach. Without a tRNS chunk and color palette I
| consistently see poorer performance out of the Java render pipeline.
|
Now you are getting far to deep for me, sorry. Looks like you will have
to take your discussion to the other developers.
But it looks like you have a solution.
You can however create a output delegate to make the call to pngcrush.
That is create a special "PNGt:" output format that uses the delegate to
complete the image format encoding.
Anthony Thyssen ( System Programmer ) <[EMAIL PROTECTED]>
-----------------------------------------------------------------------------
"Oh dear, I think you'll find reality's on the blink again."
-- Marvin The Paranoid Android
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users