Skip to content

Image version 0.67.0

Choose a tag to compare

@kipcole9 kipcole9 released this 03 May 01:10
· 7 commits to main since this release

Enhancements

  • Adds Image.vignette/2.

  • Adds Image.Palette.extract/2 — perceptual palette extraction from an image via K-means in Oklab plus the Color.Palette.Cluster merge / phantom-guard / centroid-aware-rep pipeline (requires :scholar and :nx).

  • Adds Image.gamma/2 — per-band gamma curve adjustment (wraps Vix.Vips.Operation.gamma/2).

  • Adds Image.sepia/2 — single-pass sepia tone via a 3×3 colour-recombination matrix; accepts a 0.0..1.0 strength that blends the matrix with the identity (matching imgix's sepia=N percentage).

  • Adds Image.posterize/2 — quantises each band to 2..256 evenly-spaced levels for a flat-shaded, comic-strip rendering.

  • Adds Image.opacity/2 — multiplies the alpha band by a 0.0..1.0 factor; adds an opaque alpha band first when the input has none.

  • Adds Image.set_orientation/2 — overrides the EXIF orientation tag without rotating the underlying pixels (paired with Image.open/2's default autorotate: false for full caller control over orientation; matches imgix's or=N).

  • Adds :lossy and :chroma_subsampling options to Image.write/3. :lossy (boolean) toggles the lossless wire format on WebP / AVIF and palette-quantisation on PNG. :chroma_subsampling selects :auto / :on (4:2:0) / :off (4:4:4) on JPEG and AVIF.

  • Adds Image.tint/2 — colour-tinted monochrome via a single 3×3 luminance + tint colour-recombination matrix. Used for the imgix monochrome=#hex / ImageKit e-monochrome family of CDN options.

  • Adds Image.fade/2 — alpha-gradient fade-out on one or more edges via SVG <linearGradient> masks combined with a per-pixel min. Supports :top, :bottom, :left, :right, or :all, with :length as either pixels or a fraction of the relevant dimension. Used for Cloudinary e_fade.

  • Adds Image.drop_shadow/2 — soft drop shadow under the image's alpha-shaped silhouette. Composites a Gaussian-blurred, opacity-scaled, tinted copy of the alpha band beneath the original. Used for ImageKit e-shadow and Cloudinary e_shadow.

  • Adds Image.minimize_metadata/2 with a :keep option — caller-controlled list of EXIF fields to preserve when minimising metadata. The 1-arity variant continues to default to [:copyright, :artist]; the 2-arity variant lets callers pass keep: [:copyright] (preserve only copyright), keep: [] (strip everything), or any other subset.

  • Adds Image.enhance/2 — content-aware automatic enhancement composed of luminance equalisation + mild saturation boost + mild sharpen. Approximates the CDN-style "improve" / "auto-enhance" calls used by Cloudinary, imgix, and ImageKit. Tunable via :saturation and :sharpen_sigma options.

  • Adds Image.to_colorspace/3 — ICC-profile-driven colourspace conversion. Accepts the libvips built-in profile atoms (:srgb, :cmyk, :p3) or a path to an .icc file via Image.ICCProfile.known?/1 validation. Options: :input_profile, :intent (:relative / :perceptual / :saturation / :absolute), and :depth (8 / 16). Wraps Vix.Vips.Operation.icc_transform/3.

Removed

  • Image.QRcode is removed. QR encoding and decoding move to the sibling image_qrcode package, which is built on Nayuki's QR-Code-generator + quirc and does not depend on :evision. Migration: replace Image.QRcode.encode/2 / Image.QRcode.decode/1 with Image.QRCode.encode/2 / Image.QRCode.decode/1 (note the capital "C") and add {:image_qrcode, "~> 0.1"} to your deps. The Image.to_evision/2 and Image.from_evision/1 interop helpers are unchanged.

Bug Fixes

  • Image.add_alpha/2's :opaque and :transparent atoms now produce alpha = 255 and alpha = 0 respectively, matching the standard libvips / RGBA convention. The previous values were inverted relative to their names; integer values pass through unchanged.