Bug report #1643

Raster: Problems displaying Int16 grayscale image

Added by Tim Sutton almost 15 years ago. Updated almost 14 years ago.

Status:Closed
Priority:Low
Assignee:ersts -
Category:Rasters
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:worksforme
Crashes QGIS or corrupts data: Copied to github as #:11703

Description

Hi

An acquintance reported issues displaying the attached image. Gdal reports the min max as [0, 62220]. QGIS reports it as [0,0]. Forcing the stretch min max to use gdal reported values does not help. Whatever we do results in a black image being displayed. Any ideas?

Thanks

Tim

toets.tiff.bz2 (14.5 KB) Tim Sutton, 2009-04-20 08:07 AM

gdalinfo_qb_road_extract.log Magnifier (1.52 KB) mgrizonnet -, 2009-07-28 12:11 AM

History

#1 Updated by ersts - almost 15 years ago

There seems to be something a bit off with the header information, specifically the cell size. It looks like the cell size in the x direction is 0 and 500 in the y direction.

You can quickly see this if you use gdal_translate to export to an ascii grid.

#2 Updated by Giovanni Manghi over 14 years ago

Hi,

what is the state of this issue? a problem with the data itself or a real problem with qgis?

Please leave feedback, it the first case we can close the ticket.

#3 Updated by mgrizonnet - over 14 years ago

Hi,

I confirme the bug.
A black image is displayed when I try to open a unint16 grayscale image (geotiff).
The bug does not appear if I export firt the image in a uint8 grayscale image.
I can't attach the image which is too big.

Regards,

Manuel

#4 Updated by Paolo Cavallini over 14 years ago

What happens if you stretch to min-max (raster properties)?
It's just a visualization problem? In this case, I would reclassify this as an annoyance

#5 Updated by mgrizonnet - over 14 years ago

Replying to [comment:4 pcav]:

What happens if you stretch to min-max (raster properties)?

nothing change

It's just a visualization problem? In this case, I would reclassify this as an annoyance

True, it's just a visualization...

regards

#6 Updated by ersts - over 14 years ago

  • Status changed from Open to In Progress

Can someone post me the output from gdalinfo on an image they are having problems with? Also please let me know how the U16Bit image was created.

I can get a similar type of behaviour when I convert at 32-bit image with values from 0.0 to 1.0 and a no data value of -9999.0 with the following command

gdal_translate -ot UInt16 -of GTiff -scale 0 1 B1.asc B1_3.tif

It is all black image and stretching appears to does little, but if I use

gdal_translate -ot Byte -of GTiff -scale 0 1 B1.asc B1_3.tif

It get something that "looks" more correct, but still is not actually. The problem is that gdal seems to be changing the no data value to 0 even when I explicitly set it to something else and if the image has a bunch of no data values, 0 dominates the stretch.

#7 Updated by mgrizonnet - over 14 years ago

Hi,

in attachment the gdalinfo log of my example which produce a black image (file : gdalinfo_qb_road_extract.log).

Best regards.

Manuel
Replying to [comment:6 ersts]:

Can someone post me the output from gdalinfo on an image they are having problems with? Also please let me know how the U16Bit image was created.

I can get a similar type of behaviour when I convert at 32-bit image with values from 0.0 to 1.0 and a no data value of -9999.0 with the following command

gdal_translate -ot UInt16 -of GTiff -scale 0 1 B1.asc B1_3.tif

It is all black image and stretching appears to does little, but if I use

gdal_translate -ot Byte -of GTiff -scale 0 1 B1.asc B1_3.tif

It get something that "looks" more correct, but still is not actually. The problem is that gdal seems to be changing the no data value to 0 even when I explicitly set it to something else and if the image has a bunch of no data values, 0 dominates the stretch.

#8 Updated by Paolo Cavallini over 14 years ago

still true: are we sure this is a valid raster? Can it be displayed in other software?

#9 Updated by ersts - almost 14 years ago

Howdy!

Could the folks having problems with the 16 bit images please try one of the images at the following url: http://www.shadedrelief.com/natural3/pages/extra.html

If the 16bit images from the above link load fine on v1.5.0 running on linux (stock Ubuntu 9.10 and 10.04). If the above images do work for you, there is something specific with the imagery you are using and we will have to find out a way for me to get a copy of your data.

Please also be specific about which version and platform you are using. This ticket went from version Version 1.2.0 to Version 1.0.3 last summer.

#10 Updated by Paolo Cavallini almost 14 years ago

Loads fine here (qgis 1.5 from trunk, debian unstable)

#11 Updated by Paolo Cavallini almost 14 years ago

  • Resolution set to worksforme
  • Status changed from In Progress to Closed

Closing it for lack of user feedback. Please reopen it if appropriate

Also available in: Atom PDF