X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 27 Nov 2008 04:09 AM by  anon
exacty programming equivalent of save image as > image file
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
27 Nov 2008 04:09 AM
    I need a programming routine that gives the exact equivalent of loading an image in the ENVI display, and using Save Image As > Image File > then leaving all the defaults as they are (Resolution =24 bit color ( BSQ) , output file type ENVI, and then saving the file with no file extension. This method produces two files (and envi file and a header) that look identical to what you get by using envi_output_to_external_format, /envi but there must be some slight difference as the programme i am using to read it in sees only a grey image unless the file is saved using the ENVI interface method. Any thoughts on why this is happening or how to resolve greatly appreciated.    

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    01 Dec 2008 08:56 AM
    Save Image As and Save File as are not equivalent.  Saving from the display will only save a 1-band byte scaled image or a 3-band RGB byte scaled image.  The data are byte scaled to look as they are in the ENVI display, which by default applies a 2% stretch.  When you use Save File As from the File menu, ENVI does not change the nature of the data - it will include all bands of the data unless spectrally subset and keeps the original data type.  If you use ENVI_OUTPUT_TO_EXTERNAL_FORMAT, it is the same as using Save File As.  There is no equivalent ENVI routine to save the display.  Under the hood, ENVI is using the IDL routines such as WRITE_TIFF or WRITE_PNG.  If you are trying to get something similar to what ENVI does when saving from the display, I would suggest using STRETCH_DOIT to apply a 2% stretch on the bands you wish to output, then use ENVI_OUTPUT_TO_EXTERNAL_FORMAT.

    Deleted User



    New Member


    Posts:
    New Member


    --
    02 Dec 2008 08:06 AM
    Thank you - that worked perfectly. I didn't even need to use the ENVI_OUTPUT_TO_EXTERNAL_FORMAT, just used the out_name from the stretch I performed.  (I initially used DECOR_DOIT, and then performed the stretch on this output and produced the desired file).   

    Deleted User



    New Member


    Posts:
    New Member


    --
    28 Jun 2010 04:19 AM
    I am trying to do something similar to this, but I just want to create a JPEG for the contents of an open window. Is there an easy way to grab what is being viewed in a window and JPEG it? I need to create a one-button solution that automatically selects JPEG as the format, inputs the quality, and saves it down. Thanks.
    You are not authorized to post a reply.