All formats

PNG libraries

Open-source libraries that decode and encode PNG files. Most languages have PNG support in the standard library or in one dominant image library; pick a dedicated PNG library when you need PNG-specific control (text chunks, bit depth, palettes, APNG frames, streaming row by row).

Language Library Read Write Notes
C/C++ libpng yes yes reference implementation, every PNG feature
C/C++ libspng yes yes simpler and faster libpng alternative
C/C++ LodePNG yes yes single file, no dependencies (has its own zlib)
C/C++ stb_image yes yes single header, public domain, many formats
C# ImageSharp yes yes pure managed code, cross-platform
C# SkiaSharp yes yes wrapper of Google’s Skia, fast drawing
C# Magick.NET yes yes ImageMagick for .NET, 100+ formats
Java ImageIO yes yes built into the JDK
Java PNGJ yes yes row by row, low memory, full chunk access
Go image/png yes yes standard library
Go imaging yes yes resize, crop, rotate on top of image/png
Python Pillow yes yes the standard Python imaging library
Python pypng yes yes pure Python, all bit depths
Python OpenCV yes yes images as NumPy arrays
Ruby ChunkyPNG yes yes pure Ruby
Ruby ruby-vips yes yes fast, low memory, libvips binding
Ruby MiniMagick yes yes wraps ImageMagick command line
Rust png yes yes pure Rust, used by the image crate
Rust image yes yes high-level, many formats
PHP GD yes yes bundled with PHP
PHP Imagick yes yes ImageMagick extension
PHP Intervention Image yes yes fluent API over GD or Imagick

By language#