Bug report #5850

Problems with raster transparency

Added by Benoit de Cabissole over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:Normal
Assignee:Marco Hugentobler
Category:Rasters
Affected QGIS version:master Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:15319

Description

A 1-band (GDT_Float32 - Thirty two bit floating point) GeoTIFF raster file is rendered as 'singleband gray'.

(1) In the 'Transparency' tab of raster properties there is a button called 'Default values'.
Click on that button. This results in the table header to be filled with "red, green, blue, Percent transparent" instead of "Gray, Percent transparent".
Close the properties window and open it again, the correct header is then displayed.

(2) Same raster, same wrong table header after clicking 'Default values'. Now type in a RBG colour code to set it transparent: 128, 128, 128, 100 (it is a grey shade after all).
After clicking on 'Apply' the green component changes to 0 (128, 0, 128, 100) and there is no effect on the displayed raster.

(3) The min/max values of the raster are: -0.5984/0.9996 respectively and the no-data-value is -9999.0
There is no way to make the no-data-value transparent and to display the raster in greyscale. The no-data-value is always displayed in black and the raster in uniform grey, whatever the 'Contrast enhancement' used (BTW, the 'Load min/-max values' is set to 'Actual (slower)' and the 'Load' button is clicked to load the correct min/max values).
Very similar to Bug #5847.

History

#1 Updated by Giovanni Manghi over 7 years ago

On what QGIS version? Now that the resampling branch has been merged the tests and notes/tickets should be based on qgis-master. Cheers!

#2 Updated by Benoit de Cabissole over 7 years ago

From OSGeo4W Quantum QGIS 1.9.0-master, QGIS code revision: 02b1324.

#3 Updated by Benoit de Cabissole over 7 years ago

Just to add an oddity for point (3) above.

Preamble:
The no-data-value is generally -9999 in my rasters and they are all FLOAT32.
As said above, the no-data-value is not rendered as transparent, it is sometimes black, some other times another colour.

The oddity:
If I add the no-data-value to the 'Transparent pixel list' and click 'Apply', nothing happens.
But, if I then move a little bit the 'Global transparency' slider and click 'Apply', boom, the no-data-value is effectively transparent!
Then, I save the project and reload it. The no-data-value is again displayed in a solid colour (non-transparent) and the "slider trick" is again necessary to display the no-data-value as transparent...

#4 Updated by Giovanni Manghi over 7 years ago

  • Status changed from Open to Feedback

Benoit de Cabissole wrote:

From OSGeo4W Quantum QGIS 1.9.0-master, QGIS code revision: 02b1324.

this used to work ok in qgis 1.7.4 (and works fine in 1.8?)?

if yes then assign this ticket to Marco H., this can be a consequence of the merge of the "resampling" branch.

#5 Updated by Benoit de Cabissole over 7 years ago

  • Assignee set to Marco Hugentobler

Yes, it works fine on 1.8 (only tested on one of the rasters I have problems with in 1.9).
Assigned to Marco H.

#6 Updated by Marco Hugentobler over 7 years ago

Is this still the case with latest master?
If yes, please attach a sample dataset (or send it to me privately if secret)

#7 Updated by Marco Hugentobler over 7 years ago

  • Status changed from Feedback to Closed

Fixed in master branch. Please reopen the ticket if there are still issues.

Also available in: Atom PDF