NvImageCodec
A nvImageCodec library of GPU- and CPU- accelerated codecs featuring a unified interface
Install / Use
/learn @NVIDIA/NvImageCodecREADME
nvImageCodec
The nvImageCodec is an open-source library of accelerated codecs with unified interface. It is designed as a framework for extension modules which delivers codec plugins.
This nvImageCodec release includes the following key features:
- Unified API for decoding and encoding images
- Batch processing, with variable shape and heterogeneous formats images
- Codec prioritization with automatic fallback
- Builtin parsers for image format detection: jpeg, jpeg2000, tiff, bmp, png, pnm, webp
- Python bindings
- Zero-copy interfaces to CV-CUDA, PyTorch and CuPy
- End-end accelerated sample applications for common image transcoding
Currently there are following native codec extensions:
-
nvjpeg_ext
- Hardware jpeg decoder
- Hardware jpeg encoder (on Jetson Thor)
- CUDA jpeg decoder
- CUDA lossless jpeg decoder
- CUDA jpeg encoder
-
nvjpeg2k_ext
- CUDA jpeg 2000 decoder (including High Throughput Jpeg2000)
- CUDA jpeg 2000 encoder (including High Throughput Jpeg2000)
-
nvtiff_ext
- CUDA TIFF decoder
- CUDA TIFF encoder
-
nvbmp_ext (as an example extension module)
- CPU bmp reader
- CPU bmp writer
-
nvpnm_ext (as an example extension module)
- CPU pnm (ppm, pbm, pgm) writer
Additionally as a fallback there are following 3rd party codec extensions:
-
libturbo-jpeg_ext
- CPU jpeg decoder
-
libtiff_ext
- CPU tiff decoder
-
opencv_ext
- CPU jpeg decoder & encoder
- CPU jpeg2k_decoder & encoder
- CPU png decoder & encoder
- CPU bmp decoder & encoder
- CPU pnm decoder & encoder
- CPU tiff decoder & encoder
- CPU webp decoder & encoder
Pre-requisites
This section describes the recommended dependencies to use nvImageCodec.
- Linux distro:
- x86_64
- Debian 12
- Fedora 41
- RHEL 8, 9
- OpenSUSE 15
- SLES 15
- Ubuntu 20.04, 22.04, 24.04
- WSL2 Ubuntu 20.04
- arm64-sbsa
- RHEL 8, 9
- SLES 15
- Ubuntu 20.04, 22.04, 24.04
- aarch64-jetson (CUDA Toolkit >= 12.1, < 13.0)
- Ubuntu 22.04
- NVIDIA driver >= 530.30.02
- x86_64
- Windows
- x86_64
- NVIDIA driver >= 531.14
- CUDA Toolkit >= 12.1
- GCC >= 14.0
- Python >= 3.9
Install nvImageCodec library
You can download and install the appropriate built binary packages from the nvImageCodec Developer Page or install nvImageCodec Python from PyPI as it is described below.
| CUDA version | Instructions |
| -----------------------------|------------------------------------------------|
| CUDA 12.x, 13.x | pip install nvidia-nvimgcodec-cu{12, 13} |
| CUDA 12.x (Tegra platforms) | pip install nvidia-nvimgcodec-tegra-cu{12} |
Installing optional dependencies
You can also install optional dependencies to run the nvjpeg, nvjpeg2k and nvtiff plugins.
To install nvImageCodec with all the optional dependencies, you can do
| CUDA version | Instructions |
| -----------------------------|---------------------------------------------------|
| CUDA 12.x, 13.x | pip install nvidia-nvimgcodec-cu{12, 13}[all] |
| CUDA 12.x (Tegra platforms) | pip install nvidia-nvimgcodec-tegra-cu{12}[all] |
Alternatively, you can specify a subset of the dependencies: nvjpeg, nvjpeg2k, nvtiff. Here are some examples:
| CUDA version | Instructions |
| --------------------------------------|-------------------------------------------------------------------|
| nvjpeg2k extension support | pip install nvidia-nvimgcodec-cu{12, 13}[nvjpeg2k] |
| nvjpeg2k and nvtiff extension support | pip install nvidia-nvimgcodec-cu{12, 13}[nvjpeg2k+nvtiff] |
In the following subsections, you can see how to install those dependencies manually, instead of relying on nvimagecodec's "extra" packages.
Manual installation of nvJPEG library
If you do not have CUDA Toolkit installed, or you would like install nvJPEG library independently, you can install it manually as a Python package
| CUDA version | Instructions |
| ----------------------|------------------------------------------------|
| CUDA 12.x, 13.x | pip install nvidia-nvjpeg-cu{12, 13} |
Manual installation of nvJPEG2000 library
nvJPEG2000 library can be installed in the system, or installed as a Python package. For the latter, follow the instructions below.
| CUDA version | Instructions |
| ----------------------------|----------------------------------------------|
| CUDA 12.x, 13.x | pip install nvidia-nvjpeg2k-cu{12, 13} |
| CUDA 12.x (Tegra platforms) | pip install nvidia-nvjpeg2k-tegra-cu{12} |
Please see also nvJPEG2000 installation documentation for more information.
Manual installation of nvTIFF library
nvTIFF library can be installed in the system, or installed as a Python package. For the latter, follow the instructions below.
| CUDA version | Instructions |
| -----------------------------|--------------------------------------------|
| CUDA 12.x, 13.x | pip install nvidia-nvtiff-cu{12, 13} |
| CUDA 12.x (Tegra platforms) | pip install nvidia-nvtiff-tegra-cu{12} |
Please see also nvTIFF installation documentation for more information.
Manual installation of nvCOMP library
nvCOMP library can be installed in the system, or installed as a Python package. For the latter, follow the instructions below. nvCOMP is required if you want to use nvTIFF with images that use Deflate compression.
| CUDA version | Instructions |
| -----------------------------|------------------------------------------------|
| CUDA 12.x, 13.x | pip install nvidia-libnvcomp-cu{12, 13} |
Please see also nvCOMP installation documentation for more information.
Documentation
NVIDIA nvImageCodec Documentation
Build and install from Sources
Additional pre-requisites
- Linux
- GCC >= 14.0
- cmake >= 3.18
- patchelf >= 0.17.2
- Windows
- Dependencies for extensions. If you would not like to build particular extension you can skip it.
- nvJPEG2000 >= 0.9.0
- nvTIFF >= 0.5.1
- nvCOMP >= 5.0.0
- libjpeg-turbo >= 2.0.0
- libtiff >= 4.5.0
- opencv >= 4.9.0
- Python packages:
- clang==14.0.1
- wheel
- setuptools
- sphinx_rtd_theme
- breathe
- future
- flake8
- sphinx==4.5.0
Please see also Dockerfiles.
Build
Linux
git lfs clone https://github.com/NVIDIA/nvImageCodec.git
cd nvimagecodec
git submodule update --init --recursive --depth 1
mkdir build
cd build
export CUDACXX=nvcc
cmake .. -DCMAKE_BUILD_TYPE=Release
make
Build CVCUDA samples
To build CV-CUDA samples, additionally CV-CUDA has to be installed and CVCUDA_DIR and NVCV_TYPES_DIR need to point folders with *-config.cmake files. Apart of that, BUILD_CVCUDA_SAMPLES variable must be set to ON.
Windows
Open Developer Command Prompt for VS 2022
git lfs clone https://github.com/NVIDIA/nvImageCodec.git
cd nvimagecodec
git submodule update --init --recursive --depth 1
.\externa\build_deps.bat
.\docker\build_helper.bat .\build 12
Build Python wheel
After succesfully built project, execute below commands.
cd build
cmake --build . --target wheel
Packaging
From a successfully built project, installers can be generated using cpack:
cd build
cpack --config CPackConfig.cmake -DCMAKE_BUILD_TYPE=Release
This will generate in build directory *.zip or *tar.xz files
Installation from locally built packages
Tar file installation
tar -xvf nvimgcodec-0.7.0.0-cuda12-x86_64-linux-lib.tar.gz -C /opt/nvidia/
DEB File Installation
sudo apt-get install -y ./nvimgcodec-0.7.0.0-cuda12-x86_64-linux-lib.deb
Python WHL File Installation
pip install nvidia_nvimgcodec_cu12-0.7.0-py3-none-manylinux_2_28_x86_64.whl
Installation from sources
Linux
cd build
cmake --install . --config Release --prefix /opt/n
Related Skills
claude-opus-4-5-migration
84.2kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
340.5kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
49.9k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
mcp-for-beginners
15.7kThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
