[Gdal-dev] Using gdal_translate to translate from UInt32 to Byte

John Preston john.preston at uwimona.edu.jm
Wed Jul 5 10:13:47 EDT 2006


I'm trying to convert a tif with the following info:

Driver: GTiff/GeoTIFF
Size is 200, 200
Coordinate System is:
PROJCS["Lambert Conformal Conic | WGS 84 | Meters",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.2572235629972,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",18],
    PARAMETER["standard_parallel_2",18],
    PARAMETER["latitude_of_origin",18],
    PARAMETER["central_meridian",-77],
    PARAMETER["false_easting",750000],
    PARAMETER["false_northing",650000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (771000.000000,669000.000000)
Pixel Size = (1.00000000,-1.00000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_IMAGEDESCRIPTION=Created by GeoTiff Tiler (GUI) 1.4
  TIFFTAG_DATETIME=2002:09:20 20:21:28
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
Corner Coordinates:
Upper Left  (  771000.000,  669000.000) ( 76d48'5.46"W, 18d10'17.62"N)
Lower Left  (  771000.000,  668800.000) ( 76d48'5.47"W, 18d10'11.12"N)
Upper Right (  771200.000,  669000.000) ( 76d47'58.66"W, 18d10'17.62"N)
Lower Right (  771200.000,  668800.000) ( 76d47'58.66"W, 18d10'11.11"N)
Center      (  771100.000,  668900.000) ( 76d48'2.06"W, 18d10'14.37"N)
Band 1 Block=200x20 Type=UInt16, ColorInterp=Gray
Band 2 Block=200x20 Type=UInt16, ColorInterp=Undefined
Band 3 Block=200x20 Type=UInt16, ColorInterp=Undefined

to a standard jpeg  or png that can be viewed with any image viewer.
Each time I try gdal_translate -of JPEG xxx.tif xxx.jpg I get the
following error:

ERROR 6: JPEG driver doesn't support data type UInt16. Only eight bit
byte bands supported.

Is their any flag that I can use to read the UInt16 blocks and combine
them


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060705/41a24f31/attachment.html


More information about the Gdal-dev mailing list