pressly / imgry

On-demand image sizing+delivery for responsive applications
MIT License
157 stars 15 forks source link

Use different resize filters for shrinking and enlarging #37

Closed c2h5oh closed 7 years ago

c2h5oh commented 7 years ago

Basic Lanczos is a bit soft for both shrinking and enlarging. Sharp variant fares significanlty better when shrinking, but has even more ringing than basic, which is especially visibie when enlarging high-contrast images. To not have to deal with the problem use Mitchell-Netravali filter for enlarging instead as it is a reasonable compromise between artifacting and sharpness with little distortion.

Possible future improvements: factor bits per color and contrast when selecting resize filter