idc#
CCSDS 122.0-B Image Data Compression in pure OCaml.
Overview#
Wavelet-based image compression following the CCSDS 122.0-B standard, used for space image data systems. The algorithm applies a 2D discrete wavelet transform followed by a bit-plane encoder for progressive quality coding.
Features#
- Integer 5/3 wavelet (Le Gall) for lossless compression
- Float 9/7 wavelet (CDF 9/7) for lossy compression
- Multi-level 2D discrete wavelet transform via lifting scheme
- Bit-plane encoder with significance and refinement passes
- Progressive quality: partial bitstreams yield lower-quality reconstructions
Installation#
Install with opam:
$ opam install idc
If opam cannot find the package, it may not yet be released in the public
opam-repository. Add the overlay repository, then install it:
$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install idc
Usage#
(* Compress + decompress a 256x256 grayscale image. *)
let image_data = Bytes.make (256 * 256) '\x00'
let compressed = Idc.compress ~wavelet:`Int_5_3 ~width:256 ~height:256 image_data
let restored = Idc.decompress ~width:256 ~height:256 compressed
let () = assert (Bytes.equal restored image_data)
Licence#
ISC License. See LICENSE.md for details.