Re: PNG with indexed colors and tranparency
Bob Friesenhahn <[email protected]> Fri, 28 Jun 2019 08:08:24 -0500 (CDT)
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 28 Jun 2019, Przemysław Sobala wrote:
>
> And it turns out that GraphicsMagick can't do that because of Cannot write
> image as indexed PNG, writing RGBA message.
> Look for transparent colormap entry reveals num_alpha = 47and in coders/png.c
> there's an if
>
> if (num_alpha == 1)
>
> else
> {
> ping_colortype=PNG_COLOR_TYPE_RGB_ALPHA;
>
> I tried some other PNG images with transparency and they all have
> num_alpha>1.
>
> Does that mean that GraphicsMagick can't handle creating palette PNG images
> with transparency? How can I obviate that? Is reducing number of transparent
> colors in palette to 1 the best solution?
I am not sure about PNG but it is not unusual (e.g. GIF) that palette
formats only support one transparent color. I also know that there
are some weaknesses in the implementation that Glenn did not address.
In GraphicsMagick, colormap entries do have an opacity property
(inverse of transparency/alpha channel) but opacity is not considered
for color reduction except that one color can be 'transparent' if the
specified colorspace (-colorspace) is Transparent.
It may be necessary to assure that there is only one transparent color
when attempting to write an indexed PNG with transparency.
We could really use a PNG expert to join the development team and work
on improving the PNG writer.
Bob
--
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt
_______________________________________________
Graphicsmagick-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help