Bug 46556

Summary: [patch] pdftops git 23feb12 regression with -level1 bitmaps
Product: poppler Reporter: William Bader <williambader>
Component: utilsAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: Thomas.Freitag, williambader
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: patch to fix the problem

Description William Bader 2012-02-23 20:14:40 UTC
Created attachment 57571 [details] [review]
patch to fix the problem

pdftops -level1 does not show bitmaps correctly.
If the bitmap is color, it sometimes creates a color splash device instead of a mono8 device.  For Level 1 output, it should always create a mono8 device.
My test files 020_ReadMe_Ghent_Output_Patch.pdf (Ghent Output Suite document), bug-poppler27482-precision.pdf (Herbstfest bei MEIFORT ad), elp-B83378-gray.pdf, and testimagemask.pdf (real estate ad with photos of six agents at the bottom) showed like checkerboards.  Most of the test files have been posted with other issues, but I can repost one if necessary.
The attached patch fixes the problem.
William
Comment 1 Thomas Freitag 2012-02-25 01:54:45 UTC
Oh, I see:
I removed that in my overprint patch, because I thought (and still think) that it is wrong. These are the colorspaces which level 1 supports:
PostScript Level 1: deviceRGB, deviceCMYK, deviceGray 
So if You want to separate it, You should be able to separate a RGB image (and of course also a CMYK image, but this is much easier) produced by splash. If You're not able to separate an RGB image but Your're able to separate a CMYK, You should compile it with SPLASH_CMYK!

Thomas
Comment 2 Thomas Freitag 2012-02-25 02:51:57 UTC
Oh, sorry for my previous comment, PostScript is not my favorite subject: of course You're true: level 1 in general supports only grayscale images, only a few implementations have been extended to support color images, but then the images must be paint with colorimage.
I missed that, so Your patch is definitely okay, because splash produces an image and then the image operator is used!
Thomas
Comment 3 Albert Astals Cid 2012-02-25 07:33:06 UTC
Commited
Comment 4 William Bader 2012-02-25 09:32:39 UTC
Thomas,
I think that Level 1 supports only gray, while Level 2 supports color, but there is also a "Level 1.5" middle ground with Level 1 plus a limited number of color operators that color printers used before Level 2 was adopted.  "pdftops -level1sep" generates only the "Level 1.5" color operators.  Software color separation usually supports only the simpler "Level 1.5" color operators.  That is why I need -level1sep to work, and to run quickly on large files.  ("large" is several hundred MB for a graphic the size of a broadsheet newspaper page with embedded high resolution color images, like an ad for a car dealer.)
William
Comment 5 William Bader 2012-02-25 09:40:14 UTC
Thomas,

>Your're able to separate a CMYK, You should compile it with SPLASH_CMYK!

I forgot to mention it.  Everything that I am doing requires compiling with SPLASH_CMYK because it is required for separations, although before posting the larger set of patches with Bug 46600 https://bugs.freedesktop.org/show_bug.cgi?id=46600 , I checked that poppler compiled cleanly without SPLASH_CMYK.

William
Comment 6 Thomas Freitag 2012-02-26 08:27:37 UTC
(In reply to comment #4)
> Thomas,
> I think that Level 1 supports only gray, while Level 2 supports color, but
> there is also a "Level 1.5" middle ground with Level 1 plus a limited number of
> color operators that color printers used before Level 2 was adopted.  "pdftops
> -level1sep" generates only the "Level 1.5" color operators.  Software color
> separation usually supports only the simpler "Level 1.5" color operators.  That
> is why I need -level1sep to work, and to run quickly on large files.  ("large"
> is several hundred MB for a graphic the size of a broadsheet newspaper page
> with embedded high resolution color images, like an ad for a car dealer.)
> William

You're not completely true: already level 1 supports colors, but NOT for images. When You say "Level 1.5" You probably mean the colorimage operator. So i.e. text which should be printed in another colorspace than grayscale is already possible in level 1, but would be converted to gray with poppler if transparancy occurs on the page. The probably better way would be to use the colorimage operator, which is introduced in "level 1.5", but nevertheless, this would cause some work on level 1 which probably isn't use such often that we should spend time on it!

Thomas

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.