unjs / ipx

🖼️ High performance, secure and easy-to-use image optimizer.
MIT License
1.87k stars 63 forks source link

Support `kernel` option in resize #142

Closed kyranet closed 1 year ago

kyranet commented 1 year ago

Describe the feature

Right now, the library defines three options (out of many):

https://github.com/unjs/ipx/blob/b912370e54d1932e9d1c39c479a458203aaa0c7f/src/handlers/handlers.ts#L98-L102

The kernel option allows us to set one of nearest, cubic, mitchell, lanczos2, and lanczos3, which by default uses the last one. However, for pixel art, this is far from ideal, as it blurs the pixels.

Additional information