storing compressed images in hdf5

I would like to use hdf5 as a general file format for my work. I do a lot of computer vision work and image storage is quite important. I need to be able to store images in a variety of formats. HDF5 seems to be a good start. One can store images that are true color and palette lookup and can even use one of the built-in lossless compression filters of szip or gzip. My question or thought for discussion is: How would one go about extending hdf5 (and if necessary hdf view) to also support other image formats (i.e., jpeg, jpeg-2000, tiff, etc.), both lossy and lossless?

I know the FAQ has an entry about using the opaque datatype to store a binary object in an hdf5 file. I am looking for a more standardized or general purpose approach. I believe something like a "jpeg" filter is what I would like. If a generic encode/decode filter is not feasible (or even a good idea), what about a decode only filter? For example, if reasonable, I would be willing to write the code to store an image as a custom jpeg data type but would like to have a general purpose jpeg "decode filter" that a general purpose tool, like hdfview, could use to display the dataset as an image.

Or am I trying to do too much with HDF5 and should not try to use it as a general container for compressed imagery (and eventually video)?

I am still getting started with HDF and I appreciate any comments or suggestions.

Thanks,
Phil

Hi Phil,

···

On Sep 20, 2012, at 1:13 PM, Philip Miller wrote:

I would like to use hdf5 as a general file format for my work. I do a lot of computer vision work and image storage is quite important. I need to be able to store images in a variety of formats. HDF5 seems to be a good start. One can store images that are true color and palette lookup and can even use one of the built-in lossless compression filters of szip or gzip. My question or thought for discussion is: How would one go about extending hdf5 (and if necessary hdf view) to also support other image formats (i.e., jpeg, jpeg-2000, tiff, etc.), both lossy and lossless?

I know the FAQ has an entry about using the opaque datatype to store a binary object in an hdf5 file. I am looking for a more standardized or general purpose approach. I believe something like a “jpeg” filter is what I would like. If a generic encode/decode filter is not feasible (or even a good idea), what about a decode only filter? For example, if reasonable, I would be willing to write the code to store an image as a custom jpeg data type but would like to have a general purpose jpeg “decode filter” that a general purpose tool, like hdfview, could use to display the dataset as an image.

Or am I trying to do too much with HDF5 and should not try to use it as a general container for compressed imagery (and eventually video)?

I am still getting started with HDF and I appreciate any comments or suggestions.

  I think this is an appropriate use of HDF5 and should probably be tackled at a couple of levels, including possible extensions to the Image API, along with new compression filters like the JPEG ones you suggest.

  Quincey