I am about to run a simulation in which I need to encode and decode image files with JPEG2000. I need an API that gives me the flexibility to set coding rate (or quality of the compressed file). Is there any API for Python to do so?
- a maintained fork of PIL
- pip installable with
pip install Pillow
- gives you a huge range of image manipulation options & file type support
- currently at version 5.2.0 so it has supported JPEG 2000 for a long time
- pretty much the standard library for image manipulation
I can't vouch for it personally, but a quick Google search yielded Glymur which looks to be exactly what you are asking for. From the into page:
Glymur is an interface to the OpenJPEG library which allows one to read and write JPEG 2000 files from Python. Glymur supports both reading and writing of JPEG 2000 images, but writing JPEG 2000 images is currently limited to images that can fit in memory. Glymur can read images using OpenJPEG library versions as far back as 1.3, but it is strongly recommended to use at least version 2.1.2.