This page provides a comprehensive introduction to OpenImageIO (OIIO), describing its purpose, core capabilities, architectural philosophy, and major component systems. For detailed information about specific subsystems, see the following pages:
OpenImageIO is a library and toolset for reading, writing, and manipulating image files of any format relevant to VFX/animation production via a format-agnostic API. The project is part of the Academy Software Foundation (ASWF) and is used extensively in feature film production pipelines.
Mission Statement: Provide a format-agnostic image I/O abstraction with the feature set, scalability, and robustness needed for feature film production, targeting VFX studios and developers of renderers, compositors, viewers, and other production pipeline tools.
Project Status:
Sources: README.md13-24 README.md74-93
OpenImageIO is built around several key architectural principles:
Format-Agnostic Design Pattern
Sources: README.md27-38 src/include/OpenImageIO/imageio.h1-76
| Component | Primary Classes | Location | Purpose |
|---|---|---|---|
| I/O Abstraction | ImageInput, ImageOutput | src/include/OpenImageIO/imageio.h | Format-agnostic read/write APIs |
| Metadata | ImageSpec, ParamValue, TypeDesc | src/include/OpenImageIO/imageio.h218-250 | Image metadata and type description |
| In-Memory Images | ImageBuf | src/include/OpenImageIO/imagebuf.h | Image container with pixel access |
| Image Processing | ImageBufAlgo namespace | src/include/OpenImageIO/imagebufalgo.h | 100+ image operations |
| Tile Caching | ImageCache | src/include/OpenImageIO/imagecache.h | Memory-efficient tile cache |
| Texture System | TextureSystem | src/include/OpenImageIO/texture.h | Filtered MIP-map lookups |
| Plugin Management | Plugin registry functions | src/libOpenImageIO/imageioplugin.cpp24-62 | Dynamic plugin loading |
| Command-Line Tools | oiiotool, iv, maketx, iinfo | src/oiiotool/ src/iv/ | User-facing utilities |
| Utilities | ustring, SIMD types, Strutil | src/include/OpenImageIO/ | Foundation utilities |
Sources: src/include/OpenImageIO/imageio.h1-100 src/libOpenImageIO/
OIIO Layered Architecture: This diagram shows the six layers of OpenImageIO, from user-facing tools down to external library dependencies. Each layer builds on the abstractions provided by the layer below.
Sources: src/include/OpenImageIO/imageio.h src/libOpenImageIO/ README.md27-71
The I/O subsystem provides format-agnostic image reading and writing through abstract base classes:
ImageInput (src/include/OpenImageIO/imageio.h100-800): Abstract interface for reading images
open(), read_scanline(), read_tile(), read_image()ImageOutput (src/include/OpenImageIO/imageio.h800-1500): Abstract interface for writing images
open(), write_scanline(), write_tile(), write_image()ImageSpec (src/include/OpenImageIO/imageio.h218-318): Metadata container
width, height, depth, nchannelsformat, channelformats, channelnamesextra_attribs (ParamValueList)Plugin Discovery: The plugin system (src/libOpenImageIO/imageioplugin.cpp) dynamically discovers and loads format plugins at runtime based on file extension or magic number detection.
Sources: src/include/OpenImageIO/imageio.h src/libOpenImageIO/imageinput.cpp src/libOpenImageIO/imageoutput.cpp src/libOpenImageIO/imageioplugin.cpp
ImageBuf Processing Stack: Shows the three storage modes and how ImageBufAlgo operations use the ImageBuf API.
The processing subsystem consists of:
ImageBuf (src/include/OpenImageIO/imagebuf.h): In-memory image container with three storage modesImageBufAlgo namespace (src/include/OpenImageIO/imagebufalgo.h): Over 100 image processing operations
Sources: src/include/OpenImageIO/imagebuf.h src/include/OpenImageIO/imagebufalgo.h src/libOpenImageIO/imagebuf.cpp
The caching subsystem provides memory-efficient access to large image datasets:
ImageCache Architecture:
Two-Level Caching Architecture: Per-thread microcaches for immediate re-access, global sharded tile cache for sharing across threads.
ImageCache (src/include/OpenImageIO/imagecache.h): Tile-based cache with two-level architecture
TextureSystem (src/include/OpenImageIO/texture.h): Built on ImageCache, adds filtered lookups
Sources: src/include/OpenImageIO/imagecache.h src/include/OpenImageIO/texture.h src/libOpenImageIO/imagecache.cpp
| Tool | Executable | Primary Source | Purpose |
|---|---|---|---|
| oiiotool | oiiotool | src/oiiotool/oiiotool.cpp | Swiss Army knife for image processing |
| iv | iv | src/iv/imageviewer.cpp | Interactive image viewer |
| maketx | maketx | src/maketx/maketx.cpp | Generate optimized texture files |
| iinfo | iinfo | src/iinfo/iinfo.cpp | Display image metadata |
| iconvert | iconvert | src/iconvert/iconvert.cpp | Simple format conversion |
| idiff | idiff | src/idiff/idiff.cpp | Compare images |
| igrep | igrep | src/igrep/igrep.cpp | Search image metadata |
oiiotool Execution Model: Stack-based processing where images are pushed onto a stack and operations manipulate the stack. Operations are represented by OiiotoolOp subclasses.
Sources: src/oiiotool/ src/iv/ src/maketx/ README.md47-53
OpenImageIO provides cross-cutting utility systems used throughout the codebase:
| Utility | Header | Purpose | Key Classes/Functions |
|---|---|---|---|
| String Management | string.h ustring.h | String operations, unique string interning | ustring, Strutil namespace |
| SIMD | simd.h fmath.h | Vectorized operations | vfloat4/8/16, vint4/8/16 |
| Type System | typedesc.h | Runtime type information | TypeDesc |
| Memory Views | span.h image_span.h | Safe memory access | span<T>, image_span<T> |
| Threading | thread.h | Thread management | thread_pool, spin_mutex |
| Platform | platform.h | CPU feature detection | cpu_has_avx(), etc. |
Sources: src/include/OpenImageIO/ src/libutil/
OpenImageIO supports 20+ image formats through its plugin architecture. High-priority formats (importance 432.75 from architecture analysis):
Core Formats:
Additional Formats: PNG, WebP, DPX, Cineon, JPEG-2000, JPEG XL, HEIF/HEIC/AVIF, GIF, BMP, Targa, SGI, IFF, RLA, DDS, PSD, HDR/RGBE, ICO, PNM, FITS, OpenVDB, Ptex, Camera RAW formats, Video (FFmpeg)
Each format plugin is a separate shared library (.imageio.so or .imageio.dll) that implements the ImageInput and/or ImageOutput interfaces.
Sources: src/libOpenImageIO/imageioplugin.cpp255-443 README.md39-45
OpenImageIO is designed for multi-threaded operation:
OIIO::attribute("threads", n) src/libOpenImageIO/imageio.cpp354-360std::recursive_mutex for top-level locking src/libOpenImageIO/imageinput.cpp44spin_mutex for hot paths src/include/OpenImageIO/thread.hThread-Local State: Error messages are stored per-thread to avoid contention src/libOpenImageIO/imageinput.cpp31-32 src/libOpenImageIO/imageoutput.cpp34-35
Sources: src/libOpenImageIO/imageio.cpp29-68 src/libOpenImageIO/imageinput.cpp30-54 src/include/OpenImageIO/thread.h
Global behavior is controlled via OIIO::attribute() and OIIO::getattribute():
Global Configuration System: Applications set behavior via attribute system.
Key attributes:
"threads": Number of threads for parallel operations"plugin_searchpath": Directories to search for format plugins"limits:channels", "limits:imagesize_MB": Safety limits"debug", "log_times": Diagnostic output control"missingcolor": Default color for missing tilesSources: src/libOpenImageIO/imageio.cpp333-463 src/libOpenImageIO/imageio.cpp482-718
OpenImageIO uses CMake for building:
The project supports EMBED_PLUGINS mode where all plugins are built directly into the main library src/libOpenImageIO/imageioplugin.cpp255-310 or as separate shared libraries for dynamic loading.
Sources: CMakeLists.txt INSTALL.md src/cmake/
OpenImageIO uses thread-local error message storage to avoid contention:
errorfmt() methods on each classgeterror() methodsOIIO::geterror() src/libOpenImageIO/imageio.cpp308-312Sources: src/libOpenImageIO/imageio.cpp293-312 src/libOpenImageIO/imageinput.cpp30-99 src/libOpenImageIO/imageoutput.cpp33-101
Sources: README.md74-93 CONTRIBUTING.md73-119 docs/dev/RELEASING.md39-53 CREDITS.md1-258
For detailed information about specific subsystems:
Sources: This entire document synthesizes information from README.md CHANGES.md src/include/OpenImageIO/ src/libOpenImageIO/ and supporting documentation.
Refresh this wiki
This wiki was recently refreshed. Please wait 5 days to refresh again.