11 Sep 2013 03:14 AM |
|
I have images in .hdr format. But i want to save image .tif format (8bit) .
I read to used function Write_tiff. But i can't run idl. Can you help me? Thanks
pro tiff
image=TVRD(/TRUE)
filename=File_search('c:\Temp\create_idl_test\test.hdr')
WRITE_TIFF,filename, image
end
|
|
|
|
Deleted User New Member
Posts:  
19 Sep 2013 01:43 PM |
|
I don't believe that your *.hdr file is actually an image file. If the file size is 1KB then it is a text file. This file should have another file with the same name but different extension (*.dat, *.img). This other file is the file you want to open. You would need to use one of the IDL routines like OPENR. You will first need to know the number of line, samples, band (x,y,z). If the *.hdr file is text you will find those values. These are used to create an array. You will need readf to read your image file into that array. The array will then be used with write_tiff.
|
|
|
|
Deleted User New Member
Posts:  
07 Oct 2013 09:24 AM |
|
Thank you, But i want convert image 32bit ( Modis) to 8bit (Modis). But i don't know how use write_tiff function.
Example: i am openning a images file. Then, i write idl but it's error. Can you help me?
pro tiff
ENVI_BATCH_INIT, LOG_FILE = 'batch_log.txt'
envi_select, title='Select image to export', $
fid=fid,dims=dims,pos=pos
write_tiff, 'c:\Temp\Modis_test_idl\A2013178_27062013.tif', /GEOTIFF
out_name='c:\Temp\Modis_test_idl\demo.tif'
END
|
|
|
|
Berangere Casson New Member
Posts:61  
08 Oct 2013 07:29 AM |
|
Not sure which error message you receive. However the GEOTIFF should be equal to a structure containing one field for each of the GeoTIFF tags and keys to be written into the output file.
An image argument including the array to be written in the tiff file is also required as input to the WRITE_TIFF routine:
WRITE_TIFF, file, image, GEOTIFF=geotiff_tag
with file the path and filename to the output file (string), image the input data array, and geotiff_tag the structure containing the geotiff projection definition.
|
|
|
|
Deleted User New Member
Posts:  
08 Oct 2013 10:32 PM |
|
Hi all, resume problem i meet:
I have a idl from .hdr Modis (32bit). And now, i want to use function to export from Modis (.hdr) 32 bit to Modis (.tif) 8 bit.
Actualy, i can click on window image (File->Save image as->Image File, in Output Display to Image File, i choice Resolution 8-bit (gray scale)).
But if i have multiple files image, it lost time. So, i want code idl to processing it problem.
Can you help me? Thanks
|
|
|
|
Deleted User New Member
Posts:  
16 Oct 2013 01:20 AM |
|
nobody can help me :(
|
|
|
|
Berangere Casson New Member
Posts:61  
16 Oct 2013 04:43 AM |
|
Did you try using ENVI_GET_IMAGE to retrieve the data from your display and then ENVI_OUTPUT_TO_EXTERNAL_FORMAT to save the image in .tif format ?
|
|
|
|
Deleted User New Member
Posts:  
04 Nov 2013 01:18 AM |
|
HI there
I usually save image using an image program which supports a detailed tutorial for image saving.But i've never tried to save image as tiff directly.I usually convert the image to tiff then save it using the tiff processing program.I also want to know whether there is a powerful image program which supports to do that.Thanks for any suggestion.
|
|
|
|