[prev in list] [next in list] [prev in thread] [next in thread] 

List:       graphicsmagick-help
Subject:    [GM-help] Fwd: Corrupted PNG8 with transparency
From:       Juraj Komacka <komackaj () gmail ! com>
Date:       2015-05-04 10:10:03
Message-ID: CACUFmXsf6AE0Uz0ewcs2QoEPzPfqPEqfzOh7x+oGL5YD5Y4T6g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi all,

I am trying to write indexed PNG with transparency.

Results are posted on http://imgur.com/a/vKJKQ and will be adressed as:
origRGBA.png         http://i.imgur.com/akgOIvy.png
palette.png              http://i.imgur.com/9bsr3HP.png
palRGBA.png          http://i.imgur.com/nEit7xb.png
palIndexed-20.png    http://i.imgur.com/D5LIV34.png
palIndexed-21.png    http://i.imgur.com/NpM6UgY.png
palIndexed-im.png    http://i.imgur.com/OMgZpca.png

I have started with RGBA PNG file origRGBA.png and a palette file
palette.png.

Then I
1.) took origRGBA.png
2.) made its alpha channel binary (because GM claims to support only binary
transparency in PNG8 )
3.) mapped colors using palette.png
4.) set background color to none. # gm identify -verbose
on original image revealed "Background: white" although no white pixel is
in image and conversion to PNG8 would then fail with error "Invalid
background palette index"
5.) saved it as palRGBA.png - unindexed PNG with binary transparency and
palette applied

all using this pgmagick script
https://gist.github.com/komackaj/6ece1700a05c363771a4
So far so good.

Then I have tried to save this image as PNG8 with:
# gm convert palRGBA.png PNG8:palIndexed.png

