Bug report #4641

Colours are incorrect in exported PDF

Added by Alister Hood over 12 years ago. Updated about 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:14542

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.38 MB) Alister Hood, 2011-12-13 09:10 PM

test_pdf.jpg - screenshot of pdf (214 KB) Alister Hood, 2011-12-13 09:28 PM

History

#1 Updated by Alister Hood over 12 years ago

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

#2 Updated by Giovanni Manghi over 12 years ago

  • Target version set to Version 1.7.4

#3 Updated by Paolo Cavallini about 12 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0
  • Affected QGIS version set to master
  • Crashes QGIS or corrupts data set to No

#4 Updated by Alister Hood almost 12 years 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...

#5 Updated by Alister Hood almost 12 years ago

  • Operating System 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).

#6 Updated by Paolo Cavallini over 11 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#7 Updated by Alister Hood over 11 years 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...)

#8 Updated by Alister Hood over 11 years 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.

#9 Updated by Alister Hood over 11 years 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...

#10 Updated by Jürgen Fischer about 10 years ago

  • Category changed from 33 to Map Composer/Printing

#11 Updated by Jürgen Fischer almost 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - Lower Priority

#12 Updated by Giovanni Manghi almost 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#13 Updated by Giovanni Manghi about 5 years ago

  • Status changed from Open to Closed
  • Resolution set to end of life

Also available in: Atom PDF