SixLabors / ImageSharp

:camera: A modern, cross-platform, 2D Graphics library for .NET
https://sixlabors.com/products/imagesharp/
Other
7.48k stars 851 forks source link

Color Changed When Resize #129

Open vinh84 opened 7 years ago

vinh84 commented 7 years ago

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

JimBobSquarePants commented 7 years ago

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

vinh84 commented 7 years ago

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

JimBobSquarePants commented 7 years ago

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 commented 7 years ago

@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.

vinh84 commented 7 years ago

@JimBobSquarePants Thanks