remove transparency

cédric (dev) said on 01/26/2018

i added the -notrans in pingo 0.95h: this converts RGB data to make the PNG non-transparent. this could be useful if you use a PNG on a solid color (default: white, 255,255,255) and/or if you want to remove transparency

pingo 0.95h
different ways to optimize files
original lossless v.lossless
76 954 bytes 74 330 bytes 71 341 bytes
alpha channel alpha channel alpha channel
-pngfilter -pngpalette=100 -notrans -s0
54 356 bytes 16 389 bytes 55 105 bytes
alpha channel alpha values (tRNS) no transparency
-pngfilter -notrans -pngpalette=100 -notrans -notrans (auto > JPG)
36 904 bytes 17 938 bytes 14 271 bytes
no transparency no transparency no transparency

few points

  • this let you to optimize your files further by removing the transparency you do not need in case you use the PNG on a solid color (only in this case!)
  • this transformation is done before everything else: it is automatically combined with all pingo features, including auto, paletted, lossyfilter, or lossless optimization
  • used in a near-lossless way (example -notrans -s0), this could offer a nice filesize reduction (like -pngfilter) while providing a much better image quality
  • used in auto, most of PNG should be converted to JPG but not always
  • if you combine this with -pngpalette, the quantizer will not have to deal with transparency: it should produce a better image quality
  • it works with all PNG types, including (input) paletted. it makes standard PNG which are compatible with browsers that does not handle PNG transparency correctly
  • again: make a backup of your transparent PNG before using this. if you use -notrans, it will remove transparency with no way back

cédric (dev) said on 01/31/2018

pingo 0.95k can set the solid color

:: example (black solid background)
pingo -notrans -rgb: 0 0 0 *.png

comment this