Bug 378769

Summary: CMYK pdf import/pdf export
Product: [Applications] krita Reporter: Alex <eneeen>
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: amy, griffinvalley, halla
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In:

Description Alex 2017-04-14 11:07:55 UTC
These could be nice additions when professional printing is involved.
1. Current pdf import is always RGB, but press pdfs are CMYK. Workaround by creating CMYK image and inserting pdf layer still uses CMYK->RGB->CMYK conversion
2. Exporting PDF in both CMYK and RGB to allow direct sending files to print office without any additional tools.
Comment 1 wolthera 2017-04-14 16:01:20 UTC
We actually removed PDF export because there's no good libraries to handle PDF cmyk support. We highly recommend using scribus to help with preparing for print.
Comment 2 Halla Rempt 2021-01-26 12:38:10 UTC
I think poppler supports CMYK output now, since 20.12.0
Comment 3 amyspark 2021-06-03 17:41:26 UTC
Poppler does, but we use the Qt5 backend, which forces rendering to QImage (and thus RGBA):

https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/qt5/src/poppler-page.cc#L495

If we wanted it to work, we'd have to patch the backend and get the raw CMYKA blobs out.
Comment 4 wolthera 2021-06-03 19:00:04 UTC
Raw cmyk blob, or maybe just have each channel be rendered to a grayscale qimage.

The real question is of course, if we know how to get the cmyk out, how do we get it in? :)
Comment 5 amyspark 2021-06-03 20:23:42 UTC
If we have a single CMYKA blob from Poppler, we can writeBytes(...) the layer's paint device directly.

https://invent.kde.org/graphics/krita/-/blob/master/libs/image/kis_paint_device.cc#L1602-1614

But, we'd need to get the color profile, bit depth, etc... that's abstracted by Poppler-Qt5 and QImage.
Comment 6 amyspark 2023-04-09 12:08:14 UTC
Not working on this actively, but I did report the missing feature upstream. See https://gitlab.freedesktop.org/poppler/poppler/-/issues/1348