and ended up with
palIndexed-20.png   for GM 1.3.20 (Debian Jessie, stable repositories) -
same results are for GM 1.3.18 (Debian Wheezy)
palIndexed-21.png   for GM 1.3.21 (built from source, version info at
http://pastebin.com/eHJz8Sja )

Transparency in palIndexed-20.png is not preserved, replaced with fully
opaque black.
palIndexed-21.png is an corrupted image, identify reports warnings

# gm identify -debug coders palIndexed-21.png
....
18:06:34 0:01 0.000u 22929 png.c/PNGWarningHandler/1064/Coder:
    libpng-1.2.49 warning: tRNS: CRC error
18:06:34 0:01 0.000u 22929 png.c/PNGWarningHandler/1069/Coder:
  tRNS: CRC error (palIndexed-21.png)
18:06:34 0:01 0.000u 22929 png.c/PNGErrorHandler/1045/Coder:
    libpng-1.2.49 error: KGD[00]: invalid chunk type
18:06:34 0:01 0.000u 22929 png.c/PNGErrorHandler/1048/Coder:
  KGD[00]: invalid chunk type (palIndexed-21.png)
18:06:34 0:01 0.000u 22929 png.c/ReadOnePNGImage/1392/Coder:
    exit ReadOnePNGImage() with error.
.....

Maybe this changeset has something to do with it - I am not able to
evaluate - http://hg.code.sf.net/p/graphicsmagick/code/rev/b702174de86e

Expected result is as with ImageMagick 6.8.9-7 Q16 (Debian Wheezy):
# convert-im6 palRGBA.png PNG8:palIndexed-im.png
Is there a way to achieve same result with GM?

I will appreciate every suggestion how to solve this problem.

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div><div>Hi \
all,<br><br></div>I am trying to write indexed PNG with \
transparency.<br></div><div><br>Results are posted on <a \
href="http://imgur.com/a/vKJKQ" target="_blank">http://imgur.com/a/vKJKQ</a> and will \
be adressed as:<br>origRGBA.png                 <a \
href="http://i.imgur.com/akgOIvy.png" \
target="_blank">http://i.imgur.com/akgOIvy.png</a> <br>palette.png                    \
<a href="http://i.imgur.com/9bsr3HP.png" \
target="_blank">http://i.imgur.com/9bsr3HP.png</a><br>palRGBA.png                 <a \
href="http://i.imgur.com/nEit7xb.png" \
target="_blank">http://i.imgur.com/nEit7xb.png</a><br>palIndexed-20.png       <a \
href="http://i.imgur.com/D5LIV34.png" \
target="_blank">http://i.imgur.com/D5LIV34.png</a><br>palIndexed-21.png       <a \
href="http://i.imgur.com/NpM6UgY.png" \
target="_blank">http://i.imgur.com/NpM6UgY.png</a><br>palIndexed-im.png      <a \
href="http://i.imgur.com/OMgZpca.png" \
target="_blank">http://i.imgur.com/OMgZpca.png</a><br></div><div><br></div>I have \
started with RGBA PNG file origRGBA.png and a palette file palette.png.<br><br>Then \
I<br>1.) took origRGBA.png<br>2.) made its alpha channel binary (because GM claims to \
support only binary transparency in PNG8 )<br></div><div>3.) mapped colors using \
palette.png<br></div><div>4.) set background color to none. # gm identify \
-verbose<br>on original image revealed &quot;Background: white&quot; although no \
white pixel is in image and conversion to PNG8 would then fail with error \
&quot;Invalid background palette index&quot;<br></div><div>5.) saved it as \
palRGBA.png - unindexed PNG with binary transparency and palette \
applied<br><br></div><div>all using this pgmagick script <a \
href="https://gist.github.com/komackaj/6ece1700a05c363771a4" \
target="_blank">https://gist.github.com/komackaj/6ece1700a05c363771a4</a><br>So far \
so good.<br><br></div><div>Then I have tried to save this image as PNG8 \
with:<br></div><div># gm convert palRGBA.png \
PNG8:palIndexed.png<br><br></div><div>and ended up with<br>palIndexed-20.png     for \
GM 1.3.20 (Debian Jessie, stable repositories) - same results are for GM 1.3.18 \
(Debian Wheezy) <br>palIndexed-21.png     for GM 1.3.21  (built from source, version \
info at <a href="http://pastebin.com/eHJz8Sja" \
target="_blank">http://pastebin.com/eHJz8Sja</a> )<br><br>Transparency in \
palIndexed-20.png is not preserved, replaced with fully opaque \
black.<br>palIndexed-21.png is an corrupted image, identify reports warnings<br><br># \
gm identify -debug coders palIndexed-21.png<br>....<br>18:06:34 0:01 0.000u 22929 \
png.c/PNGWarningHandler/1064/Coder:<br>       libpng-1.2.49 warning: tRNS: CRC \
error<br>18:06:34 0:01 0.000u 22929 png.c/PNGWarningHandler/1069/Coder:<br>   tRNS: \
CRC error (palIndexed-21.png)<br>18:06:34 0:01 0.000u 22929 \
png.c/PNGErrorHandler/1045/Coder:<br>       libpng-1.2.49 error: KGD[00]: invalid \
chunk type<br>18:06:34 0:01 0.000u 22929 png.c/PNGErrorHandler/1048/Coder:<br>   \
KGD[00]: invalid chunk type (palIndexed-21.png)<br>18:06:34 0:01 0.000u 22929 \
png.c/ReadOnePNGImage/1392/Coder:<br>       exit ReadOnePNGImage() with \
error.<br>.....<br><br></div><div>Maybe this changeset has something to do with it - \
I am not able to evaluate - <a \
href="http://hg.code.sf.net/p/graphicsmagick/code/rev/b702174de86e" \
target="_blank">http://hg.code.sf.net/p/graphicsmagick/code/rev/b702174de86e</a><br></div><div><br>Expected \
result is as with ImageMagick 6.8.9-7 Q16 (Debian Wheezy):<br># convert-im6 \
palRGBA.png PNG8:palIndexed-im.png<br></div><div>Is there a way to achieve same \
result with GM?<br></div><div><br>I will appreciate every suggestion how to solve \
this problem.<br><br> </div></div> </div><br></div>



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y

_______________________________________________
Graphicsmagick-help mailing list
Graphicsmagick-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic