Log in

No account? Create an account

Previous Entry | Next Entry


The following may be excessively geeky, this could lead to you understanding concepts that could kill conversation at trendy parties. You have been warned.. oh, and here be dragons.

Ok.. this could get geeky. I'm basically going to talk about PNG files. This is sparked by a comment I made over at cowkitty's journal, and I thought I may as well type out some more on the subject. The reason mostly being that I've been playing these while making the Twilight page design, and found that many people know nothing about it.

PNG Files - PNG files ('ping' - Portable Network Graphic) have been around for quite a while really, but its only in the last year or two that the format has gained widespread acceptance. This is in part to IE not supporting them well, and Adobe PhotoShop writing enormous versions of them.

But I'll get onto that in a second. First some background.

PNG's grew up as an alternative to GIF's (correct pronunciation is Juh-if, but most ppl call them guh-ifs, I know I do) as that format was very outdated, and suddenly developers got hit with a load of licence fees as Unisys enforced its patent. Burn All Gifs is a, rather militant, information source about that.. I won't go into it as the issues are really mostly old news.

The newer PNG format compressed files smaller, supported more colours, and supported alpha information (transparency).. so why isn't it rocking everyone’s socks? Bad support and misunderstanding mainly. For example... jpeg's are better for photos on the web, they create smaller images. This is because its a 'lossy' format - if you've seen the fuzz that some jpgs have in areas of pure colour - that’s the lossy bit at work. Its like a guess of the original image. PNG's are 'lossless' which means that they don't throw out information, or in the case of 8bit images, only the colour info that you want thrown out. You shouldn't really use PNG's for photos on the web, but if you want to save a copy without losing info then you should use PNG. Its a matter of application. Its not a catch all format, its just a different one.

This is another point, PNG's are 8bit (like gifs - 256 colours) and also up to 48bit (silly number of colours, jpgs are 24bit). They also support alpha info as a separate channel, or in the palette (so rather than just RGA for colours, its RGBA - alpha). This is great.. seriously, its a great advance. However IE only displays binary transparency (like gifs use), not the many shades that PNG's support, you can get it to do it, but its a hack, and not that useful.

Also Photoshop only supports the binary alpha in 8bit, or the full in 24bit. no other modes. As well as this it produces huge files. This was another big thing of PNG - it creates smaller files than GIF... and it does - if done properly. Photoshop doesn't do it right, just compare in the 'Save For Web' to see what I mean.

I downloaded the great Web Image Guru to use as an export plug-in in Photoshop. It does the job of other useful little programs that you can download (like pngcrush, or pngout) but in a windows GUI and in PS. Great. an example comparison of size of the same image would be:

PS - 16kb
pngcrush - 8.8kb
pngout - 8.0kb
WIG - 7.6kb

See the difference? Now 8kb isn't that much, but image the bandwidth savings on a website that uses loads of images? Now does it make more sense?
All the browsers and major graphics apps support PNG files, so really its lack of user knowledge on the web that is preventing this format from being everywhere, that and Photoshop's awful implementation of the compression. When Adobe correct this (and its been bad since it was implemented 2 versions ago, so I'm not holding my breath here) you'll see a huge boost I bet.

"But I'm not a web designer... I don't give a crap about this! I'm an artist! What’s PNG got to do with me??"

Good question.
In short - quality. If you use Photoshop you'll prolly use its PSD file format, which is all well and good, but what about archiving finished work? You don't need the info in PSD's and so the extra size is just taking up space. The solution - save to PNG. It is lossless - so you won't lose any quality, and its portable across all platforms, so its easy to show people your work. If you save to jpeg you will most likely get a smaller file, but at the loss of the quality of your image.

Also if you are cartoonist it will work really well - flat colours and gradients compress well, and without any distortion. Plus you can show this image on the web confident that it will look as good as you made it. Many web comics (Scary-Go-Round and Real Life for example) use PNG's as the format to display their comic, that way they get as many colours as they want, and no nasty 'halo' effects around their lines.

In addition to this you have other features of PNG's - like gamma correction, to preserve how your image looks across all platforms an monitors. The gamma difference between PC and Mac can make a huge difference, let alone different monitor set-ups. PNG has gamma correction built into the format (something else that PS used to screw up, but now seems to be fixed).

Overall there is no reason to use GIF's anymore. None. I was dubious about this claim, but seriously... none. Its also a pretty neat format for many other reasons too.. and when the transparency options are fully supported in IE it will rock greatly.

Ok.. that’s the end of the geekiness, but f you'd like to know more check out this page at LibPNG. All the info you could ever need.

Totally unrelated - its thundering here. This should be a shock to no-one.