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)