Posts Tagged 'meta information'

By the way, what is an image file format?

Some beginners would like to ask but do not dare:

What is a file format?

To start, let’s say it is only the way the data are written in your file. In principle, it should not affect the image itself.

Ok, but an image is only a 2D array (the image is a rectangle), with optionally a third dimension to store bands. A very straightforward way of saving this data in a file is simply to copy the matrix into the file in a very plain way: 1st pixel, 2nd pixel, 3rd pixel, etc up to the last pixel of the first line, then continue on the next line, and so on to the end of the image. This is what does the Envi format. When you have bands, you can even choose if you want to write all the bands values of the same pixel in a row, or write the image of the first band first, then append the second band, etc. In any case, you’ve got something that is very similar to a copy of the computer memory where the file as to be placed when it is read.

Pages: 1 2 3

What format is this file?

Have you ever wondered what is really the file format of an image? Or what are the 4 corners coordinates, or the projection? You can get the answer in a single command line. Say we want to know more about an image name africa.img. Actually the file extension,.img can not be considered as a trustful indication of the real format inside the image, since you can change it as you like. Extensions are only a file naming convention and have nothing to do with the data really written in the file (and the format is much more HOW is written the data).

The command gdalinfo accepts several parameters, to know them simply type:

gdalinfo

and you get a list of optional parameters (which can change in future versions), the only mandatory parameter being the filename (datasetname):

Usage: gdalinfo [--help-general] [-mm] [-stats] [-nogcp] [-nomd]
[-mdd domain]* datasetname

To get accurate information on the command line, have a look on http://www.gdal.org/gdalinfo.html

Pages: 1 2 3