[gdal-dev] Need help converting a geotiff file to jpg/tiff/bmp
Benjamin Welton
benjamin.r.welton at wmich.edu
Wed Nov 26 21:10:10 EST 2008
Hello everyone,
Im quite new to using GDAL and what i would like to do is convert a
geotiff file to a standard jpeg/tiff/bmp image file so that it can be
viewed by any standard image reading software (ideally i would like to
be able to display said image using wxPython) . Every time i try to
convert an image it creates ether an image that is not compatible with
some basic image viewing/editing tools or it creates and image that is
monochrome and all detail of the image is lost. What would be the best
way to go about creating a standard jpeg/tiff/bmp so that it can be
viewed in basic image editing/viewing tools? The geotiff is a int16
datatype file and i do not really need to keep any of the actual
georeferencing information contained in the geotiff file.
Here is the python code that i am using to convert the image to a
standard tiff file:
dataset = gdal.Open( "C:\\Geotiff.tif", GA_ReadOnly )
format = "GTiff"
driver = gdal.GetDriverByName( format )
metadata = driver.GetMetadata()
dst_ds = driver.CreateCopy("C:\\Example.tiff",dataset,0,
["PROFILE=BASELINE"] )
Any help anyone could provide to me would be great.
Ben
More information about the gdal-dev
mailing list