I need to generate PNG32 files with 8-bit alpha channels. I consistently get a 1-bit alpha channel with commands such as:
convert foo.jpg PNG32:out.png
convert foo.jpg -define png:format=png32 out.png
convert foo.jpg -define png:color-type=6 out.png
convert foo.jpg -type truecolormatte PNG32:out.png
and all combinations of those options. I have tried 6.8.4-8-Q16-x64-dll (latest precompiled Windows) and also Linux self compiled versions of 6.6.3-10, 6.7.5-6 and 6.8.4-8. Any suggestions would be greatly appreciated!
How to get 8-bit alpha with PNG32
Re: How to get 8-bit alpha with PNG32
You are writing a PNG with an 8-bit alpha channel. "identify" reports that it's one-bit because it is all-opaque, which can be expressed with only one bit after it's read back into ImageMagick.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to get 8-bit alpha with PNG32
Basically try it with an image that actually contains some real alpha transparency gradients.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: How to get 8-bit alpha with PNG32
Adding variance in the alpha channel of course results in 8-bit alpha. I believe that identify is correctly reporting the 1-bit alpha channel as stored in the PNG, not after some internal conversion (which would make identify largely useless IMO). The acid test is the application consuming the PNGs, which insists on 8-bit alpha and rejects the PNGs with 1-bit alpha as produced in my original post. So I remain flummoxed as to why convert et al. aren't encoding 8-bit alpha as requested.