ImageSharp icon indicating copy to clipboard operation
ImageSharp copied to clipboard

Color Changed When Resize

Open vinh84 opened this issue 7 years ago • 5 comments

I don't know why :(

Upload image in Github, Gmail have the same issue Resize on Imagesharp have the same issue

But when i try resize using net452, use system.drawing, image color is good, not changed, it is oke

ResizeOptions opt = new ResizeOptions(); opt.Mode = ResizeMode.Max; opt.Size = size.Size; image.Resize(opt).Save(outStream);

Original

image

GitHub

bug_612

bug_612.zip

Sori if my eng is not good

vinh84 avatar Mar 09 '17 04:03 vinh84

I'm sorry I do not understand. What is wrong with the image?

JimBobSquarePants avatar Mar 09 '17 05:03 JimBobSquarePants

original image in bug_612.zip] your resize resized.zip

(i compress in zip because when i upload to github, image changed, them same your issue)

img_5436

vinh84 avatar Mar 09 '17 07:03 vinh84

Hmmm.... The image has an odd ICC profile embedded within it. If it's not just ImageSharp causing the issue then I'm inclined to say it'll be unsupported on most libraries. That said we have no ICC profile embedding at all. It's on my TODO list.

See #74

JimBobSquarePants avatar Mar 09 '17 13:03 JimBobSquarePants

@vinhhrv

We now have ICC preservation within our codebase but the output will still be incorrect as there is a conversion from CMYK to RGB taking place within the decoding process. (This is the same as libjpeg)

We do have a work-in-progress PR in place which will allow us to use the embedded ICC profile to perform a more accurate color conversion. #273

Once that's in we should be able to replicate the Windows decoder which is the only one that performs the conversion correctly.

JimBobSquarePants avatar Oct 06 '17 06:10 JimBobSquarePants

@JimBobSquarePants Thanks

vinh84 avatar Oct 06 '17 07:10 vinh84