JPEG 2000 libraries for C/C++
For C and C++ there are 2 complete open-source JPEG 2000 codecs:
- OpenJPEG is the ISO/ITU reference software, BSD-licensed, packaged by every Linux distribution and used by Pillow, ImageMagick, libvips, GDAL, Poppler, MuPDF and Ghostscript. Its repository is now marked unmaintained, but releases still appear (2.5.4 in 2025). Pick it by default.
- Grok is a C++ codec derived from OpenJPEG, much faster on multi-core machines, with HTJ2K (Part 15) support, cloud storage reading and a GDAL driver. It’s licensed under AGPL-3.0, which requires releasing your source code if you distribute it or offer it as a network service.
For HTJ2K only, OpenJPH (BSD-2-Clause) is a small, fast C++ library. Kakadu is the leading commercial SDK.
- Grok Grok is a fast open-source JPEG 2000 codec in C++ with HTJ2K support, licensed under AGPL-3.0. How to install it, use grk_compress and grk_decompress.
- OpenJPEG OpenJPEG is the open-source reference JPEG 2000 codec in C. How to install it, decode and encode JP2 and J2K files, read at reduced resolution.