Metadata optimization

Images carry a lot of additional textual information with them like camera model, ISO, aperture, shutter speed etc. While this information may be relevant for a lot of applications, for the visitors on your website, removing these values while delivering the image can save a lot of KBs. 


By default, ImageKit delivers an optimised version of the original image that does not contain any metadata. The original copy of the image, if accessed, would still contain all the metadata if needed.


If you want to preserve all the image metadata in your output image, then there are two options 


1. Use the 'md' URL parameter

This URL parameter, overrides any other setting in your dashboard, and preserves the complete metadata from the input image in the output image.


Syntax

md-true


Image URL

http://ik.imagekit.io/demo/img/tr:md-true/medium_cafe_B1iTdD0C.jpg


2. Change the metadata setting from the dashboard

Instead of adding md-true to every URL, if you want to preserve metadata for every image, then you can just enable it from your ImageKit dashboard.

a. Go to "Image Settings" > "Advanced"

b. Change the "Preserve image metadata in output" setting to "Preserve complete metadata" and click on "Save". 



c. On successful update, you will get a confirmation and the setting would be applied instantly to all images that are not cached on ImageKit's delivery network. 


Note that preserving all image metadata in the output image will result in increased bandwidth consumption and poorer performance for your website users.



Preserving color profile in image metadata

This optimization has been found to be specifically useful for e-commerce companies, where the brightness and colors in the image have a great impact on the sales of the product. 


As mentioned above, ImageKit removes all image metadata by default. One of the metadata items which get removed is the color profile, which basically indicates how a particular color is to be displayed on the user's screen. 


We can preserve all the metadata of the image, and as a result the color profile as well, by using the metadata optimization above. But, for most cases, preserving only the color profile is sufficient for web and app, where users want lighter images with good colors and none of the other metadata information is useful for them.


Preserving color profile can again be done in two ways -  


1. Use the 'cp' URL parameter

This URL parameter, overrides any other setting in your dashboard, and preserves the color profile in the image metadata from the input image in the output image and removes all the other image data.


Syntax

cp-true


Image URL

http://ik.imagekit.io/demo/img/tr:cp-true/medium_cafe_B1iTdD0C.jpg


2. Change the metadata setting from the dashboard

Instead of adding cp-true to every URL, if you want to preserve color profile for every image, then you can just enable it from your ImageKit dashboard.

a. Go to "Image Settings" > "Advanced"

b. Change the "Preserve image metadata in output" setting to "Preserve only color profile" and click on "Save". 

c. On successful update, you will get a confirmation and the setting would be applied instantly to all images that are not cached on ImageKit's delivery network. 



Auto-orientation optimization

This optimization is again dependent on the image metadata. It deals with the EXIF orientation tag in the image metadata and how it is used to correct the image orientation for display before sending the image to the user.


This transformation has been discussed in detail in this article here that talks about image rotation and auto-orientation.


If you have any questions about these optimizations, please reach out to us by creating a support ticket from your ImageKit dashboard.