Simplify ICC processing when retaining input profiles #4468

Takes advantage of libvips' improved ICC handling
This commit is contained in:
Lovell Fuller
2025-11-04 15:06:49 +00:00
parent 4f9f8179a6
commit e1628d8ef5
5 changed files with 38 additions and 17 deletions

View File

@@ -201,7 +201,7 @@ const dataWithMergedExif = await sharp(inputWithExif)
Keep ICC profile from the input image in the output image.
For non-RGB output use [toColourspace](/api-colour/#tocolourspace).
When input and output colour spaces differ, use with [toColourspace](/api-colour/#tocolourspace) and optionally [pipelineColourspace](/api-colour/#pipelinecolourspace).
**Since**: 0.33.0
@@ -211,6 +211,14 @@ const outputWithIccProfile = await sharp(inputWithIccProfile)
.keepIccProfile()
.toBuffer();
```
**Example**
```js
const cmykOutputWithIccProfile = await sharp(cmykInputWithIccProfile)
.pipelineColourspace('cmyk')
.toColourspace('cmyk')
.keepIccProfile()
.toBuffer();
```
## withIccProfile

View File

@@ -16,3 +16,6 @@ slug: changelog/v0.34.5
* Improve error messaging when only warnings issued.
[#4465](https://github.com/lovell/sharp/issues/4465)
* Simplify ICC processing when retaining input profiles.
[#4468](https://github.com/lovell/sharp/issues/4468)