Topic: [Feedback wanted] I made a help page about Image Quality

Great wiki page! Here are some changes I would make. Feel free to copy them (warning: LONG!)

What is JPEG and why is it bad?

The JPEG (jpg) format started development in 1986 and standardised in 1992 to allow digital photographs to be stored on computers back when computers had very little hard drive space. JPEG works by using complex mathematics to carefully remove many details of the image that we usually don’t notice at first to allow the image to be smaller. Depending on the amount of JPEG compression used, the image may only degrade very slightly or it may degrade very noticeably. JPEG works great for photos because photos are extremely complex and also contain a lot of data that we can’t really make use of, and with modern cameras taking pictures at very high resolutions, the compromises JPEG makes are even less noticeable.

So why is JPEG so bad at compressing art? The answer is that no matter how detailed a piece of art is, it will never contain the amount of differences between pixels that a photo has and is most often not as high resolution. As a result JPEG’s compression is very easy to notice. You may notice that colours become duller (especially red), square artefacts show up (that’s called macroblocking), gradients appear broken up (banding), and/or the image becomes less sharp. Browse through the tag compression_artifacts and you’ll notice why JPEG is bad for art and why e621 deletes JPEGs when a higher quality option (e.g. PNG) is uploaded.

What is PNG and why is it good?

PNG started development in 1995 and was standardised in 1996, originally to be an improved, patent-free replacement for GIF for still images. PNG supports up to 64-bit colour (48-bit when compressed) and supports proper alpha channel transparency: GIF only supports 8-bit colour and non-variable transparency. (JPEG doesn’t support transparency at all because it was designed for photos.)

PNG is either uncompressed or it uses lossless compression. As the name suggests, it does not throw away any data. As explained before, JPEG compression works by using mathematics to throw away data a photograph doesn’t necessarily need. PNG compression instead uses mathematics to pack the image into a smaller space without throwing anything away, and then unpacks it when you open it. Compressing PNGs with higher amounts of compression only makes the file smaller and requires more CPU power to compress and uncompress. In comparison, compressing a JPEG more means throwing away more data and ending up with a lower quality image. PNG stays the same no matter how much it is compressed.

Note: converting or re-saving a JPG to a PNG will not magically improve the image quality. When an image is saved as JPEG the computer has already thrown away data, and that data cannot be recovered. Saving a JPEG as a PNG simply saves the JPEG in exactly the same state that it was already in.

Also, some websites lie about the format the image is in. FurAffinity is most notable for this: often a PNG is uploaded to FurAffinity and their servers automatically compress a PNG larger than 1280x1280 into a JPG, but for some reason they don’t automatically change the file extension from PNG to JPG.

In summary, a PNG is an exact representation of what the artist created no matter how much it’s compressed, making it ideal for art.

What about GIF?

GIF was created in 1987 to be an online image format. It supports only 256 colours and non-variable transparency. The one thing GIF does that other formats don’t do is animation. Although PNG has been extended into APNG to allow animation, that format is not in widespread use.

Although GIF is technically a lossless format, using the once patented LZW compression method, the main problem with GIF is that it only supports 256 colours. For the most part, this is solved through the use of a process called dithering, where colours are arranged in special patterns to better recreate the original image. Unfortunately the low colour support is still an issue no matter how good the dithering is - images can only be dithered so much with only 256 colours available.

On top of that, GIF is much less efficient at compressing. For small animations, this doesn’t really matter, but longer animations will have a very large filesize. The solution for this is always a compromise, usually lowering the frame rate, lowering the resolution, or even just cutting the animation short. Because of this, it is recommended to compress longer animations into a video file (typically MP4 or WebM). That said, shorter animations will also benefit from being compressed into a video file, because video files don’t have any of the limitations of GIF.

What are your thoughts? I hope what I wrote was good! :D

Updated by anonymous