[ HDF5 High Level Tutorial Top ] [ Next ] [ Prev ]

H5IM: HDF5 Image
Images

Programming Example

The following example demonstrates how to create indexed and true color HDF5 images. The example uses realistic image data read from ASCII files. The corresponding HDF5 file that is generated is also referenced here. You can use an HDF5 file browser that handles HDF5 images to access this file by clicking on the link below.

NOTE: To download a tar file of all of the examples, including a Makefile, please go to the Index page. The output images generated by this example are

8 bit raster image. Click for a full size image

24 bit raster image.

Programming Example

The following C program provides an examples of how to generate HDF5  image data from floating point data.  In the example we use real life topographic data (from the North American hemisphere). In the dataset sea values are represented as negative numbers and land values are represented as positive numbers. The example generates 3 HDF5 images, one that generates an image from all the values, another that generates an image from the land values and another that generates an image from the sea values. 

The images obtained are

Processing all the data. Click for a full size image

Processing the land data. Click for a full size image

Processing the sea data. Click for a full size image


HDF Help Desk
Last modified: November 18, 2002