1

I have an orthomosaic GeoTIFF and it has 4 bands. I want to convert it to a PNG/JPEG image to show it on Cesium. I've tried gdal_translate like this : gdal_translate -a_nodata 0 -of PNG 1.tif 1.png -scale -colorinterp_1 red -colorinterp_2 green -colorinterp_3 blue and it's not working. I'm completely new to QGIS. Can you please guide me what options I should use to get data? I already have 2D generated picture using photoshop and I think it's not losing any data. I don't want to keep projection or elevation data. I just want a normal image.

Point: it's not possible for JPG because I'm getting this error : libjpeg: Maximum supported image dimension is 65500 pixels

This is gdalinfo result :

Files: /Users/tfiroozian/Downloads/2_111318_SKYG_Nautilus_1_3mi_transparent_mosaic_group1.tif
Size is 41705, 77008
Coordinate System is: 
PROJCS["NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.2572221010042,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",30.11666666666667],
    PARAMETER["standard_parallel_2",31.88333333333333],
    PARAMETER["latitude_of_origin",29.66666666666667],
    PARAMETER["central_meridian",-100.3333333333333],
    PARAMETER["false_easting",2296583.333333333],
    PARAMETER["false_northing",9842500],
    UNIT["US survey foot",0.3048006096012192,
        AUTHORITY["EPSG","9003"]]]
Origin = (1285949.954140000045300,10626980.503550000488758)
Pixel Size = (0.081470000000000,-0.081470000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_SOFTWARE=pix4dmapper
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( 1285949.954,10626980.504) (103d35'10.24"W, 31d46'58.51"N)
Lower Left  ( 1285949.954,10620706.662) (103d35' 8.11"W, 31d45'56.45"N)
Upper Right ( 1289347.660,10626980.504) (103d34'30.89"W, 31d46'59.49"N)
Lower Right ( 1289347.660,10620706.662) (103d34'28.77"W, 31d45'57.43"N)
Center      ( 1287648.807,10623843.583) (103d34'49.50"W, 31d46'27.97"N)
Band 1 Block=41705x1 Type=Byte, ColorInterp=Red
  NoData Value=-10000
  Mask Flags: PER_DATASET ALPHA 
Band 2 Block=41705x1 Type=Byte, ColorInterp=Green
  NoData Value=-10000
  Mask Flags: PER_DATASET ALPHA 
Band 3 Block=41705x1 Type=Byte, ColorInterp=Blue
  NoData Value=-10000
   Mask Flags: PER_DATASET ALPHA
Band 4 Block=41705x1 Type=Byte, ColorInterp=Alpha
  NoData Value=-10000
5
  • If it is GeoTIFF with 4 real raster bands you can select any 3 bands as in the answer to this question gis.stackexchange.com/questions/101393/…
    – user30184
    Commented Mar 11, 2019 at 15:11
  • I have tried this command and the result is completely black png. gdal_translate -of PNG -B 1 -B 2 -B 3 1.tif 2.png @user30184
    – taraf
    Commented Mar 11, 2019 at 15:37
  • Give some test data or at least show what gdalinfo reports. You may have some 16bit or 32bit source tiff with most data at the low end of the histogram. Use scaling if this is the case.
    – user30184
    Commented Mar 11, 2019 at 15:55
  • So sorry, the data is for my company and I'm not sure if I'm allowed to share it in public. I added the gdalinfo result in question. Thank you so much for your help @user30184
    – taraf
    Commented Mar 11, 2019 at 16:31
  • It does not need to be your real data, any similar 4-band image that shows your issue would do. I do not quite understand the nodata value of -10000 with byte type of data.
    – user30184
    Commented Mar 11, 2019 at 17:18

0

Browse other questions tagged or ask your own question.