I know the "Why would you bother using PNG" topic is well documented, but it resurfaced here at work and I was forced to find some answers. Turns out someone wrote a file import/export plugin called SuperPNG:
http://www.fnordware.com/superpng . Basically, you replace Photoshops "Png.8bi" file with SuperPNG.8bi, and you'll be saving RGBA images like a champ.
There's some confusion, though.... if you don't remove the original, then Photoshop will default to using the original PNG importer, and it'll appear wrong. Windows doesn't read them correctly, as does a few other programs (any web browser, which correctly assumes PNG Alpha is Transparency). Max, however, reads it correctly, so I'm assuming other apps will as well.
Also, I've heard that the latest version doesn't work correctly with regards to Alpha; I found a copy of an older version at
http://docs.garagegames.com/tge/official/content/documentation/Artists/Shapes/SuperPNG.html ; that's the one I'm working with, and it seems to work correctly.
I say "seems", though... it works in my own testing, but I can't convince anyone else here at work that it's fixing our problem. Does anybody else care to take a look at this for me? If so, it's a great new solution, as far as PNG is concerned.
Replies
Since Photoshop is the industry standard it seems everyone thinks that's just how .pngs work, but it seems to me that it's actually an issue with how they are implemented in PS (OK, it's not just me since someone else made that plugin) and could be changed at the source if it was something they wanted to do.
I get WHY it's done, I just feel it's a lousy implementation of it.
What advantages does png have over for example, tga?
Actually pngs can do both specific pixel value transparency (i.e. "the .gif way") and the RGBA style ("the .tga way"). In both cases I still think the user would be better served by Photoshop handling the image the same way it handles every other common format, or at least having an option to switch from the "special" PNG mode to sane mode. That's just me though I guess.
I think the biggest issue with PNGs is they are flexible enough (two different trans types, indexing, can be an 8 to 64 bit image, etc) that there's lots of little gotchas that can occur with them, especially if you are used to the relative simplicity of TGA. Because of this everyone steers away from them.
The PS issue doesn't help either. I know I'll save to TGA if I have a huge image just so it won't take "forever" to save compared to PNG. Ok, maybe not 'forever,' but the plugin is worth it just for that, 8K pngs have rediculous save times with the default module. Oh man, I wish that old superpng plugin worked with my 64 bit PS.
It has the advantage of being the only format my boss will accept. Our programmers like it's compression and bitdepth (does TGA support alpha with 16-bit images? I can't seem to save them...). I hate it, but they won't take no for an answer.
Well, if every software out there accepted PNG, not only it would be lighter, but also, another format we could use.
Targa is still a standard, but sometimes, it's not nice on the size.
TGA was initially developed to a more video oriented format. Both were designed with specific support goals in mind (neither focused on use for games), but as it turns out are actually pretty robust formats for a wide variety of applications.
Off the top of my head: Better compression than tga style RLE. Png can save up-to 16 bits per channel (not a specific IN GAME use, but helpful for saving high precision normal and height bakes). There's even more stuff pngs have that tga does not (index colors, color transparency) that's not really part of mainstream game art format considerations from what I can tell, but are available as options none the less.
Yeah, the bitdepth is what everyone here loves about it. We do simulation software, and they're really geeked about smoother normal maps, among the rest of the uses. The size can't be beat, either; my 16b 4-channel png is a third the size of my 8b 4-channel tga. That's pretty rad, if nothing else.
FWIW I used the "old" SuperPNG on some sprites for a cell phone game I worked on way back in 2004. It seemed to work great and the programmers didn't complain so it was win/win.
More recently I use PNG as the target format for my baked textures because I actually like the transparency that way (no need to deal with background color bleeding) and yes everyone that I tell that bit of trivia to thinks I'm crazy.
Yes. AFAIK, file size in memory is unchangeable. Maybe with DDS or something, but even then IDK.
So far I think the only people who are trying it are "png-friendly", so it's tough to say. On my end, it appears so... at the very least, it's a format I can use internally to save 16-bit 4-channel in one file, so that's a win on it's own. Still no consensus, but I'm liking it so far.
A) Get it to work
I wonder if they hard-coded the Formats to save which come natively with PS.
I am using SuperPNG as a solution to some problems however am having the issue you describe regarding the correct display of alpha. I can't however seem to get the old version to show up in Photoshop CS5.1, what version are you using if you don't mind me asking?
I have just done some further testing and it seems the old version doesn't work on 64bit but does work in the 32bit version of CS5.1. Whereas with the new version I could get an alpha channel saved with the png (albeit displaying incorrectly in windows), I cannot get an alpha channel out with the old version, only transparency.
Also I didn't have to replace photoshop's default png.8bi to solve the importing issue you mentioned. If you hold shift whilst dragging the png into photoshop a dialog for SuperPNG will appear, which allows you to set default for show alpha as channel not transparency.
You can open PNG file or dragging inside Photoshop. But before you click on [Open] or remove leftclick from your mouse, press SHIFT button first.
Then a small window will appear from SuperPNG.
If you don't press SHIFT first, PNG will be opened at wrong way and you will see perhaps white, black or partially wrong picture, which means the alpha channel is merged with another channels.
Press SHIFT, choose 2nd option (as separated channel) and PNG will showed at correct way. That is if you have textures from game exported.
For next time, you can set default settings and then SHIFT is not more needed until you want change settings again. That is all.
Tested in CS4 64bit / CS5 64bit. There is new v2.0 out, use it.
No need to remove PNG.8bi in CS4 (CS5 has no file for it, it's built-in) to make SuperPNG working.
Good luck.