Using ICC Profile converter in V4 #2999
-
|
Hello, With #1567 done, I'm interested in start testing this features. But I'm hitting a few difficulty. (I'm using
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats;
var decoderOptions = new DecoderOptions
{
ColorProfileHandling = ColorProfileHandling.Convert,
};
using var image = Image.Load<Rgba32>(decoderOptions, "sRGB_Gray.jpg");
Console.WriteLine(image[0,0]);
image.Save("sRGB_Gray_out.jpg"); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hi @Socolin
All operations on images in ImageSharp require conversion to The ColorConversionOptions options = new()
{
SourceIccProfile = profileIn,
TargetIccProfile = profileOut,
};
ColorProfileConverter converter = new(options);
converter.Convert<Cmyk, Rgb>(source, destination);
Yes, your finding is correct. The existing method is not robust enough and we cannot rely on header checks alone. I've opened #3008 to address this. |
Beta Was this translation helpful? Give feedback.

Hi @Socolin
All operations on images in ImageSharp require conversion to
TPixelformat that can be easily converted to an RGBA compatible buffer of floats typically expressed byVector4so you are not able to load an image and work in co…