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

@@ -256,7 +256,7 @@ function withExifMerge (exif) {
/**
* Keep ICC profile from the input image in the output image.
*
* For non-RGB output use {@link /api-colour/#tocolourspace toColourspace}.
* When input and output colour spaces differ, use with {@link /api-colour/#tocolourspace toColourspace} and optionally {@link /api-colour/#pipelinecolourspace pipelineColourspace}.
*
* @since 0.33.0
*
@@ -265,6 +265,13 @@ function withExifMerge (exif) {
* .keepIccProfile()
* .toBuffer();
*
* @example
* const cmykOutputWithIccProfile = await sharp(cmykInputWithIccProfile)
* .pipelineColourspace('cmyk')
* .toColourspace('cmyk')
* .keepIccProfile()
* .toBuffer();
*
* @returns {Sharp}
*/
function keepIccProfile () {