Skip to content

Add default-intent ICC rendering intent #3475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jcupitt opened this issue May 1, 2023 · 3 comments · Fixed by #4347 or #4366
Closed

Add default-intent ICC rendering intent #3475

jcupitt opened this issue May 1, 2023 · 3 comments · Fixed by #4347 or #4366

Comments

@jcupitt
Copy link
Member

jcupitt commented May 1, 2023

Profiles can optionally include a tag saying which intent they recommend. Using (this profile)[http://www.ifra.com/WebSite/ifra.nsf/html/CONT_ISO_DOWNLOADS] I see:

$ exiftool ~/pics/ISOnewspaper26v4.icc   
ExifTool Version Number         : 12.56
File Name                       : ISOnewspaper26v4.icc
Directory                       : /home/john/pics
File Size                       : 719 kB
File Modification Date/Time     : 2004:06:30 14:06:30+01:00
File Access Date/Time           : 2023:05:01 13:24:35+01:00
File Inode Change Date/Time     : 2023:05:01 13:21:56+01:00
File Permissions                : -rw-rw-r--
File Type                       : ICC
File Type Extension             : icc
MIME Type                       : application/vnd.iccprofile
Profile CMM Type                : Apple Computer Inc.
Profile Version                 : 2.4.0
Profile Class                   : Output Device Profile
Color Space Data                : CMYK
Profile Connection Space        : Lab
Profile Date Time               : 2004:06:28 20:53:23
Profile File Signature          : acsp
Primary Platform                : Apple Computer Inc.
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Unknown (    )
Device Model                    : 
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Unknown (LOGO)
Profile ID                      : 0
Profile Copyright               : Copyright by LOGO GmbH, Steinfurt
Chromatic Adaptation            : 1 0 0 0 1 0 0 0 1
Media White Point               : 0.6442 0.664 0.50038
Gray Tone Reproduction Curve    : (Binary data 1034 bytes, use -b option to extract)
A To B0                         : (Binary data 95052 bytes, use -b option to extract)
A To B1                         : (Binary data 95052 bytes, use -b option to extract)
A To B2                         : (Binary data 95052 bytes, use -b option to extract)
B To A0                         : (Binary data 132248 bytes, use -b option to extract)
B To A1                         : (Binary data 132248 bytes, use -b option to extract)
B To A2                         : (Binary data 132248 bytes, use -b option to extract)
Gamut                           : (Binary data 35414 bytes, use -b option to extract)
Profile Description             : ISOnewspaper26v4

(Rendering Intent in the above listing)

libvips does not support this in an easy way at the moment. The LCMS API is:

        cmsUInt32Number intent = cmsGetHeaderRenderingIntent( profile );

We could add a new VipsIntent, perhaps VIPS_INTENT_DEFAULT, meaning "use the intent recommended by the profile, if any, otherwise use relative".

Reporting discussion: #3474

@dv1
Copy link

dv1 commented Dec 4, 2024

I would also add a defaultIntent property to optional arguments to vips_icc_transform and friends. That one would define what VIPS_INTENT_DEFAULT defaults to if no intent is specified by the profile. This is because for example some people might want the perceptual intent as the default.

kleisauke added a commit to kleisauke/libvips that referenced this issue Jan 20, 2025
Introduce the `VIPS_INTENT_AUTO` enum value and use it as the default
for `vips_icc_transform()` and friends.

Resolves: libvips#3475.
@kleisauke
Copy link
Member

I just opened PR #4347 for this.

kleisauke added a commit to kleisauke/libvips that referenced this issue Jan 24, 2025
Introduce the `VIPS_INTENT_AUTO` enum value and use it as the default
for `vips_icc_transform()` and friends.

Resolves: libvips#3475.
kleisauke added a commit to kleisauke/libvips that referenced this issue Jan 24, 2025
When the requested rendering intent is not supported by the profile,
fallback to the profile's suggested intent. An error will only be
raised if the suggested intent is also unsupported.

Resolves: libvips#3475.
kleisauke added a commit to kleisauke/libvips that referenced this issue Jan 28, 2025
Via the `VIPS_INTENT_AUTO` enum value.

Resolves: libvips#3475.
@kleisauke
Copy link
Member

Correction: PR #4347 falls back to the suggested rendering intent only when unsupported, whereas PR #4366 introduces the VIPS_INTENT_AUTO enum value, which always uses the suggested rendering intent.

jcupitt pushed a commit that referenced this issue Jan 29, 2025
* colour: add support for auto-selecting the rendering intent

Via the `VIPS_INTENT_AUTO` enum value.

Resolves: #3475.

* colour: leave room for possible new rendering intents
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants