Announcing CrImage - Pure Crystal Image Processing Library

I’m excited to share CrImage, a comprehensive image processing library written entirely in Crystal with zero external dependencies.

What is it?

A complete image toolkit that handles everything from basic format conversion to advanced effects, text rendering, and even QR code generation — all in pure Crystal.

Features

Formats: PNG, JPEG, GIF (animated!), BMP, TIFF, WebP, ICO

Drawing: Lines, circles, polygons, Bézier curves, gradients, anti-aliased rendering, chart helpers

Transforms: Resize (nearest/bilinear/bicubic/lanczos), rotate, crop, flip

Filters & Effects: Blur, sharpen, edge detection, sepia, vignette, temperature adjustment

Text Rendering: Built-in TrueType/OpenType/WOFF font engine with kerning and ligatures — no FreeType needed

Utilities: QR codes, blurhash, smart crop, watermarks, thumbnails, EXIF reading, image comparison (SSIM/PSNR)

Security: Decompression bomb protection built-in

Quick taste

require "crimage"

img = CrImage.read("photo.jpg")
    .resize(800, 600, method: :lanczos)
    .brightness(10)
    .sepia

CrImage::PNG.write("vintage.png", img)

# Generate a QR code
qr = CrImage.qr_code("https://crystal-lang.org")
CrImage::PNG.write("qr.png", qr)

10 Likes

Wow, this looks very useful. And it’s a huge project! :heart_eyes:
Doing all of this with zero dependencies requires lots of homemade implementations.
Congrats on writing such a big codebase :tada:

Thanks @straight-shoota , I had been working on it on and off since past 2+ years.

This is awesome, a few days ago I was wondering if there was a good image library without fooling around with image magick. Will for sure keep this in mind whenever I get that next project with image manipulation.

2 Likes

Awesome! I expect I will be using this in half a dozen projects in the next week :slight_smile:

1 Like