Class IccProfile
- Namespace
- LMKit.Graphics.Primitives
- Assembly
- LM-Kit.NET.dll
An ICC colour profile: the bytes of an .icc / .icm file and the facts it
states about itself (the device colour space, its channel count, its class and its
description). Profiles come from a file, from raw bytes (for example the profile a
loaded image embeds, IccProfile), or from
the three the SDK builds itself: Srgb, Gray and
GenericCmyk.
public sealed class IccProfile
- Inheritance
-
IccProfile
- Inherited Members
Examples
using LMKit.Graphics.Primitives;
using LMKit.Media.Image;
IccProfile press = IccProfile.FromFile("ISOcoated_v2_300_eci.icc");
Console.WriteLine($"{press.Description}: {press.ColorSpace}, {press.Channels} channels");
using ImageBuffer photo = ImageBuffer.Load("photo.jpg");
byte[] tiff = photo.Encode(ImageOutputFormat.Tiff, new ImageBuffer.ImageEncoderOptions
{
ColorTarget = ImageColorTarget.Cmyk,
TargetProfile = press,
});
Remarks
A profile is the ONLY honest way to name a colour space: the same four ink values print differently on coated and uncoated paper, and a press asks for its own profile. The generic CMYK profile the SDK builds is a placeholder for a press profile the caller does not have yet - correct in structure, generic in colour - and says so in its description.
Instances are immutable and safe to share between threads.
Properties
- Channels
The number of device channels (1 for gray, 3 for RGB, 4 for CMYK).
- ColorSpace
The device colour space the profile describes (Rgb, Cmyk, Gray, ...).
- Description
The profile's description (its
desctag), for example"sRGB IEC61966-2.1"; empty when the profile carries none.
- DeviceClass
The profile class as its four-character ICC signature:
"mntr"(display),"prtr"(output / press),"scnr"(input),"spac"(colour space),"link"(device link),"abst"or"nmcl".
- GenericCmyk
"LM-Kit Generic CMYK": a structurally complete press profile built from the standard ink model with full undercolour removal. It makes a valid CMYK file when no press profile is at hand; a real print job should carry the printer's own profile.
- Gray
A single-channel gray profile with the sRGB transfer curve.
- Length
The size of the profile in bytes.
- Srgb
sRGB IEC 61966-2-1, the space every untagged RGB image is read in.
Methods
- FromBytes(byte[])
Wraps the bytes of an ICC profile. The bytes are parsed once and kept (the array is copied, so a caller may reuse its buffer).
- FromFile(string)
Reads an
.icc/.icmfile.
- ToArray()
A copy of the profile bytes, ready to be written to an
.iccfile or embedded.
- TryParse(byte[], out IccProfile)
Parses the bytes of an ICC profile;
false(andnull) when they are not one.