Bad Image Quality on Scaled Down Image

The image in <canvas> appears to be bad quality when we scale it down. Apparently it is due to linear interpolation algorithm used by the browser because it is fast.

I also learn that scaling down requires resampling while scaling up requires interpolation.

Searching online, I found pixel perfect resampling algorithm.

http://stackoverflow.com/questions/18922880/html5-canvas-resize-downscale-image-high-quality

I thus ran the image over the algorithm before having the canvas redraw it. It is a good stuff and improve the quality of the image.

Comments

Popular posts from this blog

AWS EC2 Can't Reach EC2 Metadata Service After Subnet Change

A2 Hosting with .NET Core 2.1

Xcode CodeSign Incorrectly States Password is Incorrect