[GIS] Converting *.tif file into headerless (flat) binary file

envifile formatsraster-conversionremote sensing

I am using NDVI files (value range -1 to +1) created from Landsat CDR images to produce a timeseries in TIMESAT software.

My .tif file has following characteristics.
File type TIFF,Data Type Double Precision, Byte Order Host (Intel), Interleave BSQ

As per the requirement of TIMESAT, the image should be headerless(flat) binary file, and values can be stored as 8 bit integer(0-255), 16 bit signed integer(-32767 to +32768) or 32 bit real.

Now i need to change my data type into any of these 3 format and .tif file into headerless binary files.

Any idea?

Best Answer

GDAL's ENVI driver can be used to write headerless binary data files. The default data interleave is band sequential (BSQ), but BIP or BIL interleave options can be specified as a creation option.

For example, to convert a GeoTIFF file foo.tif to a headerless file foo.bin:

gdal_translate -of ENVI foo.tif foo.bin

The ASCII file foo.bin.hdr will also be created with the header data, but this can be ignored.