qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.09k stars 2.93k forks source link

Layer blending mode reset on export for all file types #50526

Open ejrobinson opened 1 year ago

ejrobinson commented 1 year ago

What is the bug or the crash?

When exporting files with multiple overlayed rasters, upon export all of the layers are exported as if the blending more was set to 'Normal'

Expected (preiview) is on the right, actual export output is on the left. image

Steps to reproduce the issue

  1. Import a raster (.tif file in my case)
  2. Generate a hillshade and set the blending mode to overlay to get desired display properties.
  3. Add a map to the print layer
  4. Export (as any file format)

Resulting image file will have exported the upper hillshade layer as a solid greyscale image instead of applyin the selected blending mode.

Versions

QGIS version | 3.27.0-Master | QGIS code revision | c6eca784ad -- | -- | -- | -- Qt version | 5.15.3 Python version | 3.9.5 Compiled against GDAL/OGR | 3.6.0dev-dc0012850f | Running against GDAL/OGR | 3.6.0dev-ebe17cf8fc PROJ version | 9.1.0 EPSG Registry database version | v10.074 (2022-08-01) GEOS version | 3.10.3-CAPI-1.16.1 SQLite version | 3.38.1 PDAL version | 2.4.3 PostgreSQL client version | unknown SpatiaLite version | 5.0.1 QWT version | 6.1.6 QScintilla2 version | 2.13.1 OS version | Windows 10 Version 2009   |   |   |   This copy of QGIS writes debugging output.   |   |   |   Active Python plugins db_manager | 0.1.20 grassprovider | 2.12.99 MetaSearch | 0.3.6 processing | 2.12.99 sagaprovider | 2.12.99 QGIS version 3.27.0-Master QGIS code revision [c6eca784ad](https://github.com/qgis/QGIS/commit/c6eca784ad) Qt version 5.15.3 Python version 3.9.5 Compiled against GDAL/OGR 3.6.0dev-dc0012850f Running against GDAL/OGR 3.6.0dev-ebe17cf8fc PROJ version 9.1.0 EPSG Registry database version v10.074 (2022-08-01) GEOS version 3.10.3-CAPI-1.16.1 SQLite version 3.38.1 PDAL version 2.4.3 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009 This copy of QGIS writes debugging output. Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99 sagaprovider 2.12.99 AND QGIS version | 3.26.3-Buenos Aires | QGIS code revision | 65e4edfdada -- | -- | -- | -- Qt version | 5.15.3 Python version | 3.9.5 GDAL/OGR version | 3.5.1 PROJ version | 9.1.0 EPSG Registry database version | v10.074 (2022-08-01) GEOS version | 3.10.3-CAPI-1.16.1 SQLite version | 3.38.1 PDAL version | 2.4.3 PostgreSQL client version | unknown SpatiaLite version | 5.0.1 QWT version | 6.1.6 QScintilla2 version | 2.13.1 OS version | Windows 10 Version 2009   |   |   |   Active Python plugins db_manager | 0.1.20 grassprovider | 2.12.99 MetaSearch | 0.3.6 processing | 2.12.99 sagaprovider | 2.12.99 QGIS version 3.26.3-Buenos Aires QGIS code revision [65e4edfdada](https://github.com/qgis/QGIS/commit/65e4edfdada) Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.5.1 PROJ version 9.1.0 EPSG Registry database version v10.074 (2022-08-01) GEOS version 3.10.3-CAPI-1.16.1 SQLite version 3.38.1 PDAL version 2.4.3 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009 Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99 sagaprovider 2.12.99 ### Supported QGIS version - [X] I'm running a supported QGIS version according to the roadmap. ### New profile - [X] I tried with a new QGIS profile ### Additional context Renderer set to 300 DPI but also occours on PDF's and SVG's running on a clean install with no extra plugins enabled.
Sidapo commented 1 year ago

I have the same problem (3.28.0, ubuntu). But it only appears when I have set masks in other layers.

rsuarez1 commented 1 year ago

Same issue as OP (3.28.0. Windows 10)

nicogodet commented 1 year ago

Could one of you share a sample project (+data) to reproduce the issue ?

Sidapo commented 1 year ago

MASK_BUG_GITHUB.zip here you go. Thanks for looking into this. Here are exports from that project. Masks disabled: image Masks enabled: image

Sidapo commented 1 year ago

For me, the issue only appears when there are multiple raster layers with different blend modes activated (multiply & screen). The issue still exitss in 3.28.4 LTR (and all newer RC versions)

Sidapo commented 1 year ago

@geographyclub found a workaround: add all map layers (without any blending) as separate map items (with locked layers/map theme) in the print composer & add the blend modes via item properties -> rendering.

Bokujin commented 1 year ago

Any updates on this bug? I just upgraded to 'Firenze' last week and have started having this problem.

mata-hary commented 1 year ago

I have the same problem on Mac M1 (QGIS 3.30.1-'s-Hertogenbosch)

rsuarez1 commented 1 year ago

As mata-hary, the issue is still showing in QGIS 3.30.1-'s-Hertogenbosch.

rsuarez1 commented 1 year ago

I've just toned something: The issue seems to show when activating the "Masked Symbol Layers" in the labels as seen in the following screenshots:

With Mask: Problem - Mask

Without Mask: Problem - No Mask

In this example I'm using QGIS 3.28.5-Firenze

Hope this is helpful!

ragnarheidar commented 1 year ago

Can confirm this issue (QGIS 3.28.5 on Windows 11). Having two raster where one is rendered as multiply will not be exported properly if there are additional layers with label mask turned on. In the examples below, I have three layers.

  1. Contour lines (vector data, geopackage)
  2. A DEM raster, blending mode set to multiply (GeoTIFF)
  3. A hillshade raster (GeoTIFF)

In the first example everything is exported as normally. In the second example, a mask has been turned on for the contour line labels. This results in the hillshade not exporting, only leaving the DEM and the contour lines.

lables_with_no_mask

lables_with_mask

ragnarheidar commented 1 year ago

Got around this by downgrading to 3.22.8 btw.

Can confirm this issue (QGIS 3.28.5 on Windows 11). Having two raster where one is rendered as multiply will not be exported properly if there are additional layers with label mask turned on. In the examples below, I have three layers.

  1. Contour lines (vector data, geopackage)
  2. A DEM raster, blending mode set to multiply (GeoTIFF)
  3. A hillshade raster (GeoTIFF)

In the first example everything is exported as normally. In the second example, a mask has been turned on for the contour line labels. This results in the hillshade not exporting, only leaving the DEM and the contour lines.

lables_with_no_mask

lables_with_mask

Frecooz commented 1 year ago

I can reproduce the issue on Windows 10, QGIS Desktop 3.28.2 Firenze. Same 3 layers:

1. Contour lines (vector data, geopackage)
2. A DEM raster, blending mode set to multiply (GeoTIFF)
3. A hillshade raster (GeoTIFF)

Screenshot (QGIS mainscreen and composer): Export error Qgis Composer view cropped

Exported (PDF or PNG same result): Lamina A3 lores cropped

FeroS66 commented 1 year ago

In 3.28.7 this unpleasant bug still exist :(

LatidudeMaps commented 11 months ago

This bug still exists (also with only a raster layer with a blend mode) on 3.28.6 and Win11. This is a problematic bug since the solution proposed by @geographyclub returns either a "QGIS could not create print device" message or an incorrect pdf, and it invalidates a lot of mapmaking processes.

matthew-law commented 10 months ago

Still getting the issue in 3.28.6 and 3.32.1 on Mac, but now can't work out how to get back to a point where the issue doesn't happen – even after removing all label masks the issue is still persisting :(

ioalexei commented 9 months ago

I'm getting this issue in 3.30.0 on Windows. Removing the label masks fixed the export.

ElyumOfTheRocks commented 1 month ago

Still happening on 3.36.3 on Windows with a DEM, a hillshade and some masks. The fix still works too.

HOWEVER... It seems that it blends properly when using a hillshade with a basemap from quickmapservice, even with masks enabled. (see mask in the red circle, and shading in blue circle).

Maybe this will help...

image