RVB JPEG

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RVB JPEG

François-Xavier PRUNAYRE
Hi list,
When using gdal_translate to convert GeoTIFF to JPEG, I get Greyscale JPEG. How to get RVB JPEG instead ?
 
gdal_translate -of JPEG -co WORLDFILE=ON tmp/F056606.TIF tmp/F056606.JPG
 
 Thanks for your help.
Francois
 

--
Ce message a ete verifie par MailScanner pour des virus ou des polluriels et rien de suspect n'a ete trouve.
 
Les donnees et renseignements contenus dans ce message sont personnels, confidentiels et privés.Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee.
 
Any data and information contained in this electronic mail is personal, confidential and private. Any total or partial publication, use or distribution must be authorized.
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: RVB JPEG

Frank Warmerdam-2
On 7/19/05, François Prunayre <[hidden email]> wrote:
>  
> Hi list,
> When using gdal_translate to convert GeoTIFF to JPEG, I get Greyscale JPEG.
> How to get RVB JPEG instead ?
>  
> gdal_translate -of JPEG -co WORLDFILE=ON tmp/F056606.TIF tmp/F056606.JPG

François,

Is the input TIFF file a greyscale single band image?   If so, they
a greyscale output would seem appropriate.

If the input TIFF file is pseudocolored, then you would need to first
convert it to RGB format and then encode that to JPEG.

eg.

pct2rgb.py tmp/F056606.TIF tmp/very_temporary.tif
gdal_translate -of JPEG -co WORLDFILE=ON \
  tmp/very_temporary.tif  tmp/F056606.JPG
rm tmp/very_temporary.tif

If this doesn't cover your situation, perhaps you could provide a
gdalinfo report on the input file.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent
_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

RE: RVB JPEG

François-Xavier PRUNAYRE
TIFF file is pseudocolored in my case. Your exemple works fine for me.

Thanks a lot.
Francois


echo -- Reprojection en WGS84
gdalwarp -s_srs '+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742
+x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515
+towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs' -t_srs
'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' $1 ./tmp/$2.TIF

echo -- Conversion Pseudocolor vers RGB
pct2rgb.py tmp/$2.TIF tmp/dummy.TIF

echo -- Conversion en JPEG
gdal_translate -of JPEG -co WORLDFILE=ON tmp/dummy.TIF tmp/$2.JPG

echo -- Suppression fichier temporaire
rm -f tmp/dummy.TIF
rm -f tmp/$2.TIF

echo -- Renomme fichier de georeferencement
mv tmp/$2.wld tmp/$2.jgw

-----Message d'origine-----
De : Frank Warmerdam [mailto:[hidden email]]
Envoyé : mardi 19 juillet 2005 15:19
À : François Prunayre
Cc : [hidden email]
Objet : Re: [Gdal-dev] RVB JPEG

On 7/19/05, François Prunayre <[hidden email]> wrote:
>  
> Hi list,
> When using gdal_translate to convert GeoTIFF to JPEG, I get Greyscale
JPEG.
> How to get RVB JPEG instead ?
>  
> gdal_translate -of JPEG -co WORLDFILE=ON tmp/F056606.TIF
> tmp/F056606.JPG

François,

Is the input TIFF file a greyscale single band image?   If so, they
a greyscale output would seem appropriate.

If the input TIFF file is pseudocolored, then you would need to first
convert it to RGB format and then encode that to JPEG.

eg.

pct2rgb.py tmp/F056606.TIF tmp/very_temporary.tif gdal_translate -of JPEG
-co WORLDFILE=ON \
  tmp/very_temporary.tif  tmp/F056606.JPG rm tmp/very_temporary.tif

If this doesn't cover your situation, perhaps you could provide a gdalinfo
report on the input file.

Best regards,
--
---------------------------------------+--------------------------------
---------------------------------------+------
I set the clouds in motion - turn up   | Frank Warmerdam,
[hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

--
Ce message a ete verifie par MailScanner pour des virus ou des polluriels et
rien de suspect n'a ete trouve.

Les donnees et renseignements contenus dans ce message sont personnels,
confidentiels et prives. Toute publication, utilisation ou diffusion, meme
partielle, doit etre autorisee.

Any data and information contained in this electronic mail is personal,
confidential and secret. Any total or partial publication, use or
distribution must be authorized.


--
Ce message a ete verifie par MailScanner pour des virus ou des polluriels et rien de suspect n'a ete trouve.

Les donnees et renseignements contenus dans ce message sont personnels, confidentiels et prives. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee.

Any data and information contained in this electronic mail is personal, confidential and secret. Any total or partial publication, use or distribution must be authorized.

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://xserve.flids.com/mailman/listinfo/gdal-dev