disintegration / imaging

Imaging is a simple image processing package for Go
MIT License
5.28k stars 440 forks source link

Resize after Crop in function Fill for a better performance #83

Closed fangli closed 5 years ago

fangli commented 5 years ago

After took a look at: https://github.com/disintegration/imaging/blob/9458da53d1e65e098d48467a4317c403327e4424/resize.go#L273

I found that crop comes after resize in function Fill. I think in the majority of cases the crop are much faster than resize. If we crop a big image to small one, then resize the small one, it might be slightly faster, since crop is image size irrelevant but resize is.

I don't get a chance to benchmark at this moment, maybe it's worth trying?

disintegration commented 5 years ago

I think it's a good idea! Definitely worth trying.

disintegration commented 5 years ago

Implemented in #84