Compression artifact

From Puyo Nexus Wiki
Jump to navigation Jump to search

A compression artifact is the result of complex lossy compression which is incapable of storing a certain pattern of data. JPEG is an example of a lossy image compression format notorious for creating artifacts.


Factors

The appearence of artifacts is affected by many factors:

  • Compression quality settings
Sometimes images are purposely compressed at a low quality to conserve space. This is especially common in older images because more people used dialup internet connections which were extremely sensitive to filesizes in transfer operations.
  • Efficiency of the compression algorithm
The compression of an image is only ever as good as it's algorithm. While compression algorithm implementations will continue to have minor improvements, the true bottleneck in compression is at the level of the format itself.
  • Optimizations in the compression algorithm's implementation
The implementation of the compression algorithm may employ optimizations that have adverse affects on the efficiency of the compression algorithm's effectiveness. For example, if an implementation relies on mathematics it may use special 'fast' implementation of the function which aren't necessarily accurate but are less computationally expensive.
  • Accuracy of the compression algorithm's implementations
In some JPEG implementations, like The GIMPs, you can change accuracy settings which may yield better results for lower filesize.
  • The source of the image
The less artifacts caused by factors other than and before the stage of compression, the less likely more artifacts are to show up during the compression stage. For this reason, downsizing an image with artifacts will lead to more artifacts.

Prevention

If you wish to prevent the creation of artifacts in images, you should be careful not to make common mistakes.

  • If you are working with a lossless image, use the PNG format.
The PNG format is ideal for todays fast connections. It provides reasonable compression and has absolutely no adverse effects on images saved in it. It also has optional gamma correction.
  • If you are modifying an image in the JPEG format, use similar or slightly better compression settings.
Everytime an image is compressed, new artifacts are prone to appear. Image editing software like Adobe Photoshop and The GIMP will attempt to minimize these effects by detecting the compression settings and setting them as the default settings for the newly opened image. However, if you are performing excessive edits to this image, using a higher quality setting might be helpful, especially if the source image wasn't high quality.
  • When working with pixel art, do not use lossy formats.
Lossy formats such as JPEG are designed to capture data to reproduce patterns you would see in a common photo. Pixel art doesn't fit into this category because of the high contrast and demand for stability among bodies of color. PNG is a recommended format, but GIF will work as well (Do not use GIF in cases where it will cause color loss - use a good software to perform the GIF processing and make sure you do not have more than 256 colors or alpha transparency, in which case color data will be lost.)
  • Do not use Microsoft Paint to save images.
Paint can't even get PNG right - it messes up gamma somehow and compresses poorly. Just don't do MS Paint. If you must use MS Paint for some awful reason, save as BMP, then use a decent image editor to recompress as PNG.