Ragex.Image (Ragex v0.30.0)

View Source

Core image manipulation functions backed by the Image library (Vix/libvips).

Summary

Functions

Apply visual filters / enhancements.

Returns true when the optional :image dependency is compiled and loadable.

Generate a circular, squircle, or square avatar image.

Compare two images for visual diff/similarity.

Composite (overlay) an image on top of a base image.

Convert image format (e.g. PNG, JPEG, WebP, AVIF, TIFF, GIF).

Crop an image by bounding box or auto-trim.

Get detailed information and metadata for an image file.

Resize an image by scale factor, width/height dimensions, or crop focus.

Rotate or flip an image.

Functions

apply_filter(path, filter_name, opts \\ [])

Apply visual filters / enhancements.

available?()

@spec available?() :: boolean()

Returns true when the optional :image dependency is compiled and loadable.

:image is a native/NIF-backed dependency (Vix/libvips) that cannot be loaded from inside an escript archive, so callers embedding Ragex as a library should check this before relying on image-processing features.

avatar(path, output_path, opts \\ [])

Generate a circular, squircle, or square avatar image.

compare(image_a_path, image_b_path, opts \\ [])

Compare two images for visual diff/similarity.

composite(base_path, overlay_path, output_path, opts \\ [])

Composite (overlay) an image on top of a base image.

convert(path, output_path, opts \\ [])

Convert image format (e.g. PNG, JPEG, WebP, AVIF, TIFF, GIF).

crop(path, opts)

Crop an image by bounding box or auto-trim.

draw_text(path, output_path, text, opts \\ [])

Render text onto an image.

info(path)

Get detailed information and metadata for an image file.

resize(path, opts)

Resize an image by scale factor, width/height dimensions, or crop focus.

rotate(path, opts)

Rotate or flip an image.