View Issue Details

IDProjectCategoryView StatusLast Update
0011029ScribusImport / Exportpublic2012-11-13 20:32
ReporterJussiP Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformanyOSanyOS Versionany
Product Version1.5.0svn 
Fixed in Version1.5.0svn 
Summary0011029: Add explicit monochrome color space
DescriptionThis could be considered a part of bug 3540 but I filed it separately to reduce clutter on that bug.

In addition to explicit grayscale support listed in the bug above, Scribus should special case 1 bit B&W images. Currently they are always resampled to 8 bit grayscale images, which is wasteful. 1 bit images should always be output in the PDF as 1 bit grayscale images, regardless of output mode (i.e web/grayscale/printer).

The attached patchset does the following:

- does some cleanup in the PDF export setup code
- adds a monochrome color space
- adds monochrome detection to the TIFF reader
- adds code to generate a 1 bit bytestream for images
- writes 1 bit images to the PDF stream

It mostly works but there are some bugs. Most noticeably the colors are inverted when writing a printer PDF and non-1-bit images get corrupted on export.
TagsNo tags attached.
Patch

Activities

JussiP

2012-08-12 17:43

reporter  

monochrome.zip (11,061 bytes)

jghali

2012-08-14 23:37

administrator   ~0028818

Thanks, i just started testing your patch (0011026 took me a bit of time). I already fixed the corruption problem : it was caused by Color_Gray/Color_Cmyk values which had not been replaced by the corresponding ColorSpaceEnum value in WriteFlateImageToStream().

JussiP

2012-08-15 07:47

reporter   ~0028819

Some additional things to notice:

- 1-bit images should probably not be JPEG compressed because they are used for precise linework in comics, even if the global compression setting is JPEG

- 1-bit black is often used as overprint, but it does not seem to be working for images (it does for colored boxes)

- the color reversal is probably caused by the internal image data being in CMYK when writing printer data and RGB otherwise

jghali

2012-08-15 13:39

administrator   ~0028820

Afaik JPEG compression is simply not allowed by PDF specs for 1-bit images.

jghali

2012-08-18 12:50

administrator   ~0028831

I disabled JPEG compression for monochrome image and force ZIP compression except in the case where 'no compression' is selected. The inversion problem when 'Printer' target is selected is also fixed. Fixed also a side-effect of that patch with grayscale image with embedded ICC profiles.

I still have to test the patch with monochrome image on which image effects have been applied. There are some issues which have to be fixed.

jghali

2012-08-18 22:31

administrator   ~0028835

Committed! Thanks!

JussiP

2012-08-19 08:28

reporter   ~0028836

Thank you for your fast response.

Issue History

Date Modified Username Field Change
2012-08-12 17:43 JussiP New Issue
2012-08-12 17:43 JussiP File Added: monochrome.zip
2012-08-14 23:37 jghali Note Added: 0028818
2012-08-15 07:47 JussiP Note Added: 0028819
2012-08-15 13:39 jghali Note Added: 0028820
2012-08-18 12:50 jghali Note Added: 0028831
2012-08-18 22:31 jghali Note Added: 0028835
2012-08-18 22:31 jghali Status new => resolved
2012-08-18 22:31 jghali Fixed in Version => 1.5.0svn
2012-08-18 22:31 jghali Resolution open => fixed
2012-08-18 22:31 jghali Assigned To => jghali
2012-08-19 08:28 JussiP Note Added: 0028836
2012-11-13 20:32 cbradney Status resolved => closed