Colour management: VIPS Reference Manual

## Colour management

`vipsthumbnail` will optionally put images through LittleCMS for you. You can use this to move all thumbnails to the same colour space. All web browsers assume that images without an ICC profile are in sRGB colourspace, so if you move your thumbnails to sRGB, you can strip all the embedded profiles. This can save several kb per thumbnail.

For example:

    $ vipsthumbnail shark.jpg
    $ ls -l tn_shark.jpg
    -rw-r–r– 1 john john 7295 Nov  9 14:33 tn_shark.jpg

Now encode with sRGB and delete any embedded profile:

    $ vipsthumbnail shark.jpg --eprofile srgb --delete
    $ ls -l tn_shark.jpg
    -rw-r–r– 1 john john 4229 Nov  9 14:33 tn_shark.jpg

(You can use the filename of any RGB profile. The magic string `srgb` selects a high-quality sRGB profile that’s built into libvips.)

`tn_shark.jpg` will look identical to a user, but it’s almost half the size.

You can also specify a fallback input profile to use if the image has no embedded one. This can often happen with CMYK images, producing an error message like:

    $ vipsthumbnail kgdev.jpg
    vipsthumbnail: unable to thumbnail kgdev.jpg
    vips_colourspace: no known route from 'cmyk' to 'srgb'

If you supply a CMYK profile, it will be able to convert the image, for example:

    $ vipsthumbnail kgdev.jpg --iprofile cmyk

(As before, the magic string `cmyk` selects a high-quality CMYK profile that’s built into libvips, but you can use any CMYK profile you like.)