Png8 to Png4, problem with alpha channel
Posted: 2015-04-21T23:07:45-07:00
Hello
I have a large number of small png images that I want to optimize in regards of file-size.
Originally the images are 8-bit png and the optimization I do is to convert them to 4-bit paletted png's. The results are quite good, the images contains rather few colors so reducing them to a 4-bit palette gives ok results.
However I have run into a problem with some images. Images that are just "empty" (all-white) beckome all-black after I've applied the optimization.
I am using ImageMagick 6.7.7-10 2014-03-06 Q16
The command I run is:
As you might tell, I specify that the image shall be 16 colors, bit depth 4, type 3=palette and a dithering should be applied to counter the color reduction.
Example original image:
http://i.imgur.com/rbGHcS7.png
After conversion:
http://i.imgur.com/6XwHEpS.png
How can this be solved?
I have a large number of small png images that I want to optimize in regards of file-size.
Originally the images are 8-bit png and the optimization I do is to convert them to 4-bit paletted png's. The results are quite good, the images contains rather few colors so reducing them to a 4-bit palette gives ok results.
However I have run into a problem with some images. Images that are just "empty" (all-white) beckome all-black after I've applied the optimization.
I am using ImageMagick 6.7.7-10 2014-03-06 Q16
The command I run is:
Code: Select all
mogrify -dither FloydSteinberg -colors 16 -define png:color-type='3' -define png:bit-depth='4' image.png
Example original image:
http://i.imgur.com/rbGHcS7.png
After conversion:
http://i.imgur.com/6XwHEpS.png
How can this be solved?