3

I've been playing around with an approach in QGIS that uses Addition between the layers I'm mapping to build a tri-variate composite colour map - an example is here in the QGIS Flickr pool:

http://www.flickr.com/photos/97267218@N06/12626847074/

To achieve an output I thought I had to set the background of the image to black - in order to draw out the colours. However I've been asked (demanded!!!) to set the background to white.

Thinking about it a little, one approach that would seem to work would be to set the background of the Composer to Alpha 0.

This is a screen grab of an map produced in a similar manner. In the composer I set the background with an Alpha of 0 - meaning that it doesn't influence the layers. Great!

Screen Grab of composer.

However when I export the final image in any format (including Pdf and SVG) I only get a white page!

There has been a similar question asked about this in ArcGIS (Exporting Graphic with transparency in layout to PDF using ArcGIS for Desktop?) - and the suggestion there was to change the graphic to a feature and insert that .... something I don't think is possible with QGIS ...

So - has anyone either any suggestions how this might be overcome? How can I export an image which is using Addition and Alpha without needing a black background?

More fundamentally ... can anyone explain (in relative layman's terms!) why the export isn't working in the first place?

  • Right, so I've tried the 2.2 route - but with no luck. I get the same output. The interesting thing is that the file generated is almost the same size as the one using a black background - and when I import it into GIMP and use a colour to Alpha feature I can extract the coloured dots (and most of the RGB composite colours) successfully.... so there is something not quite right with the export. Of course, this is a solution in itself, but I'm still interested as to why the original export from composer didn't work! – Andrew Tice Feb 28 '14 at 8:17
  • Have you tried to enable "print as raster"? – underdark Mar 8 '14 at 18:21
  • 1
    Printing as raster certainly works - but what this looses (unless I set the DPI insanely high!) is the scalability of the PdF. I'm including the PdFs in a LaTeX document, and part of what I'm trying to demonstrate is the issue between vector and raster outputs! – Andrew Tice Mar 9 '14 at 2:46
1

pdf exports are tricky in so far as they want to add layer functionality to your map. This can be a good thing if your end user doesn't have GIS software. However, in this situation it's a bit annoying. I would suggest exporting as a png and then using a word document or similar to save as pdf. It's an extra hoop but it should free you up. Of course, if you need that extra special pdf functionality for the layers, a different solution will be needed.

  • Thanks Oliver - however what your talking about is exactly the situation I'm in! The maps are going in a PhD thesis - and the assessment criteria is based on the submitted document - so no nice get outs like being able to point to an online version etc. etc. The only thing I can do is submit a digital copy of the outputs - but these have to be as published, I cannot bundle them with any form of browser - and direct the assessor to view them on screen. If I can demonstrate I'm at the limits of whats possible here, and cannot produce a white background - I'm going to have to leave it at that! – Andrew Tice Mar 9 '14 at 2:58
  • Hi Moderators - Is it a bit churlish not to award a bounty because the answer is ... it probably cannot be done? I've been digging around other resources and it appears that I've hit something that cannot be resolved with current PdF production - i.e. the limitation is with the format, not with production in QGIS (or Arc, for that matter!). I appreciate the pointers that Oliver and Anita have provided, but none of them successfully answer the question! – Andrew Tice Mar 12 '14 at 0:59
  • Andrew, would you be able to send me your data so I can have a crack at it? – Oliver Burdekin Mar 18 '14 at 17:45
  • Oliver - sorry, I missed your comment (gave up, went on holiday!). If you're still interested give me an email at andyjticeATgmailDOTcom – Andrew Tice Mar 31 '14 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.