https://bugs.documentfoundation.org/show_bug.cgi?id=150777
Bug ID: 150777
Summary: PDF export converts 1 bit images to 8 bit grayscale
Product: LibreOffice
Version: 7.5.0.0 alpha0+ Master
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Printing and PDF export
Assignee: [email protected]
Reporter: [email protected]
Created attachment 182200
--> https://bugs.documentfoundation.org/attachment.cgi?id=182200&action=edit
A Writer document with an embedded 1 bit image.
Steps to reproduce:
- create a 1 bit bw PNG image
- create a Writer document and embed the image
- export to PDF
- inspect the generated PDF
The image should be written as 1 bit BW image but LibreOffice converts it to
grayscale. This is what gets written in the PDF file:
<</Type/XObject/Subtype/Image/Width 640/Height 480/BitsPerComponent 8/Length 5
0 R
/Filter/FlateDecode/ColorSpace/DeviceRGB
The output is an 8 bits per pixel image in the RGB colorspace when it should be
a 1 bit per pixel image in the grayscale color space.
This only affects monochrome images. Grayscale images seem to be exported
properly in grayscale.
Looking at the code in pdfwriter_impl.cxx there is code to properly handle 1
bit images, which should get written out with CCIT compression.
On line 8859 the code detects the bit depth with this:
nBitsPerComponent = vcl::pixelFormatBitCount(ePixelFormat);
so it seems that this function returns 8 instead of 1 for this monochrome image
at least.
Files showing the issue have been attached.
--
You are receiving this mail because:
You are the assignee for the bug.