Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a round-up option to shrink #1512

Closed
jcupitt opened this issue Jan 3, 2020 · 0 comments
Closed

add a round-up option to shrink #1512

jcupitt opened this issue Jan 3, 2020 · 0 comments

Comments

@jcupitt
Copy link
Member

jcupitt commented Jan 3, 2020

resize does shrink for the int part, then reduce for any fractional residual.

The shrink stage rounds image dimensions to the nearest pixel, so it can trim up to 0.5 px from the right and bottom edge. This means that the second reduce phase can have some missing information compared to operating directly on the unshrunk image.

As an improvement, resize could request round-up from shrink, and then pick a scale factor for reduce that still gave the correct sized output, but no longer lost the 0.5px of information in the intermediate.

See libvips/pyvips#148 for the original context.

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

1 participant