Image version 0.67.0
Enhancements
-
Adds
Image.vignette/2. -
Adds
Image.Palette.extract/2— perceptual palette extraction from an image via K-means in Oklab plus theColor.Palette.Clustermerge / phantom-guard / centroid-aware-rep pipeline (requires:scholarand:nx). -
Adds
Image.gamma/2— per-band gamma curve adjustment (wrapsVix.Vips.Operation.gamma/2). -
Adds
Image.sepia/2— single-pass sepia tone via a 3×3 colour-recombination matrix; accepts a0.0..1.0strength that blends the matrix with the identity (matching imgix'ssepia=Npercentage). -
Adds
Image.posterize/2— quantises each band to2..256evenly-spaced levels for a flat-shaded, comic-strip rendering. -
Adds
Image.opacity/2— multiplies the alpha band by a0.0..1.0factor; 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 withImage.open/2's defaultautorotate: falsefor full caller control over orientation; matches imgix'sor=N). -
Adds
:lossyand:chroma_subsamplingoptions toImage.write/3.:lossy(boolean) toggles the lossless wire format on WebP / AVIF and palette-quantisation on PNG.:chroma_subsamplingselects: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 imgixmonochrome=#hex/ ImageKite-monochromefamily 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:lengthas either pixels or a fraction of the relevant dimension. Used for Cloudinarye_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 ImageKite-shadowand Cloudinarye_shadow. -
Adds
Image.minimize_metadata/2with a:keepoption — 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 passkeep: [: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:saturationand:sharpen_sigmaoptions. -
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.iccfile viaImage.ICCProfile.known?/1validation. Options::input_profile,:intent(:relative/:perceptual/:saturation/:absolute), and:depth(8/16). WrapsVix.Vips.Operation.icc_transform/3.
Removed
Image.QRcodeis removed. QR encoding and decoding move to the siblingimage_qrcodepackage, which is built on Nayuki's QR-Code-generator +quircand does not depend on:evision. Migration: replaceImage.QRcode.encode/2/Image.QRcode.decode/1withImage.QRCode.encode/2/Image.QRCode.decode/1(note the capital "C") and add{:image_qrcode, "~> 0.1"}to your deps. TheImage.to_evision/2andImage.from_evision/1interop helpers are unchanged.
Bug Fixes
Image.add_alpha/2's:opaqueand:transparentatoms 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.