nodeca / pica

Resize image in browser with high quality and high speed

Home Page:http://nodeca.github.io/pica/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Offer option to resize to maximum width or height

panabee opened this issue · comments

Thanks for this amazing software.

Preserving quality is essential when resizing our images, so we are interested in using this.

Have you considered a feature where people don't specify a destination canvas, but instead define the target dimensions (including a max width or max height) and receive a promise result?

This would be useful because users don't need separate operations to (1) ascertain the source image size; (2) compute destination size while preserving aspect ratio; and (3) create a separate canavs element.

Ideally, it would work similar to https://github.com/calvintwr/blitz-hermite-resize:

blitz({
    source: DOM Image/DOM Canvas/jQuery/DataURL/File,
    width: 400,
    height: 600
}).then(output => {
    // handle output
}).catch(error => {
    // handle error
})

I'm not interested to mix high level and low level apis in single package. For files there is https://github.com/nodeca/image-blob-reduce.

Thanks so much for the quick reply! Will try it out.