You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
resize
doesshrink
for the int part, thenreduce
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 secondreduce
phase can have some missing information compared to operating directly on the unshrunk image.As an improvement,
resize
could request round-up fromshrink
, and then pick a scale factor forreduce
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.
The text was updated successfully, but these errors were encountered: