You are here: Appendix A - Technical Information > Header Files for BIP, BIL and BSQ Images

Header Files for BIP, BIL and BSQ Images

A BBB image consists of two files, a binary file containing only the raw sample values of the image and a text file describing the image properties. The raw data may be organized in one of three layouts: “band-interleaved by pixel” (BIP), “band-interleaved by line” (BIL), and “band sequential” (BSQ). The three formats are collectively referred to as the BBB file format.

Because BBB files only contain raw data with an easily editable header format, they are often used as a “least common denominator” interchange format. However, there is no set standard for the keywords that may be contained in the header. This document describes the header format that GeoExpress supports.

GeoExpress recognizes four file extensions: .bip, .bil, .bsq, and .bbb. The first three imply the layout is BIP, BIL, or BSQ respectively; the .bbb extension implies the default layout, which is BIP. The header file for a BBB image has the same name as the image, but with a .hdr extension.

Header Syntax

The header file is a simple text file containing keywords and their associated value, one keyword/value(s) set per line. All keywords and values are case-insensitive. Blank lines are ignored. Leading and trailing whitespace is ignored. A line that begins with a # character, possibly preceded by whitespace, indicates a comment line. Comment lines are ignored.

Supported Keywords

The following table lists supported keywords and their allowed values.

Keyword Description Notes
bandgapbytes   Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
bandrowbytes   Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
bands The number of bands in the image (sames as NBANDS)  
byte_order Endianness interpretation of data

Allowed values: MOTOROLA, M, BIG, BIGENDIAN, NA

The value NA may only be used if the number of bands is 1

Default: host byte order

byteorder same as BYTE_ORDER  
colorspace The color space of the image

Allowed values: GREY, GREYA, GRAY, GRAYA, GREYSCALE, GREYSCALEA, GRAYSCALE, GRAYSCALEA, RGB, RGBA, CMYK, CMYKA, MULTISPECTRAL, MULTISPECTRALA

Default: GRAY for 1-banded images, RGB for 3-banded images, otherwise MULTISPECTRAL

cols Width of the image, in pixels (same as NCOLS)  
datatype The data type of the samples

Allowed values: U8, U16, S8, S16, F32

Default: U8

dynamicrangelevel The midpoint of the range of the data

Allowed values: a single floating-point value (applies to all bands)

Default: (none)

dynamicrangemax The maximum of the range of data

Allowed values: a single floating-point value (applies to all bands)

Default: (none)

dynamicrangemin The minimum of the range of data

Allowed values: a single floating-point value (applies to all bands)

Default: (none)

dynamicrangewindow The size of the range of the data

Allowed values: a single floating-point value (applies to all bands)

Default: (none)

e_squared Sphere eccentricity squared, for georeferencing Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
interleaving Same as LAYOUT  
layout The data layout; use of this keyword overrides the layout implied by the filename extension

Allowed values: BIP, BIL, BSQ, or NA

The value NA may only be used if the number of bands is 1

Default: BIP

map_units Measurement unit for georeferencing Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
nbands The number of bands in the image (same as BANDS)

Allowed values: 1–65535

Default: (none; this keyword is required)

nbits The number of bits used per sample

Allowed values: 1 to (total number of bits per sample)

Default: the total number of bits per sample

ncols Width of the image, in pixels (same as COLS)

Allowed values: 1 to 231 (2,147,483,648)

Default: (none; this keyword is required)

nrows Height of the image, in pixels (same as ROWS)

Allowed values: 1 to 231 (2,147,483,648)

Default: (none; this keyword is required)

pixel_height Size of a pixel in the y-direction, for georeferencing (same as YDIM)

Allowed values: (any floating point value)

Default: (none)

pixel_width Size of a pixel in the x-direction, for georeferencing (same as XDIM)

Allowed values: (any floating point value)

Default: (none)

projection_name Name of the projection system, for georeferencing Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
projection_paramteres Numeric projection parameters, for georeferencing Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
projection_zone Projection zone number, for georeferencing Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
radius Sphere radius, for georeferencing Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
rows Height of the image, in pixels (same as NROWS)  
semi_major_axis Semi-major axis, for georeferencing Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
semi_minor_axis Semi-minor axis, for georeferencing Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
skipbytes Number of bytes to skip at the start of an image file

Allowed values: 0 to the size of the image (in bytes)

Default: 0

This is especially useful for raw formats that contain a fixed number of header bytes at the start of the data file.

spheroid_name Name of the projection system, for georeferencing Corresponding metadata tags are created, but the actual values are not used in setting the geocoordinates of the input image
totalrowbytes   Not currently supported; this entry is ignored.
ul_x_coordinate Upper left x-position, for georeferencing (same as ULXMAP)

Allowed values: (any floating point value)

Default: (none)

ul_y_coordinate Upper left y-position, for georeferencing (same as ULYMAP)

Allowed values: (any floating point value)

Default: (none)

ulxmap Upper left x-position, for georeferencing (same as UL_X_COORDINATE)

Allowed values: (any floating point value)

Default: (none)

ulymap Upper left y-position, for georeferencing (same as UL_Y_COORDINATE)

Allowed values: (any floating point value)

Default: (none)

wordlength Number of bytes per sample

Allowed values: 1 or 2

Default: 1, unless overridden by DATATYPE

xdim Size of a pixel in the x-direction, for georeferencing (same as PIXEL_WIDTH)

Allowed values: (any floating point value)

Default: (none)

ydim Size of a pixel in the y-direction, for georeferencing (same as PIXEL_HEIGHT)

Allowed values: (any floating point value)

Default: (none)

Additional Notes

These keywords are required: NBANDS (or BANDS), NCOLS (or COLS), and NROWS (or ROWS). All other keywords have default values.

If dynamic range is used, either both DYNAMICRANGEMIN and DYNAMICRANGEMAX must be set or both DYNAMICRANGEWINDOW and DYNAMICRANGELEVEL must be set.

Example

This BBB header file describes a 640 × 480 RGB color image, using an unsigned 16-bit data sample.

Extensions

Note that some of the header syntax supported by GeoExpress may not be supported by other vendors’ BIP/BIL/BSQ implementations. In particular, the following features and keywords may be somewhat specific to LizardTech: