Photoshop: update PNG support

  • 1
  • Idea
  • Updated 7 years ago
  • (Edited)
Update .png support to be in line with .tga, ie. Separated alpha channel (optional), better compression, preservation of transparent pixels.
Photo of Wahooney

Wahooney

  • 2 Posts
  • 0 Reply Likes
  • sad and trustrated

Posted 7 years ago

  • 1
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 818 Reply Likes
That's an odd request.

PNG's fourth channel is defined to be opacity/transparency - which is how Photoshop reads and writes it. Reading and writing transparency as an alpha channel is an old school hack (but needed for Targa where many people don't use the transparency channel as intended).

Photoshop's compression in PNG is on par with PNGCrush (ZLib effort 9, with large lookback buffers, adaptive compression, with a large number of rows compressed as a block).

And Photoshop, as already noted, does read and write transparency in PNG files. The only exception is LUT transparency in PNG-8 files, which simply doesn't map into the available image modes in Photoshop (or most other image editors, for that matter).

So, are you using some ancient version of Photoshop, or some third party plugin that doesn't implement PNG as well as Photoshop's plugin?
Photo of Wahooney

Wahooney

  • 2 Posts
  • 0 Reply Likes
The last version I tried was the CS5 Extended demo, using vanilla png support.

For the purposes of games development (where 9 times out of 10 the alpha channel is not used as intended), too many workarounds are required to use png's semi-effectively, copying transparency into channels, editing, copying back (which doesn't make for fast iterative workflows). I say semi-because the last time I tried saving a png in Photoshop it changed my 100% transparent pixels white, with no option to reserve my colours.

I could be mistaken about the compression though. I did some tests when I still had the demo (close to a year ago, so the memory could be fuzzy), comparing GIMP's png compression with PS's, finding GIMP's results to be smaller, with more options to strip out/add data (meta data, comments, preserving transparent pixels, etc.)
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 818 Reply Likes
If you aren't using the PNG's fourth channel as transparency, then you're probably using the wrong file format for the job. PNG and W3C clearly spell out how PNG's fourth channel is to be used and interpreted - and that is as transparency.

And behind 100% transparency in a straight color format: there is no defined color, and setting that area to a single solid color improves compression.