Your result will depend on the resampling method used by your particular browser. This is a "fuzzy" image interpolation, which is usually preferable for photographic content, but not so good for graphics or sharp-edged content. A common algorithm is bilinear interpolation, which is used by default in Firefox.
While there are no standard APIs to control which method is used, Firefox provides a property image-renderingin CSS.
https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering
Webkit -webkit-optimize-contrast.
.