elixir-image/image

Image processing for Elixir

What it solves

Image processing in Elixir can be slow and cumbersome. This library provides a fast and memory-efficient solution by wrapping the libvips C library. It gives developers a clean, functional API to perform common image tasks like resizing, cropping, rotating, drawing, adding text, and reading metadata, without needing to manage low-level bindings or external processes.

How it works

Under the hood, Image uses Vix, which are Elixir bindings for libvips, a high-performance image processing library. This means operations are executed in C for speed and low memory usage. The API is designed to be idiomatic Elixir, using pipelines and returning tagged tuples. It also supports optional features like video frame extraction, QR codes, and machine learning, which are only compiled when the corresponding dependencies are added.

Who it's for

Elixir developers who need image processing in their applications, whether it's for thumbnails, image transformations, metadata extraction, or creating placeholders. It's suitable for web services, batch processing, or any project that requires fast and efficient image manipulation without pulling in heavy dependencies.

Highlights

  • Fast and memory-efficient: benchmarked 2-3x faster and uses ~5x less memory than Mogrify.
  • Comprehensive operations: resizing, cropping, blending, blurring, edge detection, and more.
  • Drawing and text: rectangles, circles, lines, and antialiased text with Pango markup.
  • Color management: supports many color spaces and CSS color syntax, converting to the target image's interpretation.
  • Metadata support: EXIF, XMP, and ICC profiles, with options to strip metadata.
  • Streaming: works with files, memory binaries, and Plug.Conn.
  • Optional integrations: video (FFmpeg), QR codes, machine learning, and more.

相关

  • 项目
  • 项目
  • 项目
  • 项目