JPEG 2000 libraries
Open-source libraries that decode and encode JPEG 2000. Most of them use OpenJPEG under the hood: Pillow, ImageMagick (Magick.NET, Imagick), libvips (govips, ruby-vips), glymur, imagecodecs and the Rust jpeg2k crate. Independent implementations are Grok (C++), CoreJ2K (C#), the JJ2000-based Java plugin and hayro-jpeg2000 (Rust).
| Language | Library | Read | Write | Notes |
|---|---|---|---|---|
| C/C++ | OpenJPEG | yes | yes | reference software, BSD license, used by most other libraries |
| C/C++ | Grok | yes | yes | fast, HTJ2K, AGPL-3.0 |
| C# | Magick.NET | yes | yes | ImageMagick with OpenJPEG built in |
| C# | CoreJ2K | yes | yes | pure managed C#, BSD-3-Clause |
| Java | jai-imageio-jpeg2000 | yes | yes | ImageIO plugin, pure Java, JJ2000 license |
| Go | govips | yes | yes | libvips binding, needs libvips built with OpenJPEG |
| Python | Pillow | yes | yes | the standard imaging library, uses OpenJPEG |
| Python | glymur | yes | yes | full JP2 box access, NumPy arrays, reduced resolution reads |
| Python | imagecodecs | yes | yes | fast encode/decode of NumPy arrays |
| Ruby | ruby-vips | yes | yes | libvips binding, low memory |
| Rust | jpeg2k | yes | limited | safe OpenJPEG wrapper, converts to the image crate |
| Rust | hayro-jpeg2000 | yes | no | pure Rust, memory safe, made for PDF images |
| PHP | Imagick | yes | yes | ImageMagick extension |
Not listed: Kakadu is the fastest and most complete JPEG 2000 SDK but it’s commercial. OpenJPH (BSD-2-Clause, C++) implements only HTJ2K (Part 15).
By language#
- JPEG 2000 libraries for C/C++ Open-source C/C++ libraries to read and write JPEG 2000 images: OpenJPEG and Grok. Comparison, licenses and code examples.
- JPEG 2000 libraries for C# Open-source .NET libraries to read and write JPEG 2000 images: Magick.NET and the pure managed CoreJ2K. Comparison and code examples.
- JPEG 2000 libraries for Java Open-source Java libraries to read and write JPEG 2000 images: the jai-imageio-jpeg2000 ImageIO plugin. License notes and code examples.
- JPEG 2000 libraries for Go Open-source Go libraries to read and write JPEG 2000 images: govips, a binding of libvips with OpenJPEG. Code examples.
- JPEG 2000 libraries for Python Open-source Python libraries to read and write JPEG 2000 images: Pillow, glymur and imagecodecs. Comparison and code examples.
- JPEG 2000 libraries for Ruby Open-source Ruby libraries to read and write JPEG 2000 images: ruby-vips, a binding of libvips with OpenJPEG. Code examples.
- JPEG 2000 libraries for Rust Open-source Rust crates to decode JPEG 2000 images: jpeg2k (OpenJPEG wrapper) and hayro-jpeg2000 (pure Rust). Comparison and code examples.
- JPEG 2000 libraries for PHP Open-source PHP libraries to read and write JPEG 2000 images: the Imagick extension (ImageMagick with OpenJPEG). Code examples.