Description
Bug report
Describe the bug
When rotating images using Vips with nearest neighbour interpolation the result has inconsistencies.
This is especially obvious when rotating symmetrical pixel art.
To Reproduce
Steps to reproduce the behavior:
- Use Image of ladder at bottom
- Use Configuration interpolate: nearest and rotate 45 degrees
- See error
Or with the Ruby binding:
ladder = Vips::Image.new_from_file "./ladder.png"
rotated = ladder.rotate 45, interpolate: Vips::Interpolate.new(:nearest)
rotated.write_to_file "./rotated.png"
Expected behavior
Of course nearest neighbour produces artefacts, but I expect them to be symmetrical when the image being rotated is symmetrical.
Actual behavior
There are various discrepancies throughout.
Screenshots
Environment
- OS: macOS 12.4 (21F79)
- vips-8.12.2-Tue Jan 25 09:34:32 UTC 2022
Additional context
ImageMagick produces symmetrical results when using nearest neighbour. However when using "integer" it produces results more like Vips:
Original ladder image:
Or if theres a different way to rotate 1 bit pixel art I'd love to know :)