AlternativeUniversity.net
Alternative University

Computer Science

Raster Image Storage

Higher Precision Extended Range

XRH File Format 4.0

XRHLIB Software

XRHLIB is free C language source code for reading and writing XRH files. XRHLIB is released under the ZLIB-style license, and is bundled with ZST and SZ which are released under the BSD license.

Download the XRHLIB source code package that includes XRHLIB, ZST and SZ:

xrhlib400.zip
(758 K)

Create a new C/C++ project, copy the xrhlib-3.0.0 directory tree out of xrhlib400.zip to create an xrhlib-4.0.0 subdirectory off the project directory, and include into the project all of the “.c” files in the following directories:

xrhlib-4.0.0
xrhlib-4.0.0/szmod/src
xrhlib-4.0.0/zstlib/common
xrhlib-4.0.0/zstlib/compress
xrhlib-4.0.0/zstlib/decompress
xrhlib-4.0.0/zstlib/dictBuilder

Many of the “.c” files in the szmod/src directory are not needed, but go ahead and put them in the project for now to facilitate getting started.

Technical Note about SZ compression: XRH uses the floating point prediction of SZ, not the integer prediction of SZ; the integer prediction parts of SZ can be removed.

The source code file in the xrhlib-4.0.0 directory provides functions to read and write XRH files. This proof-of-concept software reads and writes RGBA files with 32-bit floating point samples.

If you will be using JP2K compression, and OpenJPEG is not installed on your system, then download the prebuilt OpenJPEG DLL from the OpenJPEG web site.

If you will not be using JP2K compression, comment out the include statement and do not include in your project the JP2K .c file that is in the xrhlib-4.0.0 directory. In that case, OpenJPEG will not be used and will not be needed.

To comment out the include statment if not using JP2K compression, look for the comment that states “Comment out if not using JP2K”, and then comment out the include statement right after that comment.


Sample Images

The following XRH files store RGBA images with 32-bit floating point samples.

Distant Lighting
DistantLightingZ.xrh
(1.9 MB)

Image dimensions: 590 × 470 pixels
Compression Type: Zebra (lossless)
Scene model credit: Lux Core Render

Preview


Glow, Mirror
GlowMirrorZ.xrh
(4.5 MB)

Image dimensions: 1255 × 549 pixels
Compression Type: Zebra (lossless)
Scene model credit: AMD

Preview


Glass Teapot
GlassTeapotZ.xrh
(4.7 MB)

Image dimensions: 950 × 618 pixels
Compression Type: Zebra (lossless)
Scene model credit: Benedikt Bitterli

Preview


Water Caustic
WaterCausticSZ.xrh
(944 K)

Image dimensions: 1086 × 1086 pixels
Compression Type: SZMOD (lossy)
Scene model credit: Benedikt Bitterli


Table, Chairs
TableChairsSZ.xrh
(1.4 MB)

Image dimensions: 1692 × 2280 pixels
Compression Type: SZMOD (lossy)
Scene model credit: Lux Core Render
Painting credit: Albert Bierstadt

Preview


Staircase
StaircaseSZ.xrh
(3.2 MB)

Image dimensions: 1440 × 2222 pixels
Compression Type: SZMOD (lossy)
Scene model credit: Benedikt Bitterli


Underwater
UnderwaterSZ.xrh
(2.3 MB)

Image dimensions: 2160 × 1080 pixels
Compression Type: SZMOD (lossy)
Scene model credit: Lux Core Render


<  Previous Page:  Color Transformations
XRH 4.0 File Format
Page 1 : 
Page 2 : 
Page 3 : 
Page 4 : 
Page 5 : 
Page 6 : 
Page 7 : 
Page 8 : 
Page 9 : 
Page 10 : 
Page 11 : 
Page 12 : 
Introduction
Data Types
File Layout & Header
Comments
Custom Properties
Channel Names
Channels
Zebra Compression
SZMOD Compression
JP2K Compression
Color Transformations
Example Images (this page)