Enhancement: support custom (non sRGB) output ICC profiles and colourspaces
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 32.7k
- Forks
- 1.4k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Description
This 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):
```javascript
sharp(input)
.withMetadata({ profile: '/path/to/rgb.icc' })
...
```
Convert to and attach existing RGB output profile (proposed):
```javascript
sharp(rgbInput)
.toColourspace('rgb')
.withMetadata()
...
```
Convert to and attach custom CMYK output profile (proposed):
```javascript
sharp(input)
.toColourspace('cmyk')
.withMetadata({ profile: '/path/to/cmyk.icc' })
...
```
Convert to and attach existing (or default if missing) CMYK output profile (proposed):
```javascript
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):
```javascript
sharp(input)
...
```
Convert to and attach existing sRGB output profile (existing behaviour):
```javascript
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sharp withMetadata and toColourspace entry points and the libvips icc_export and icc_transform operations named in the issue. Compare the existing sRGB profile behavior with the proposed custom RGB and CMYK cases. Done means the documented examples work while existing sRGB behavior remains unchanged; no files or tests are named here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100