{"id":27910,"library":"large-image-source-openjpeg","title":"large-image-source-openjpeg","description":"An OpenJPEG-based tile source for the large-image library, enabling efficient reading of JPEG2000 (JP2) images. Current version 1.34.1. Release cadence is irregular, tied to the large-image monorepo.","status":"active","version":"1.34.1","language":"python","source_language":"en","source_url":"https://github.com/girder/large_image","tags":["large-image","tilesource","openjpeg","jp2","jpeg2000","girder"],"install":[{"cmd":"pip install large-image-source-openjpeg","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Core framework; this source cannot function without large-image.","package":"large-image","optional":false},{"reason":"Python binding for OpenJPEG used to decode JP2 files.","package":"glymur","optional":false},{"reason":"C library required by glymur; must be installed separately (system package).","package":"libopenjp2","optional":false}],"imports":[{"note":"OpenjpegTileSource is not exposed at the top-level large_image package.","wrong":"from large_image import OpenjpegTileSource","symbol":"OpenjpegTileSource","correct":"from large_image_source_openjpeg import OpenjpegTileSource"}],"quickstart":{"code":"from large_image_source_openjpeg import OpenjpegTileSource\n\nts = OpenjpegTileSource('path/to/input.jp2')\nprint(ts.getMetadata())\ntile = ts.getTile(0, 0, 0)\nprint(tile.shape)","lang":"python","description":"Open a JP2 file and read its metadata and a tile at level 0."},"warnings":[{"fix":"Install libopenjp2 via system package manager (e.g., apt install libopenjp2-7, yum install openjpeg2).","message":"The underlying glymur library requires libopenjp2 to be installed on the system. Installing via pip alone will fail if the C library is missing.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade Python to 3.10 or later.","message":"As of large-image 1.34.0, Python 3.9 support was dropped. This source now requires Python >=3.10.","severity":"deprecated","affected_versions":">=1.34.0"},{"fix":"Verify the image opens correctly; consider using large-image-source-tiff for more complex cases.","message":"The source does not support all JP2 features; it may fail on images with certain color spaces or resolution reductions.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'pip install large-image-source-openjpeg' in the correct Python environment.","cause":"The package is not installed or is installed under a different environment.","error":"ModuleNotFoundError: No module named 'large_image_source_openjpeg'"},{"fix":"Check file validity; convert to a supported format (e.g., TIFF) using a tool like ImageMagick.","cause":"The file is corrupt or uses an unsupported JP2 feature (e.g., 16-bit precision, certain color spaces).","error":"glymur.codestream.Jp2kRuntimeError: Failed to read JP2 file"},{"fix":"Install it via system package manager: sudo apt-get install libopenjp2-7 (Debian/Ubuntu) or sudo yum install openjpeg2 (RHEL/CentOS).","cause":"The system library libopenjp2 is not installed.","error":"OSError: libopenjp2.so.7: cannot open shared object file"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}