Re: read/writing tiff files [message #35633 is a reply to message #35632] |
Sat, 28 June 2003 04:28  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Alexandra Panton wrote:
> ok, this is probably a really simple question but having decided that
> having 500+ images to process I needed to do some idl programming !
> What i want to do is really simple - but as with all things and
> computers simple rapidly progresses to the impossible :)
>
> Here's what I want to do:
> I have a directory on my computer with all my images, - tiff files in,
> I want to read them into an array - I can do this bit, apply my
> processing steps (having trouble with that!), then write the output as
> a tiff or jpg file.
>
> I have managed to do this to a fashion but it writes blank files -
> very useful!
>
> my code so far...
Dear Alexandra,
there are a lot of tips available at Davids page
www.dfanning.com
Here in short how I would do this:
stuff = 'f:\ftp_web_root\Recent\hawaii\GOES_9\all'
file=file_search(stuff,'*.tif',COUNT=n)
for i=0L,n-1 do begin
result=query_image(file[i],info)
print,info.dimensions
help,info,/str
img=read_image(files[i],red,green,blue)
img=(330-(0.5*img))
write_image,'d:\goes\hawaii\changed_'+files[i],'TIFF',red,gr een,blue
endfor
You should have a look at the info structure of the query function.
I don't know in which way your images are color coded. I would suggest to
read the tips on Davids page regarding color problems too.
best regards
Reimar
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|
|
|