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

Colours in CMYK #331

Open
Robsteranium opened this issue Feb 5, 2021 · 1 comment
Open

Colours in CMYK #331

Robsteranium opened this issue Feb 5, 2021 · 1 comment

Comments

@Robsteranium
Copy link

The printing company we're using requires PDFs with a CMYK colourspace.

I guess we can work in RGB then convert the results to CMYK (e.g. with imagemagick), but, if IIRC, the colour conversion is lossy. Would it be possible to work with CMYK in squib (i.e. images and colour specifications) and have it output PDFs in that colourspace?

I'm not familiar with Cairo, so I don't know at what level we'd need to configure that.

I can see that you can specify CMYK colours with Cairo::Color::CMYK, but because Squib::Graphics::CairoContextWrapper#set_source_squibcolor calls Cairo::Context::Color#set_source_color which in turn calls set_source_rgba we seem to inevitably be in an RGB colourspace.

I'd be grateful if someone could say whether this is possible, and to perhaps suggest what might need to be done to support CMYK.

@andymeneely
Copy link
Owner

Ah yes, CMYK. This is a bit of an albatross for the Cairo community, buckle up.

The short answer is that that Cairo probably won't be supporting color management profiles anytime soon. And that hurts projects like Gimp, Inkscape, and many others that rely on Cairo like we do. As you can see in the Cairo documentation, everything is in RGB.

There's a long, sordid history to this. Someone attempted in 2008 but it was never integrated, and then this article in 2012 talks about it, I saw it brought up as a GSOC 2019 project idea and then I saw it brought up in other places recently too. Maybe they'll get to it since people keep bringing it up? Who knows.

I'm surprised to the Cairo::Color::CMYK in rcairo. Not sure what that's about.

Now, if there's a way to post-process the images with color profiles... I'd love to hear about it. I'd be happy to document it (or cite you on the docs). I haven't looked into it myself.

I'm going to keep this issue open indefinitely until we get a good solution to this.

@andymeneely andymeneely moved this to 🆕 New in Squib Backlog Jun 5, 2022
@andymeneely andymeneely moved this from 🆕 New to 📋 Backlog in Squib Backlog Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants