Image version 0.70.0
Added
-
Adds
Image.Lqip.Cssto encode an image as a packed LQIP CSS placeholder value, with a new guide including the copy-and-paste stylesheet. Thanks to @hlindset for the PR. -
Adds
Image.BackgroundColorto resolve background color specifications (including:average) into concrete pixels; used byImage.rotate/3, affine and warp operations. Thanks to @hlindset for the PRs. -
Adds
:backgroundcolor resolution toImage.write/3so alpha images flatten onto a resolved background when writing to formats without alpha. Thanks to @hlindset for the PR. -
Adds
Image.YUV.valid_encodings/0andImage.YUV.valid_colorspaces/0.
Changed
-
Image.average/1now weights the average by the alpha band so transparent pixels do not contribute; fully transparent images fall back to the unweighted color-band average, and float-format images return unrounded averages. -
All validation and libvips errors are now returned as
{:error, %Image.Error{}}ast:Image.error/0documents; previously many paths returned bare strings. -
Image.to_nx/2withshape: :whcnow performs a true transpose;Image.from_nx/1interprets unnamed tensors as{height, width, bands}and narrows 64-bit integer tensors to 32 bits. -
Image.circle/2center-crops non-square images and merges an existing alpha band instead of adding a second one. -
Image.embed/4honors:mirror/:repeat/:copyextend modes and explicit background colors on images with an alpha band. -
Image.compose/3with a composition list applies top-level options as per-entry defaults instead of ignoring them. -
Image.join/2accepts the documented:topand:centeralignment values.
Fixed
-
Fix the alpha scale for
:lab,:lchand:labsinterpretations inImage.Pixel.to_pixel/3— opaque alpha is255, matching libvips. Thanks to @hlindset for the PR. -
Fix
Image.Math.divide/2for two numbers (it previously subtracted) andImage.dominant_color/2black-bin correction for alpha images. -
Fix
Image.Drawfunctions on greyscale and CMYK images,Image.Shape.line/5end coordinate, andImage.Shape.star/2accepting 3 points as documented. -
Fix crashes on malformed EXIF payloads, non-base83 blurhash input, GIF writes with
:effort, extensionless write paths, andImage.stream!/2with small:buffer_sizevalues. -
Fix
Image.YUVround trips for odd image dimensions andImage.trim/2with an explicit:backgroundon alpha images. -
Fix
Image.thumbnail!/3andImage.straighten_perspective/3error contracts,Image.from_req_stream/2timeout handling, andImage.equalize/2on constant-color bands. -
Fix
Image.write/3to at:File.Stream.t/0to infer the image type from the stream path's file extension when no:suffixoption is given.