[Gdal-dev] can GDAL be used to read and manipulate a jpeg file

Frank Warmerdam warmerdam at pobox.com
Tue Apr 18 15:40:12 EDT 2006


krishna_s wrote:
> Hello all, i was wondering if gdal can be used to read a jpeg file and then
> manipulate it, for example my jpeg image consists of some green areas which
> i want to change to red, can i do it using gdal of if anyone know how to do
> it 

Krishna,

GDAL can be used to load and save your image but you will need to write
the manipulation logic yourself.  Depending on your needs it may be
convenient to implement your logic in Numerical Python.  Integrated
with GDAL, you can use a small python script to load images as an array,
manipulate the array with Numerical Python and then save it with GDAL.

I believe the following scripts would be good examples of this:

   http://www.gdal.org/srctree/pymod/samples/val_repl.py
   http://www.gdal.org/srctree/pymod/samples/rel.py

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list