Image Processing & Conversion via Open Source C++ API

Read, Write & Convert Popular Image Formats Like PNG, JPEG, BMP, TIFF & many more via Free C++ Library.

 

OpenImageIO is a powerful image processing library gives software developers the ability to read, write and process popular image file formats inside C++ applications. It provides support for several popular image formats through plugins. It provides support for popular image formats like OpenEXR, TIFF, JPEG/JFIF, PNG, BMP, JPEG-2000, ICO, PNM, DPX, IFF, Field3D, Ptex, Photoshop PSD, GIF & several more.

OpenImageIO library is widely used in the animation and VFX studios all over the world and is also integrated into numerous commercial products. OpenImageIO library comes with several command-line image tools that demonstrate features like converting image formats to others, compare two images, print detailed information, search images for match metadata, simple image viewer, and more.

Getting Started with OpenImageIO

You need to have C++11 and above for running the project smoothly. The code is hosted on GitHub and you can easily download it.

OpenImageIO build system is based upon CMake. If need to install it on your system.  After you build OpenImageIO, if you compiled with the EMBEDPLUGINS=0 flag you will need to set the environment variable OIIO_LIBRARY_PATH to point to the 'lib' directory where OpenImageIO is installed, or else it will not be able to find the plugins.

Install OpenImageIO via git command

 git clone https://github.com/OpenImageIO/oiio.git 

Reading and Writing images via C++ API

OpenImageIO library allows programmers to read & write images as well as control the way that later images will be externally produced in the output. Normally, all images read by the library are read into an ImageBuf backed by an underlying ImageCache, and are automatically converted to float pixels for inner storage.  While writing images, it just outputs the current image to the named file. The image processing library does not remove the present image from the image stack; it simply saves a copy of it.

Converting Image to other Formats

OpenImageIO library provides features for converting images to other popular file formats.  It is very easy to convert among supported image formats. The iconvert utility will read an image and then write the image to a new supported file format.  It will simply infer the file format from the file extension. You can include an image caption, description, keywords, or metadata.

Change Image Metadata via C++

OpenImageIO API enables software developers to change current image metadata inside their own C++ applications via open source API.   It provides commands that modify the metadata of the existing image, but do not change its pixel values. The good thing is that only the current image (image at the top of the stack) is affected, but not down the stack. You can also add or clear keywords, add caption or description, Removes any metadata and more.