Enhancement: composite with negative values for top and/or left
See original GitHub issueHello!
Is there a reason why negative values are not supported with top
and left
from within overlayWith? I am not familiar with how libvips work as well, so feel free to close this if this is something that is specifically not supported.
A use case for this is composing coordinate-based map images (such as a radar image on top of a static base map).
For example, a base map could be cropped like this:
The square outlines for this base map indicates the position of a 256x256 tile image. From this information, we can calculate the pixel position of where tile should go and place them where they belong. So the first tile could be at x:-44,y:-102, second would be x:212,y:-102, and so on.
Please let me know if I missed something from the docs or this isn’t something that is supported.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top GitHub Comments
sharp currently contains its own alpha blending logic, which will extend an overlay to match the dimensions of the image underneath before blending.
The work for #728 will involving the replacement of some of sharp’s alpha blending logic with libvips’ new
composite
operation. That task will probably be quite disruptive to the image compositing logic so I would recommend we wait for that before thinking about how to support overlays positioned (partly) outside the dimensions of the image underneath.I can definitely see the usefulness of this feature so thank you for suggesting it!
v0.27.0 is now available, thank you for the PRs to improve this feature!