-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poor quality of resize (in all browsers I've seen) #23
Comments
Might be possible, however my current interest is not so much put on the quality and the changing requires works to balance the trade-offs (memory, processing time) for other users. You can folk the code and create your own to establish the quality-first MegaPixImage implementation, and if you found your achievement is to be shared to this library for other users, you can send me pull request, and hopefully I can merge it. |
I'm interested too... |
Some people suggested drawing 1/2 of the image, then 1/2 of the resized one and so on. However, it takes a lot of resources to accomplish that kind of transform. What you can do, is to resize to, say, 500px, which will produce pretty good quality image, and then set max-height of an img element to 200px or whatever your needs are. |
Canvas is speed-optimized and use "nearest neighbour" interpolation. You can't change that. Use https://github.com/nodeca/pica for resize, when you need high quality. It has lanczos3 filter, best for this task. |
Great work, thanks puzrin! |
Hi, I've noticed that the javascript canvas context's
drawImage
method does a really poor quality resize. There is a good stack-overflow article on the subject, with example images and an excellent solution in the accepted answer (i've tested it, it works :) )...http://stackoverflow.com/questions/18922880/html5-canvas-resize-downscale-image-high-quality
I wonder how easy it would be to use their
downScaleCanvas
method inside yourrenderImageToCanvas
method?The text was updated successfully, but these errors were encountered: