Opened 9 years ago
Closed 9 years ago
#5784 closed defect (invalid)
Conversion to PNG or JPG results in a black image
Reported by: | tgd | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
I have used gdal_translate to convert tif images to png and jpeg and the result is a black image. I never had a problem with RGB tifs. The problem I am facing affects only grayscale images. Expanding these images to RGB also fails.
This is one of the files in my project: http://aristeia.ha.uth.gr/images/1.tif
This is the correct result using photoshop (which of course strips all geotagging): http://aristeia.ha.uth.gr/images/1.png
While gdal gives me this: http://aristeia.ha.uth.gr/images/2.png
As there a few hundrends of such images in the QGIS project, converting them in photoshop and georeferencing them again is not an option.
Probably this error is connected with Ticket #5761 "gdalwarp zeroes all alpha pixels from grey+alpha image".
Attachments (1)
Change History (3)
by , 9 years ago
Attachment: | Amorgos_Minoa_1_FINAL.tif added |
---|
comment:1 by , 9 years ago
It would be better to open discussion on gdal-dev mailing list ans create tickets only after the issue is confirmed and located.
I can not reproduce the error with GDAL 2.0-dev on Windows 7, 64 bit, with GDAL binaries from gisinternals.com/sdk. Both png and jpg versions show the drawing just fine.
gdal_translate -of png Amorgos_Minoa_1_FINAL.tif bug1.png gdal_translate -of jpeg Amorgos_Minoa_1_FINAL.tif bug1.jpg
However, I do not understand what you talk about greyscale images. Did you attach right samples? See the gdalinfo report of Amorgos_Minoa_1_FINAL.tif:
Band 1 Block=1394x1035 Type=Byte, ColorInterp=Red Mask Flags: PER_DATASET ALPHA Band 2 Block=1394x1035 Type=Byte, ColorInterp=Green Mask Flags: PER_DATASET ALPHA Band 3 Block=1394x1035 Type=Byte, ColorInterp=Blue Mask Flags: PER_DATASET ALPHA Band 4 Block=1394x1035 Type=Byte, ColorInterp=Alpha
comment:2 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Closing. Doesn't seem there's actually a problem. Reopen if you have more elements to provide.
Original TIF file.