Bird’s eye view on ImageIO
The aim of this page is to give you a high level overview of how ImageIO works under the hood. We think this is useful for two reasons:
If something doesn’t work as it should, you need to know where to search for causes. The overview on this page aims to help you in this regard by giving you an idea of how things work, and - hence - where things may go sideways.
If you do find a bug and decide to report it, this page helps us establish some joint vocabulary so that we can quickly get onto the same page, figure out what’s broken, and how to fix it.
Terminology
You can think of ImageIO in three parts that work in sequence in order to load an image.
- ImageIO Core
The user-facing APIs (legacy + v3) and a plugin manager. You send requests to iio.core and it uses a set of plugins (see below) to figure out which backend (see below) to use to fulfill your request. It does so by (intelligently) searching a matching plugin, or by sending the request to the plugin you specified explicitly.
- Plugin
A backend-facing adapter/wrapper that responds to a request from iio.core. It can convert a request that comes from iio.core into a sequence of instructions for the backend that fulfill the request (eg., read/write/iter). A plugin is also aware if its backend is or isn’t installed and handles this case appropriately, e.g., it deactivates itself if the backend isn’t present.
- Backend Library
A (potentially 3d party) library that can read and/or write images or image-like objects (videos, etc.). Every backend is optional, so it is up to you to decide which backends to install depending on your needs. Examples for backends are pillow, tifffile, or ffmpeg.