Table of Contents

Method ConvertColorSpace

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

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

target ImageColorTarget

The space to convert into.

targetProfile IccProfile

The target's profile, or null for sRGB / the SDK gray profile.

intent RenderingIntent

The rendering intent.

blackPointCompensation bool

Whether 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

target is Original or Cmyk, or the profile is of the wrong kind.

Share