comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: envi_output_to_external_format - jpeg output not working
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: envi_output_to_external_format - jpeg output not working [message #66279] Wed, 06 May 2009 12:48 Go to next message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
hethomas wrote:
> I know similar things have been posted before with regard to Tiff
> files, but I really need Jpegs. The closest I can get is for a grey
> scale (presumably one band) jpeg to be output. Most things I try
> produce a jpeg file, which won't display (except in ENVI).
> Any ideas?
> Here is my code:
>
> envi_doit, 'decor_doit',fid=t_fid,
> pos=pos,dims=dims,out_name=out_name,r_fid=rfid,$
> out_bname=['Band 14','Band 13','Band 10']
>
> cd, RGBfolder
>
> envi_file_query, rfid, ns=ns, nl=nl, nb=nb
> dims = [-1l, 0, ns-1, 0, nl-1]
> pos = lindgen(nb)
> out_namethree = 'RGB-'+filename
>
>
> envi_doit, 'stretch_doit', $
> fid=rfid, pos=pos, dims=dims, $
> method=1, out_name=out_namethree, $
> i_min=2.0, i_max=98.0, range_by=0, $
> out_min=0, out_max=255, out_dt=1, $
> r_fid=sfid
>
> envi_output_to_external_format, fid=sfid, dims=dims, pos=pos, $
> out_name='outputfile.jpg', /JP2
>
> Thanks in advance!
>
> Helen

Hi Helen,

for this task, I use the following command, in IDL:
write_image, outputFileName, 'JPEG', data,(header.lookup)[0,*],$
(header.lookup)[1,*], (header.lookup)[2,*], quality = 100, order = 1

You can get access to the lookup table from an existing file via
envi_file_query... or just pass your own RGB triplet (R then G then B)

Jean
Re: envi_output_to_external_format - jpeg output not working [message #66465 is a reply to message #66279] Fri, 08 May 2009 01:32 Go to previous message
hethomas is currently offline  hethomas
Messages: 19
Registered: December 2008
Junior Member
Thanks Jean - that was really helpful. I ended up actually using
write_jpeg in the end, but it's pretty similar!
Helen
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: best image plotting routine
Next Topic: Re: faster then where possible?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:56:08 PDT 2025

Total time taken to generate the page: 0.00491 seconds