Clone wiki

pngxx / why_another_library

Why another C++ library to handle JPEG/PNG images?

I decided to create my own C++ wrappers for JPEG and PNG input/output for a number of reasons.

jpegxx and pngxx:

  1. are exception safe.
  2. can read from and write to any image container. You don't have to use a library-specific image class as an intermediate location before copying the data in to your own image object.
  3. integrate well with the C++ standard library and use modern C++ idioms
  4. are distributed under a very liberal license, making them useful for commercial and open source applications.

The existing libraries fall down in one or more of these areas.

It is also common to see many image I/O libraries that handle a variety of formats, collected together and bundled under a thin wrapper as a single "umbrella library".

I am not a fan of this monolithic approach; you can download and use pngxx without going anywhere near jpegxx and vice versa.

Updated