scottcheng / cropit

A "customizable crop and zoom" jQuery plugin.
http://scottcheng.github.io/cropit/
MIT License
874 stars 304 forks source link

Improve export image quality #133

Open pensierinmusica opened 8 years ago

pensierinmusica commented 8 years ago

Hi,

Great plugin, thanks for developing it!

The only issue I have so far is that heavy canvas resizing (for example to generate thumbnails) degrades image quality way too much:

http://stackoverflow.com/questions/17861447/html5-canvas-drawimage-how-to-apply-antialiasing

Imho resizing could be better handled by including a library like Pica.

Thoughts? Cheers!

pensierinmusica commented 8 years ago

I just noticed now that you actually included a pica demo in the repo already. It makes a lot of sense in terms of image quality! Why not making pica part of cropit directly then, as a bower dependency, and include it in the standard export process?

If you're worried about export time / computation, the pica process could be optional with an antialiasing boolean in the export settings.

Thoughts?

scottcheng commented 8 years ago

Thanks for the suggestion. I am in general reluctant to include third-party libraries as dependencies. In this case I would like to make cropit a more pure and customizable cropping interface, and if you want you can send the cropping parameters to your server and crop it there instead of in the browser.

That said, we could make pica an optional dependency, so people can enable it by passing something like { pica: true } into cropit, and install pica separately to make it work.

pensierinmusica commented 8 years ago

@scottcheng yep, I'd love that :)

rickerd commented 8 years ago

Relaying on 3rd parties for your plugin, i would just do it. Why inventing it all over again. For the crop i would love to do it in the browser, why should my server so all the work if the browser is so smart and could do all the hard work.

Anyway, the pica option would be cool.