[Gdal-dev] Conversion of JPG to TIF

Matt Wilkie matt.wilkie at gov.yk.ca
Tue Apr 11 18:54:33 EDT 2006


I'm curious about this too. At first I thought Michael was being over 
specific, and that just using the defaults should work (gdal_translate 
infile.jpg outfile.tif) but it doesn't for me either (windows fwtools 
1.0.0a6)

What does the number after the "x" in gdalinfo's Block size mean? It 
seems to bear no relation to the gtiff option of the same name ("-co 
BLOCKXSIZE=n"). The source jpg is like this:

    Band 1 Block=1600x1 Type=Byte, ColorInterp=Red
    Band 2 Block=1600x1 Type=Byte, ColorInterp=Green
    Band 3 Block=1600x1 Type=Byte, ColorInterp=Blue

and the output tif is:

    Band 1 Block=1600x4 Type=Byte, ColorInterp=Red
    Band 2 Block=1600x4 Type=Byte, ColorInterp=Green
    Band 3 Block=1600x4 Type=Byte, ColorInterp=Blue

while converting jpg to tif using xnview there is no difference.

In any case I eventually discovered that using the option "-co 
interleave=pixel" yields tif's-from-jpeg images that are viewable 
outside of openev and arcmap:

    gdal_translate -co interleave=pixel somejpeg.jpg outfile.tif

    gdalinfo outfile.tif
    [...]
    Band 1 Block=1600x1 Type=Byte, ColorInterp=Red
    Band 2 Block=1600x1 Type=Byte, ColorInterp=Green
    Band 3 Block=1600x1 Type=Byte, ColorInterp=Blue


cheers,

-- 
matt wilkie
--------------------------------------------
Geographic Information,
Information Management and Technology,
Yukon Department of Environment
10 Burns Road * Whitehorse, Yukon * Y1A 4Y9
867-667-8133 Tel * 867-393-7003 Fax
http://environmentyukon.gov.yk.ca/geomatics/
--------------------------------------------




More information about the Gdal-dev mailing list