Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening and saving jpeg using CMYK color space drastically changes image's color #1238

Closed
4 tasks done
gsfreema opened this issue Jun 18, 2020 · 7 comments
Closed
4 tasks done

Comments

@gsfreema
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

The following image was created using the CMYK color space.

SolidColor_CYMK

Loading this file and then saving results in this image.

Modified - SolidColor_CYMK

(On my machine, the two images look the same in this issue but if you download the images, you will see the difference. Maybe github is experiencing the same thing 😃)

Steps to Reproduce

The following code is all you need to convert the first image into the second one. Note that this is a .Net Core 3.1 app using C#8.

const string FileName = "SolidColor_CYMK.jpeg";
using var image = Image.Load(FileName);
image.Save($"Modified - {FileName}");

System Configuration

  • ImageSharp version: 1.0.0-rc.2
  • Other ImageSharp packages and versions: N/A
  • Environment (Operating system, version and so on): Win10 1809 x64
  • .NET Framework version: .Net Core 3.1
  • Additional information:
@JimBobSquarePants
Copy link
Member

Yeah, that's expected. We don't have methods to correctly translate the CMYK color information. As you can see, many browsers do the same.

See previous related issues
#129
#74

And related Work-In-Progress PR.
#273

@gsfreema
Copy link
Author

Thanks for the quick response. I searched for CMYK and I had seen the other issue about ICC Profiles but I wasn't sure it was the same given that I thought I selected to not save the ICC profile when generating the image. I thought I limited it to just using CMYK and was semi-proud of myself since I am far from experienced with image processing 😄 .

@JimBobSquarePants
Copy link
Member

Be proud. Image processing is hard! Hopefully we'll make it a little bit easier for all.

@timdinhdotcom
Copy link

Is there a way to convert an RGB image to CMYK?

@JimBobSquarePants
Copy link
Member

We currently don't support encoding jpeg as CMYK so any conversion we do would be lost.

@JimBobSquarePants
Copy link
Member

Fixed via #2120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@JimBobSquarePants @gsfreema @timdinhdotcom and others