Skip to content

Colors: Add libvips support to preserve ICC profiles in thumbnails #1474

@bobobo1618

Description

@bobobo1618

As a user who has pictures with color profiles other than sRGB, I want PhotoPrism to preserve them in the generated thumbnails so that the colors are properly reproduced on devices/displays that support ICC profiles.

Since thumbnail generation with libvips seems mature enough and we haven't noticed any particular issues or downsides, we've decided to make it the default in our upcoming release without waiting any further. We have updated our preview build so that you can test the latest changes and improvements:

The following config options will be available with our upcoming release (or when using the preview build):

Environment CLI Flag Default Description
PHOTOPRISM_THUMB_LIBRARY --thumb-library auto image processing LIBRARY to be used for generating thumbnails (auto, imaging, vips)
PHOTOPRISM_THUMB_COLOR --thumb-color auto standard color PROFILE for thumbnails (auto, preserve, srgb, none)
PHOTOPRISM_THUMB_FILTER --thumb-filter auto downscaling filter NAME (imaging best to worst: blackman, lanczos, cubic, linear, nearest)
PHOTOPRISM_THUMB_SIZE --thumb-size 1920 maximum size of pre-generated thumbnails in PIXELS (720-7680)
PHOTOPRISM_THUMB_SIZE_UNCACHED --thumb-size-uncached 7680 maximum size of thumbnails generated on demand in PIXELS (720-7680)
PHOTOPRISM_THUMB_UNCACHED --thumb-uncached generate missing thumbnails on demand (high memory and cpu usage)
PHOTOPRISM_JPEG_QUALITY --jpeg-quality 83 higher values increase the image QUALITY and file size (25-100)
PHOTOPRISM_JPEG_SIZE --jpeg-size 7680 maximum size of generated JPEG images in PIXELS (720-30000)
PHOTOPRISM_PNG_SIZE --png-size 7680 maximum size of generated PNG images in PIXELS (720-30000)

If you build from source or use one of our binary installation packages, please note that the system on which you build and/or run PhotoPrism must have libvips >= 8.10 installed.


Original Issue Report

Steps to reproduce:

  • Obtain image with an ICC profile applied (e.g. AdobeRGB)
  • Import into Photoprism
  • Navigate to photo in Photoprism
  • Visually compare to original

Expected result: Lower resolution, identical colours.

Actual result: Lower resolution, very noticeable reduction in saturation.

Downloading the thumbnail image and comparing to the original with exiftool shows that the thumbbnail lacks the ICC profile of the original. Copying the ICC profile from the original to the new resolves the problem:

exiftool -icc_profile -b -w icc file.jpg
exiftool "-icc_profile<=file.icc" fit_2048.jpg

Metadata

Metadata

Labels

enhancementEnhancement or improvement of an existing featurereleasedAvailable in the stable releasethumbnailsImage Sizes, Quality, Colors & ConversionuxImpacts User Experience

Type

No type

Projects

Status

Release 🌈

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions