Bug report #4794

Raster NULLs are coloured

Added by Paolo Cavallini over 7 years ago. Updated almost 7 years ago.

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

Description

A loaded raster looks OK in greyscale. If I apply Pseudocolor, Freak out or Color map, the NULLs are (wrongly) coloured. Until recently it was not so.

clip_nulls (59.8 KB) Paolo Cavallini, 2012-01-14 12:49 AM

clipped.tif (1010 KB) Giovanni Manghi, 2012-01-22 03:58 PM

int16.tif (1010 KB) Giovanni Manghi, 2012-01-22 03:58 PM

int32.tif (1.97 MB) Giovanni Manghi, 2012-01-22 03:58 PM

float32.tif (1.97 MB) Giovanni Manghi, 2012-01-22 03:58 PM

float64.tif (3.94 MB) Giovanni Manghi, 2012-01-22 03:58 PM

blue_null_Value.png (151 KB) Casey Vandenberg, 2012-08-27 09:42 AM

History

#1 Updated by Paolo Cavallini over 7 years ago

Moreover, if I apply the transparency band to the raster (Band 1), the NULLs are transparent, but the raster looks weird.

#2 Updated by Giovanni Manghi over 7 years ago

Please attach sample data.

#3 Updated by Paolo Cavallini over 7 years ago

#4 Updated by Giovanni Manghi over 7 years ago

After importing the attached sample raster into GRASS the NULLs are wrongly coloured, also when using the greyscale colormap.

#5 Updated by Giovanni Manghi over 7 years ago

Another test:

imported the attached raster (clipped.tif) into GRASS and then with r.null made pixels with "0" value into NULLS. I then exported the GRASS raster with r.out.gdal.tiff choosing different formats: int16, int32, float32 and float64. After adding the resulting rasters into QGIS I see that NULLS are wrongly coloured just in the int32 raster, while the in the others is correctly transparent.

#6 Updated by Giovanni Manghi over 7 years ago

Giovanni Manghi wrote:

After adding the resulting rasters into QGIS I see that NULLS are wrongly coloured just in the int32 raster.

also with the greyscale color map.

#7 Updated by Giovanni Manghi over 7 years ago

  • Subject changed from Raster NULLs are coloured in pseudocolor (etc.) mode to Raster NULLs are coloured

#8 Updated by Casey Vandenberg about 7 years ago

I am not sure if this is a related problem or not, although I suspect it is as the null values within raster layers I add to QGIS are also improperly coloured.

I have a series of raster layers in a grass database. When I add any of these raster layers using the Grass plugin, the null values are all coloured blue.
If I export the layers to a .tif + .tfw file, and add the tif into QGIS, the null values are handled correctly and appear transparent.

I have seen this problem at work on machines running 11.04, 12.04 on Linux and Windows

#9 Updated by Giovanni Manghi about 7 years ago

  • Status changed from Open to Feedback

This issue should have been fixed in qgis master, please
try and report back.

#10 Updated by Paolo Cavallini about 7 years ago

  • Target version set to Version 2.0.0

#11 Updated by Giovanni Manghi almost 7 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed

This is fixed in master. Please reopen if necessary.

Also available in: Atom PDF