Bug 27068 - Use ICC profiles in PS output
Summary: Use ICC profiles in PS output
Status: RESOLVED MOVED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-14 00:53 UTC by Adrian Johnson
Modified: 2018-08-20 21:55 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Use ICC profile in PS output (5.31 KB, patch)
2010-03-14 00:53 UTC, Adrian Johnson
Details | Splinter Review
ps: emit icc colorspace (19.38 KB, patch)
2014-10-13 10:41 UTC, Adrian Johnson
Details | Splinter Review
ps: emit icc colorspaces (20.56 KB, patch)
2014-10-15 12:24 UTC, Adrian Johnson
Details | Splinter Review
ps: emit icc colorspaces (20.90 KB, patch)
2014-12-15 11:43 UTC, Adrian Johnson
Details | Splinter Review

Description Adrian Johnson 2010-03-14 00:53:00 UTC
Created attachment 34032 [details] [review]
Use ICC profile in PS output

When printing PDFs that use ICC based colors, Poppler always uses the alternate color space in the PostScript output (usually DeviceRGB or DeviceCMYK). The attached patch will use the ICC profile color space in the PS output. Most of the patch is modifying GfxColorTransform and callers to store the source profile as well as the transform. The GfxICCBasedColorSpace class has a new method, getPostScriptCSA(), which uses the LCMS function cmsGetPostScriptCSA() to generate the CIEBased color space dictionary equivalent to the ICC profile.
Comment 1 Albert Astals Cid 2010-03-17 03:37:15 UTC
Hi, thanks for the patch.

I'm in the progress of regression testing the patch, hopefully will have it done today, there is a problem though with this patch and it that it slows down the ps generation a lot.

See for example page 2 of https://secure.paizo.com/download/pathfinder/PZO9000-2E.zip

The thing is that it seems is doing the conversion a lot of times and that takes much more time, you should try to use a PopplerCache to avoid that, in "drawing" mode we use a cache of 5 elements (see iccColorSpaceCache in Gfx.cc)
Comment 2 Albert Astals Cid 2010-03-17 11:02:04 UTC
No problem was found and some improvements were detected so it's cool if you can add that cache to not make generation so slow.
Comment 3 Adrian Johnson 2014-10-13 10:41:23 UTC
Created attachment 107770 [details] [review]
ps: emit icc colorspace

I had forgotten that I never finished this patch. So four years later here is the updated patch.

The changes are:
- support both LCMS 1 and 2

- Improve performance. Instead of caching what I did was assign each ICC color 
space in the PS output to an /ICCBased-x-y-z name and ensure each one is only emitted once. The performance of the generation is improved as each color space is only emitted once. The file size increase is kept to a minimum as the /ICCBased-x-y-z name is used each time a color space is set instead of emitting the entire CSA.
Comment 4 Adrian Johnson 2014-10-15 12:24:11 UTC
Created attachment 107868 [details] [review]
ps: emit icc colorspaces

Updated to ensure DSC conformance (page independence) in the PS output.
Comment 5 Albert Astals Cid 2014-12-14 17:55:21 UTC
Adrian, can you rebase the patch?

Also a way to test it's actually doing something?
Comment 6 Adrian Johnson 2014-12-15 11:43:01 UTC
Created attachment 110854 [details] [review]
ps: emit icc colorspaces

rebased patch


You can test with this pdf on this page:

http://www.color.org/version4html.xalter
Comment 7 GitLab Migration User 2018-08-20 21:55:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/125.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.