Method ConvertColorSpace
ConvertColorSpace(ImageColorTarget, IccProfile, RenderingIntent, bool)
A new image in the requested colour space, colour-managed: the source is read through its embedded profile (sRGB or the SDK's gray profile when it has none) and mapped into the target profile with the rendering intent. Rgb and Gray only: CMYK is an encoded colour space, not a working pixel format - ask the JPEG or TIFF encoder for it through ColorTarget. Metadata is carried, the ICC family replaced by the target profile (or dropped for untagged sRGB).
public ImageBuffer ConvertColorSpace(ImageColorTarget target, IccProfile targetProfile = null, RenderingIntent intent = RenderingIntent.Perceptual, bool blackPointCompensation = true)
Parameters
targetImageColorTargetThe space to convert into.
targetProfileIccProfileThe target's profile, or
nullfor sRGB / the SDK gray profile.intentRenderingIntentThe rendering intent.
blackPointCompensationboolWhether the source black maps onto the target black.
Returns
- ImageBuffer
A new image the caller owns.
Examples
using ImageBuffer p3 = ImageBuffer.Load("display-p3.png"); // tagged Display P3
using ImageBuffer srgb = p3.ConvertColorSpace(ImageColorTarget.Rgb); // untagged sRGB, same look
Exceptions
- ArgumentException
targetis Original or Cmyk, or the profile is of the wrong kind.