PNG file corrupts strangely when indexing
Re: PNG file corrupts strangely when indexing
Removing "-type palettematte" gives a transparent top and bottom,
and the resulting PNG is still color_type 3 with tRNS (indexed palette).
There are some longstanding unresolved problems with the the way
the PNG encoder handles the -type palettematte option.
and the resulting PNG is still color_type 3 with tRNS (indexed palette).
There are some longstanding unresolved problems with the the way
the PNG encoder handles the -type palettematte option.
- kreynolds
- Posts: 6
- Joined: 2011-08-08T13:44:04-07:00
- Authentication code: 8675308
- Location: Akron, OH
Re: PNG file corrupts strangely when indexing
I have found a few additional examples of converting assets to indexed that cause similar but slightly different corruption but what I'm hearing is "Stop doing that, it's broken and won't be fixed soon." Does that about sum it up?
Kelley Reynolds
http://insidesystems.net
http://insidesystems.net
Re: PNG file corrupts strangely when indexing
That's pretty much it. It'll be fixed the day after I figure out how.
- kreynolds
- Posts: 6
- Joined: 2011-08-08T13:44:04-07:00
- Authentication code: 8675308
- Location: Akron, OH
Re: PNG file corrupts strangely when indexing
Is there anything I can do to help with this or is this just something that requires a moment of inspiration on some future date?
Kelley Reynolds
http://insidesystems.net
http://insidesystems.net
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: PNG file corrupts strangely when indexing
kreynolds wrote:Is there anything I can do to help with this or is this just something that requires a moment of inspiration on some future date?
Seems like the current issue for this topic is solved by removing the -type palettmatte and adding PNG8:
convert ribbon.png -alpha off -colors 255 \
-background none -gravity center -extent x48 \
-depth 8 PNG8:ribbon_out.png
- kreynolds
- Posts: 6
- Joined: 2011-08-08T13:44:04-07:00
- Authentication code: 8675308
- Location: Akron, OH
Re: PNG file corrupts strangely when indexing
I wish it did. I've since found a few other assets that have similar problems though corrupt in different ways than this one. Removing -type palettematte does not fix them and some of them have actual alpha layers. I can add them here or start a new thread but I imagine the advice will be the same either way.
Kelley Reynolds
http://insidesystems.net
http://insidesystems.net
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: PNG file corrupts strangely when indexing
Sorry, I only meant this one issue was fixed by this approach. As Glenn said, he knows of other issues as well.kreynolds wrote:I wish it did. I've since found a few other assets that have similar problems though corrupt in different ways than this one. Removing -type palettematte does not fix them and some of them have actual alpha layers. I can add them here or start a new thread but I imagine the advice will be the same either way.
Probably would be best to start a new thread about those other issue.
Re: PNG file corrupts strangely when indexing
The "-type PaletteMatte" option started misbehaving (discarding transparency) in IM-6.6.9-4
apparently due to a small change in quantize.c having to do with how it handles images
with a small number of colors. This happened not only with PNG output
but with TXT output.
As of IM-6.7.1-5 the "-type PaletteMatte" option seems to be working OK; however,
the original problem with -colors 255 still exists and is apparently not a PNG encoder
problem because MIFF and TXT output are the same as the PNG output.
apparently due to a small change in quantize.c having to do with how it handles images
with a small number of colors. This happened not only with PNG output
but with TXT output.
As of IM-6.7.1-5 the "-type PaletteMatte" option seems to be working OK; however,
the original problem with -colors 255 still exists and is apparently not a PNG encoder
problem because MIFF and TXT output are the same as the PNG output.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: PNG file corrupts strangely when indexing
Glenn,
-type palettematte seems to be broke again in IM 6.7.2.3 Q16 (HDRI) Mac OSX Tiger:
This works with PNG8:
convert logo: -transparent white PNG8:logotp.png
identify -verbose logotp.png
Image: logotp.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 640x480+0+0
Resolution: 72x72
Print size: 8.88889x6.66667
Units: Undefined
Type: PaletteMatte
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
Channel statistics:
Red:
min: 4 (0.0156863)
max: 255 (1)
mean: 229.323 (0.899307)
standard deviation: 69.3423 (0.271931)
kurtosis: 4.45973
skewness: -2.49768
Green:
min: 0 (0)
max: 255 (1)
mean: 226.217 (0.887127)
standard deviation: 70.8689 (0.277917)
kurtosis: 3.37246
skewness: -2.24758
Blue:
min: 0 (0)
max: 255 (1)
mean: 229.064 (0.898288)
standard deviation: 64.1018 (0.251379)
kurtosis: 4.65272
skewness: -2.42185
Alpha:
min: 0 (0)
max: 255 (1)
mean: 42.2975 (0.165872)
standard deviation: 94.8513 (0.371966)
kurtosis: 1.22759
skewness: -1.79655
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 224.327 (0.879712)
standard deviation: 75.7241 (0.296957)
kurtosis: 3.46137
skewness: -2.27992
But this does not work with -type palettmatte
convert logo: -transparent white -type palettematte logo2tp.png
identify -verbose logo2tp.png
Image: logo2tp.png
Format: PNG (Portable Network Graphics)
Class: PseudoClass
Geometry: 640x480+0+0
Resolution: 72x72
Print size: 8.88889x6.66667
Units: Undefined
Type: Palette
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Red:
min: 4 (0.0156863)
max: 255 (1)
mean: 229.323 (0.899307)
standard deviation: 69.3408 (0.271925)
kurtosis: 4.45939
skewness: -2.49762
Green:
min: 0 (0)
max: 255 (1)
mean: 226.217 (0.887126)
standard deviation: 70.8691 (0.277918)
kurtosis: 3.37237
skewness: -2.24757
Blue:
min: 0 (0)
max: 255 (1)
mean: 229.063 (0.898288)
standard deviation: 64.1009 (0.251376)
kurtosis: 4.65193
skewness: -2.42173
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 228.201 (0.894907)
standard deviation: 68.1652 (0.267315)
kurtosis: 4.14785
skewness: -2.39282
Fred
-type palettematte seems to be broke again in IM 6.7.2.3 Q16 (HDRI) Mac OSX Tiger:
This works with PNG8:
convert logo: -transparent white PNG8:logotp.png
identify -verbose logotp.png
Image: logotp.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 640x480+0+0
Resolution: 72x72
Print size: 8.88889x6.66667
Units: Undefined
Type: PaletteMatte
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
Channel statistics:
Red:
min: 4 (0.0156863)
max: 255 (1)
mean: 229.323 (0.899307)
standard deviation: 69.3423 (0.271931)
kurtosis: 4.45973
skewness: -2.49768
Green:
min: 0 (0)
max: 255 (1)
mean: 226.217 (0.887127)
standard deviation: 70.8689 (0.277917)
kurtosis: 3.37246
skewness: -2.24758
Blue:
min: 0 (0)
max: 255 (1)
mean: 229.064 (0.898288)
standard deviation: 64.1018 (0.251379)
kurtosis: 4.65272
skewness: -2.42185
Alpha:
min: 0 (0)
max: 255 (1)
mean: 42.2975 (0.165872)
standard deviation: 94.8513 (0.371966)
kurtosis: 1.22759
skewness: -1.79655
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 224.327 (0.879712)
standard deviation: 75.7241 (0.296957)
kurtosis: 3.46137
skewness: -2.27992
But this does not work with -type palettmatte
convert logo: -transparent white -type palettematte logo2tp.png
identify -verbose logo2tp.png
Image: logo2tp.png
Format: PNG (Portable Network Graphics)
Class: PseudoClass
Geometry: 640x480+0+0
Resolution: 72x72
Print size: 8.88889x6.66667
Units: Undefined
Type: Palette
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Red:
min: 4 (0.0156863)
max: 255 (1)
mean: 229.323 (0.899307)
standard deviation: 69.3408 (0.271925)
kurtosis: 4.45939
skewness: -2.49762
Green:
min: 0 (0)
max: 255 (1)
mean: 226.217 (0.887126)
standard deviation: 70.8691 (0.277918)
kurtosis: 3.37237
skewness: -2.24757
Blue:
min: 0 (0)
max: 255 (1)
mean: 229.063 (0.898288)
standard deviation: 64.1009 (0.251376)
kurtosis: 4.65193
skewness: -2.42173
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 228.201 (0.894907)
standard deviation: 68.1652 (0.267315)
kurtosis: 4.14785
skewness: -2.39282
Fred
Re: PNG file corrupts strangely when indexing
This also loses transparency in IM-6.7.2-3 Q16
and so does .txt
Code: Select all
convert logo: -transparent white -type palettematte logo2tp.miff
identify -verbose logo2tp.miff