PeachImage
PeachImage.Image
Image.ConvertToSrgb Method
| Overloads | |
|---|---|
| ConvertToSrgb() | Color-manages this image using its own embedded ICC profile (GetIccColorProfile()), producing a new Rgba32Image — the high-level convenience over ConvertToSrgb(ReadOnlySpan<byte>, Span<byte>, int, Nullable<IccRenderingIntent>, bool) for the common case of “just color-manage this image for me.” A missing or unusable embedded profile is a normal, expected outcome (most images don’t carry one) rather than an error: when there’s nothing to convert — no usable profile, its channel count doesn’t match this image’s own pixel format, or PixelFormat isn’t one ICC conversion applies to (it’s already Rgba32, for instance) — this same instance is returned unchanged rather than throwing or allocating a needless copy, the same “may return this” contract Resize(int, int, ResizeOptions) documents (see its own remarks for the disposal implications of that). |
| ConvertToSrgb(IccColorProfile) | Like ConvertToSrgb(), with a fallback for CMYK images that carry no usable ICC profile: the fallbackCmykProfile when given, otherwise the profile-less formula R = 255 x (1 - C) x (1 - K) (likewise G and B). That formula is an approximation, not a colour-managed conversion. A raw Ycck32 image (from DecodeRawYcck) is converted to CMYK first and then follows the same path; without DecodeRawYcck the JPEG decoder already returns standard Cmyk32. Gray and RGB images without a profile are returned unchanged. |
Image.ConvertToSrgb() Method
Color-manages this image using its own embedded ICC profile (GetIccColorProfile()),
producing a new Rgba32Image — the high-level convenience over
ConvertToSrgb(ReadOnlySpan<byte>, Span<byte>, int, Nullable<IccRenderingIntent>, bool) for the common case of “just color-manage this image for me.”
A missing or unusable embedded profile is a normal, expected outcome (most images don’t carry one) rather
than an error: when there’s nothing to convert — no usable profile, its channel count doesn’t match this
image’s own pixel format, or PixelFormat isn’t one ICC conversion applies to (it’s already
Rgba32, for instance) — this same instance is returned unchanged rather than
throwing or allocating a needless copy, the same “may return this” contract Resize(int, int, ResizeOptions)
documents (see its own remarks for the disposal implications of that).
public PeachImage.Image ConvertToSrgb();
Returns
Image.ConvertToSrgb(IccColorProfile) Method
Like ConvertToSrgb(), with a fallback for CMYK images that carry no usable ICC profile: the
fallbackCmykProfile when given, otherwise the profile-less formula R = 255 x (1 - C) x (1 - K)
(likewise G and B). That formula is an approximation, not a colour-managed conversion. A raw
Ycck32 image (from DecodeRawYcck) is converted to CMYK first and then follows the same path; without
DecodeRawYcck the JPEG decoder already returns standard Cmyk32. Gray and RGB images without a
profile are returned unchanged.
public PeachImage.Image ConvertToSrgb(PeachImage.IccColorProfile? fallbackCmykProfile);
Parameters
fallbackCmykProfile IccColorProfile
A CMYK profile to use when the image has none of its own, or null for the naive formula.