Home Technical Talk

SuperPNG

polycounter lvl 11
Offline / Send Message
leechdemon polycounter lvl 11
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

  • nezach
    Does anyone know why they made it so Photoshop treats PNGs differently than all the other 'regular' formats as far as how it saves Alphas? I can't think of another general image editing app that does it a different way for png than it does for all the other commonly used formats. Is there some actual benefit beyond the WYSIWYG aspect (which bites more people in the ass than it helps in my experience)? Is it a vestige of some previous system? May be it's just inertia - it works well enough, no one is not buying PS because of it, etc, so why mess with it?


    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.
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    From the reading I've done, PNG (Portable "Network" Graphic) doesn't support "Alpha", it supports "Transparency". So a 4 channel PNG isn't RGBA, it's RGBT. It means relatively the same thing, except that the Alpha is always pre-multiplied; hence the blending with the background color, which photoshop defaults to white. By all accounts, it's handling it correctly; the 3d community just shouldn't be using it for Alpha the way we do Targa, because it's not. So I've read, anyways.

    I get WHY it's done, I just feel it's a lousy implementation of it.
  • .polygon
    Offline / Send Message
    .polygon polycounter lvl 11
    yeah when you make a image with a alpha channel then save it as a superpng. then open it, the alpha is gone and the image will show the checker background where the alpha channel was effecting. there are problems with 64 bit machines so keep that in mind on those plugins
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    You removed your original png.8bi file, and still got these results? Sorry, just trying to be clear so that I can say with certainty to my coworkers if this thing is working or not.
  • Sandro
    It might fix it, but why bother anyways? Patching software to use web-oriented file format for storing game art textures sounds counter-intuitive to me.

    What advantages does png have over for example, tga?
  • nezach
    leechdemon wrote: »
    From the reading I've done, PNG (Portable "Network" Graphic) doesn't support "Alpha", it supports "Transparency". So a 4 channel PNG isn't RGBA, it's RGBT.

    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.
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    Sandro wrote: »
    What advantages does png have over for example, tga?

    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.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Sandro wrote: »
    It might fix it, but why bother anyways? Patching software to use web-oriented file format for storing game art textures sounds counter-intuitive to me.

    What advantages does png have over for example, tga?

    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.
  • nezach
    Sandro wrote: »
    It might fix it, but why bother anyways? Patching software to use web-oriented file format for storing game art textures sounds counter-intuitive to me.

    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.
    What advantages does png have over for example, tga?

    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.
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    nezach wrote: »
    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.
  • Ben Apuna
    When you say "a third the size" that's on disk size not in memory size, right?

    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.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    So this is it? The Holy Grail of 2011? We found it?
  • arrangemonk
    Offline / Send Message
    arrangemonk polycounter lvl 17
    its time for a gamedevelopper friendly image format
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    Ben Apuna wrote: »
    When you say "a third the size" that's on disk size not in memory size, right?

    Yes. AFAIK, file size in memory is unchangeable. Maybe with DDS or something, but even then IDK.
    Ace-Angel wrote: »
    So this is it? The Holy Grail of 2011? We found it?

    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.
  • pedroluchini
    This sounds great! I'll have to try it to see if it solves my problems with transparency.
  • dtschultz
    Offline / Send Message
    dtschultz polycounter lvl 12
    We use Super PNG for all the textures on our engine. I've heard the same reasons you've mentioned as to why we use it. I haven't noticed any issues with the format.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Anyone knows if it works with CS version of Photoshop? I tried installing it, but I can't seem to
    A) Get it to work
    B) Find the previous version of PNG Plugin and delete it
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    Which CS? I'm on CS3 for PC and it's working. "C:\Program Files\Adobe\Adobe Photoshop CS3\Plug-Ins\File Formats" is my path, and I replaced "png.8bi" with "SuperPNG.8bi".
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Wow, CS5 doesn't have "png.8bi" and I can't find it anywhere. And putting in "SuperPNG.8bi" doesn't change anything.

    I wonder if they hard-coded the Formats to save which come natively with PS.
  • Ged
    Offline / Send Message
    Ged interpolator
    yeah I cant find any png file format related files in my cs5 folder but there is the save for web plugin but I cant replace that :(
  • danfitchie
    leechdemon,

    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?
  • leechdemon
    Offline / Send Message
    leechdemon polycounter lvl 11
    Danfitchie - CS3 on WinXP. I believe Ace-Angel has mentioned not getting it to work on CS5. Ive also had an issue with CS3 on Win7-64bit. I forget the details, but I believe it worked, just didn't operate the same way.
  • danfitchie
    Argh sorry I missed that comment.

    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.
  • mrdummy
    The comment from danfitchie is correct.
    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.
Sign In or Register to comment.