Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Crystal
  3. stumpy_png

stumpy_png

MITCrystal

A pure Crystal library for reading and writing PNG images with support for various color types, filters, and interlacing.

GitHubGitHub
108 stars21 forks0 contributors

What is stumpy_png?

stumpy_png is a Crystal library for reading and writing PNG image files entirely in Crystal without external dependencies. It provides a Canvas-based API for manipulating image data and supports various PNG features like different color types, filters, and interlacing. The library solves the need for native PNG handling in Crystal applications, avoiding reliance on system libraries or bindings.

Target Audience

Crystal developers who need to process PNG images in their applications, such as those building graphics tools, image servers, or data visualization projects. It's particularly useful for projects requiring pure Crystal implementations without external C dependencies.

Value Proposition

Developers choose stumpy_png because it's a pure Crystal implementation with no external dependencies, offers a clean and intuitive API, and fully supports the PNG specification including advanced features like 16-bit depth and Adam7 interlacing. It integrates seamlessly with the stumpy_core library for consistent image manipulation.

Overview

Read/Write PNG images in pure Crystal

Use Cases

Best For

  • Processing PNG images in Crystal web applications
  • Building command-line image conversion tools in Crystal
  • Creating graphics or visualization libraries in Crystal
  • Developing image servers or CDNs with Crystal backends
  • Educational projects teaching PNG format implementation
  • Embedding PNG support in Crystal-based games or multimedia apps

Not Ideal For

  • Projects requiring full PNG metadata support (e.g., text annotations, gamma correction)
  • High-throughput image processing servers needing GPU acceleration or multi-threading optimizations
  • Applications that handle multiple image formats beyond PNG without additional libraries
  • Environments where system dependencies like zlib are difficult to install, such as in tightly restricted containers

Pros & Cons

Pros

Pure Crystal Implementation

Written entirely in Crystal without external bindings, ensuring portability and avoiding reliance on C libraries, except for zlib which is a minimal system dependency.

Comprehensive PNG Compliance

Supports all standard PNG features including color types, filter methods, interlacing, and 8/16-bit depths, as detailed in the README's feature checklist.

Clean and Intuitive API

Offers straightforward read/write methods with configurable parameters like bit depth and color type, making basic image operations simple to implement.

stumpy_core Integration

Seamlessly uses Canvas and RGBA types from stumpy_core, providing a consistent interface for pixel-level manipulation across the stumpy ecosystem.

Cons

Missing Ancillary Chunk Support

Explicitly does not handle PNG ancillary chunks, limiting the ability to read or write metadata such as text comments or color profiles, as admitted in the README.

Performance Trade-offs

As a pure Crystal library, it may not match the speed of optimized C-based alternatives for processing very large or numerous images, lacking GPU or advanced multi-threading features.

External zlib Dependency

Requires zlib to be installed on the system, which can cause setup issues in some environments, as highlighted in the troubleshooting section.

Frequently Asked Questions

Quick Stats

Stars108
Forks21
Contributors0
Open Issues2
Last commit2 years ago
CreatedSince 2016

Tags

#png#graphics#crystal-lang#file-format#shard#crystal#image-processing#image-manipulation

Built With

C
Crystal

Included in

Crystal3.5k
Auto-fetched 16 hours ago

Related Projects

celestinecelestine

An SVG library written in Crystal. Can be used to make cool animations, as well as other kinds of uses.

Stars95
Forks10
Last commit2 years ago
PlutoPluto

A fast and convenient image processing library

Stars74
Forks6
Last commit1 year ago
ffmpegffmpeg

ffmpeg crystal bindings

Stars22
Forks1
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub