Bug #4641

Colours are incorrect in exported PDF

Added by Alister Hood over 1 year ago. Updated 5 months ago.

Status:New Start Date:12/13/2011
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:Printing
Target version:Version 2.0.0
Platform: Patch supplied:No
Platform version: Affected version:master
Status info: Causes crash or corruption:No
Resolution:

Description

When I export to image or svg, or use an external "pdf printer", the colours in the resulting file match those in QGIS.
When I use the built-in PDF export, the colours are incorrect. It looks like it is trying to do some sort of colourspace conversion and getting confused.
I guess this might be a problem with a dependency such as QT, but I'm pretty sure it did not happen in the past (maybe a year ago?). I have only tested on Windows.

See the attached files.

test.jpg (2.4 MB) Alister Hood, 12/13/2011 09:10 pm

test_pdf.jpg - screenshot of pdf (213.9 kB) Alister Hood, 12/13/2011 09:28 pm

History

Updated by Alister Hood over 1 year ago

The pdf is too big to upload, so here is a screenshot

Updated by Giovanni Manghi over 1 year ago

  • Target version set to Version 1.7.4

Updated by Paolo Cavallini about 1 year ago

  • Target version changed from Version 1.7.4 to Version 1.8.0
  • Affected version set to master
  • Causes crash or corruption set to No

Updated by Alister Hood 11 months ago

Interestingly, in the samples I attached here, the PDF colours weren't as bright as they should have been.
I've just realised that on Linux with current master if I export a PDF "as raster" then the colours are the same as the original, but if I export a PDF with "as raster" unselected then the colours are brighter than the original. So it seems like the opposite problem. I guess now I need to check what the current behaviour is on Windows...

Updated by Alister Hood 10 months ago

  • Platform deleted (Windows)

Alister Hood wrote:

Interestingly, in the samples I attached here, the PDF colours weren't as bright as they should have been. I've just realised that on Linux with current master if I export a PDF "as raster" then the colours are the same as the original, but if I export a PDF with "as raster" unselected then the colours are brighter than the original. So it seems like the opposite problem. I guess now I need to check what the current behaviour is on Windows...

Ah. Whether it seems brighter or darker depends on the actual colours used and the monitor settings and stuff.

Anyway, checking with the same colours, the problem is exactly the same on Windows and Linux. When exported to PDF as raster the colours look the same as in QGIS on screen, and as when printed to a virtual PDF printer (i.e. test.jpg). When exported to PDF as vector the colours are different (i.e. test_pdf.jpg).

Updated by Paolo Cavallini 9 months ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

Updated by Alister Hood 7 months ago

OK, this is the current behaviour:

Linux:
- colours are incorrect (at least for transparent raster layers), when printing or exporting to PDF with "print as raster" disabled.
- colours are correct if "print as raster" is enabled

Windows:
- colours are correct, but the part of the composer that includes any pdf layers is rasterised, even if "print as raster" is disabled. (I guess if it wasn't rasterised the colours would probably be wrong on Windows as well...)

Updated by Alister Hood 5 months ago

Alister Hood wrote:

OK, this is the current behaviour:

Linux: - colours are incorrect (at least for transparent raster layers), when printing or exporting to PDF with "print as raster" disabled. - colours are correct if "print as raster" is enabled

Windows: - colours are correct, but the part of the composer that includes any pdf layers is rasterised, even if "print as raster" is disabled. (I guess if it wasn't rasterised the colours would probably be wrong on Windows as well...)

Ummm. That last point doesn't make sense - I think I probably meant "any raster layers", not "any pdf layers". But I guess that is a separate problem.

Updated by Alister Hood 5 months ago

Windows: - colours are correct

On Windows with a recent Master I'm getting incorrect colours when the layout contains a map with an overview frame with a semi-transparent "simple fill" overview style. If I make the overview frame opaque then I get the correct colours. I guess the same problem would probably occur if a map layer or something else was sem-transparent...

Also available in: Atom PDF