Image metadata optimization

Metadata, in general, is “data about data”. Thus, image metadata is the data about the image. Image metadata optimization deals with removing the image metadata, either completely or partially, to reduce the size of the image.

What exactly is image metadata?

Image metadata comprises of information about the image, information about the equipment used to click the image (if it is clicked from a camera), technical information like shutter speed, ISO of the camera etc and descriptive details like copyright information, the name of the creator, keywords related to the image etc. Some of the data is automatically associated with the image at the time of creation while some can be added or edited using a software.

While this data is important to identify the source of the image and the copyrights associated with it, it is not useful for use on the web or mobile apps. There is no proof that this data is used by search engines to index the images.

Thus, it is safe to remove it, either completely or partially, which will help save a few KBs on every image. Multiply it over a million images and you can save several GBs of bandwidth.

Image metadata optimization with ImageKit

ImageKit provides 3 modes for your image metadata

  1. Preserve complete metadata

  2. Preserve only colour profile from the metadata and discard everything else

  3. Discard all metadata

By default, ImageKit discards all metadata.

Colour profile characterises a colour input or output device or a colourspace. In simple terms, it will impact how the colors in your image are displayed on the monitor. The general recommendation for the web is to remove all colour profiles associated with the image and ImageKit follows that. However, if you feel that your image looks saturated (or dull or loses colour) after delivering via ImageKit, you can change the Image metadata setting in your dashboard to preserve the colour profile. Also, you can use the colour profile URL transformation (tr:cp-true).

There might be cases where you may want to preserve the full metadata of the image. You can do so by changing the image metadata setting in your dashboard or by using the tr:md-true transformation in the URL.

Note that, ImageKit’s images are cached on the CDN and some internal caches. So the changes you make to the metadata settings may not reflect immediately for the existing images. To make them take effect immediately, you will need to change the image URL. This can be done by adding any query param to the URL or using URL-based metadata transformations as explained above.

If you decide not to change the image URL, the changes for existing images would reflect in a maximum of 30 days. The changes will get into effect immediately for any new image that you fetch via ImageKit.