Expose :interpolate and route :background through Image.Pixel.to_pixel/2 in Image.rotate/3#204
Merged
kipcole9 merged 3 commits intoJun 30, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Image.rotate/3now exposes:interpolate(:nearest,:bilinear(default),:bicubic,:lbb,:nohalo,:vsqbs), resolved to aVix.Vips.InterpolateviaImage.Options.Rotate. It has no effect on rotations by a multiple of 90, which copy source pixels directly.:backgroundnow accepts all validImage.Pixel.to_pixel/2values, or:average, matchingImage.affine/3. Previously it only accepted a bare numeric list and could not express RGBA. Default is kept as libvips' native default (transparent on alpha images, opaque black otherwise).Image.Options.Rotate.invalid_option/1now returns an%Image.Error{}- is this ok to just switch, or would you rather I kept that out?Docs:
## Partially-transparent backgroundssection. A fully opaque or fully transparent:backgroundis reproduced exactly, while a partially transparent one is scaled bymax / alphabecause libvips injects the fill into premultiplied-alpha space and unpremultiplies on output. For an exact partial-alpha fill, the section documents a rotate over transparent thenImage.compose/2recipe.## Displacementssection reusing the affine wording for:idx/:idy/:odx/:ody.A PR that changes
Image.affine/3to use libvips native default (probably the expected behaviour) instead of explicit:blackas the default (+ a note about the alpha background caveat) is coming up. Missed these nuances in the original affine PR.