Enhancement: support custom (non sRGB) output ICC profiles and colourspaces
See original GitHub issueThis will convert pixel values using a provided ICC profile and attach that profile to the output image metadata.
It should assume the profile is RGB. If e.g. a CMYK profile is required, toColourspace
must be used in addition.
Convert to and attach custom RGB output profile (proposed):
sharp(input)
.withMetadata({ profile: '/path/to/rgb.icc' })
...
Convert to and attach existing RGB output profile (proposed):
sharp(rgbInput)
.toColourspace('rgb')
.withMetadata()
...
Convert to and attach custom CMYK output profile (proposed):
sharp(input)
.toColourspace('cmyk')
.withMetadata({ profile: '/path/to/cmyk.icc' })
...
Convert to and attach existing (or default if missing) CMYK output profile (proposed):
sharp(cmykInput)
.toColourspace('cmyk')
.withMetadata()
...
The icc_export
, or icc_transform
when no input profile, operation can be used for this.
The current existing behaviour, as in the following examples, will remain.
Convert to sRGB without embedded profile (existing behaviour):
sharp(input)
...
Convert to and attach existing sRGB output profile (existing behaviour):
sharp(input)
.withMetadata()
...
See #1324 for custom input profile support.
See #218 for previous discussion on this and related features.
See #734 for a related enhancement that this might address.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:15
- Comments:27 (12 by maintainers)
Top GitHub Comments
Every issue tagged as an enhancement, such as this, represents a future possible enhancement; there is no “ETA”, “roadmap” or “timeline”.
On behalf of all sharp users I am always very grateful to anyone that helps implement such enhancements, either by using their own time to work on and submit a pull request or by offering to pay for my time to do likewise.
Any movement on this? I’d simply like to replace the sRGB.icc with some Compact ICC Profiles in certain scenarios…