imagelibversion

Library implementing parsing of image formats such as PNG, BMP, PPM

The imagelib library implements image formats such as PNG, BMP, and PPM in OCaml, relying on only one external dependency: 'decompress'.

Unix-dependent functionality such as reading or writing to files in the filesystem are packaged in the imagelib.unix findlib module inside this OPAM package; to use it you need to include imagelib.unix specifically in your project's dependencies, for instance (libraries imagelib.unix) in your Dune file.

Supported image formats:

  • PNG (full implementation of RFC 2083),
  • PPM, PGM, PBM, ... (fully supported),
  • BMP (read-only)
  • JPG (only image size natively),
  • GIF (only image size natively),
    • There is an experimental native implementation available in the pure ImageLib module.
  • XCF (only image size natively),
  • Utility functions for handling unimplemented formats are available in the 'imagelib.unix' findlib package and handle conversion from unsupported image formats like JPG, GIF, XCF by converting them to PNG using the convert commandline utility from imagemagick.

As imagelib only requires decompress, it is suitable (excluding operations requiring the imagemagick convert binary) for compilation to javascript using js_of_ocaml, or inclusion in MirageOS unikernels.

app/imagetool.ml contains an example binary that acts as a command-line interface to many of the functions in the library. It will be installed as imagetool or imagetool.exe if you use opam to install the library, and otherwise it will be in _build/default/app/imagetool.exe

AuthorRodolphe Lepigre <rodolphe.lepigre@inria.fr>
LicenseGPL-3.0-only
Published
Homepagehttps://github.com/rlepigre/ocaml-imagelib
Issue Trackerhttps://github.com/rlepigre/ocaml-imagelib/issues
Maintainerrodolphe.lepigre@inria.fr
Dependencies
Optional dependencies
Source [http] https://github.com/rlepigre/ocaml-imagelib/releases/download/20210402/imagelib-20210402.tbz
sha256=b3c8ace02b10b36b6c60b3ce3ae0b9109d4a861916ec320c59cc1194f4cc86e3
sha512=2be7badb07a98565383d2ec6dc00599269e1127ff6467fd5d4730030dc7cff8c06027e6b54643fcd012ec3317d322e80b88456249c883c3e0bebc25b4beb0fca
Edithttps://github.com/ocaml/opam-repository/tree/master/packages/imagelib/imagelib.20210402/opam