Corner-preserving resampling