Why are PNG-8 files mangled when opened in Photoshop?

9

3

Why are some 32 bit PNGs opened in Photoshop with Indexed Colors and no transparency?

For instance, I grabbed a png icon file of the Stack Overflow logo at: http://blog.stackoverflow.com/wp-content/uploads/icon-so.png When opening it in Photoshop CS3, it apparently treats it as indexed color and gets rid of the alpha channel. The image on the right is a screen grab of the icon. Changing the Image mode in Photoshop to RGB doesn't change the image at all. I've tried this with a few other PNGs and it seems hit or miss.

When viewed in other programs, it displays fine.

left:png opened in Photoshop, right:screen grab of png from browser

left:png opened in Photoshop, right:screen grab of png from browser

What gives?, does Photoshop not interpret the PNG file format correctly?

Daniel Beardsley

Posted 2010-06-12T02:56:31.583

Reputation: 281

1

you can open this png in http://pixlr.com/editor/ and save, resulting png can be opened in photoshop

– kreker – 2013-08-14T23:22:52.063

Answers

9

It looks like the problem is that Photoshop doesn't support part of the PNG-8 standard. PNG-8 like GIF uses a 256 color pallet. Both formats support using one of those 256 indexed colors to represent transparency, PNG-8 also supports setting an alpha-value for each of those 256 colors on the pallete. Photoshop (apparently CS3 and CS4) doesn't support this and renders every pixel opaque.

Daniel Beardsley

Posted 2010-06-12T02:56:31.583

Reputation: 281

Indeed, see http://www.sitepoint.com/blogs/2007/09/18/png8-the-clear-winner/: “I can certainly confirm that none of PhotoShop, Gimp, Paintshop Pro, or Xara has this functionality [PNG8 alpha transparency] built-in.”

– Marcel Korpel – 2010-08-14T11:56:33.253

Updated URL for that article: PNG8 – The Clear Winner

– jeffbyrnes – 2013-03-18T14:55:43.747

0

Simple solution (in Photoshop CC):

Image -> Mode -> Check "RGB Color" (Not Indexed Color)

The file will now be editable as usual.

James

Posted 2010-06-12T02:56:31.583

Reputation: 1

-1

There are two types of PNG files in common use. PNG8 uses indexed colors and has a single color for transparency, which means no alpha channel. PNG24 supports a separate alpha channel. The image you link to is a PNG8.

As for why Photoshop CS3 is mauling PNG8s so badly... that I don't know.

Ignacio Vazquez-Abrams

Posted 2010-06-12T02:56:31.583

Reputation: 100 516

Photoshop CS4 is no better either, though Fireworks CS4 opens it perfectly. No clue what gives. – Darth Android – 2010-06-12T04:01:22.767

I guess it's good to know I'm not just doing something wrong :-) – Daniel Beardsley – 2010-06-12T07:29:10.457