Opened 15 years ago

Closed 14 years ago

#1643 closed bug (worksforme)

Raster: Problems displaying Int16 grayscale image

Reported by: timlinux Owned by: ersts
Priority: minor: annoyance Milestone: Version 1.0.3
Component: Rasters Version: Trunk
Keywords: raster black Cc: wmarais@…, pcav
Must Fix for Release: No Platform: Debian
Platform Version: Awaiting user input: no

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

Attachments (2)

toets.tiff.bz2 (14.5 KB ) - added by timlinux 15 years ago.
gdalinfo_qb_road_extract.log (1.5 KB ) - added by mgrizonnet 15 years ago.

Download all attachments as: .zip

Change History (13)

by timlinux, 15 years ago

Attachment: toets.tiff.bz2 added

comment:1 by ersts, 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.

comment:2 by lutra, 15 years ago

Cc: pcav added

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.

comment:3 by mgrizonnet, 15 years ago

Milestone: Version 1.2.0Version 1.0.3

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

comment:4 by pcav, 15 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

in reply to:  4 comment:5 by mgrizonnet, 15 years ago

Priority: major: does not work as expectedminor: annoyance

Replying to 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

comment:6 by ersts, 15 years ago

Status: newassigned

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.

by mgrizonnet, 15 years ago

in reply to:  6 comment:7 by mgrizonnet, 15 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 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.

comment:8 by pcav, 14 years ago

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

comment:9 by ersts, 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.

comment:10 by pcav, 14 years ago

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

comment:11 by pcav, 14 years ago

Resolution: worksforme
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.