Changed
-
Breaking: Unifies background handling under a single
:backgroundoption acrossImage.embed/4,Image.flatten/2,Image.join/2,Image.rotate/3and the affine family (Image.affine/3,Image.translate/4,Image.shear/4,Image.warp_perspective/4), replacing the previous:background_colorand:background_transparencyoptions. Set a transparent or semi-transparent fill by wrapping any color as{color, alpha: a}. Thanks to @hlindset for the PR. -
Breaking: An omitted or
nil:backgroundnow defers to libvips' native fill everywhere (transparent for alpha images, black otherwise, paper-white in CMYK), soImage.flatten/2with no background matches howImage.write/3flattens. PreviouslyImage.flatten/2and an alphaImage.embed/4defaulted to opaque black.
Removed
- Breaking: Removes the
:blackand:whiteextend modes fromImage.embed/4and narrows the affine-family:extend_modeto:background | :copy; combining a content extend mode with an explicit:backgroundnow errors. Use an explicit:backgroundcolor in place of the removed modes. Thanks to @hlindset for the PR.
Fixed
- Fix numeric array save options (for example
background: [0, 128, 0]) being silently dropped on:memoryand stream writes; the filename suffix joined array values with:rather than spaces, which libvips ignores. Thanks to @hlindset for the PR.