I am displaying images using fabricjs and enabled zooming using fabrics
myFabric.zoomToPoint({ x: x, y: y }, newZoom);
the problem is that when I zoom in the pixels are getting blurred instead of being kept 'sharp'\'separated' from one another.
zoomed out:

zoomed in:

There is an imageSmoothingEnabled option you can pass at the creation of your fabric's Canvas :
var canvas = new fabric.Canvas('a', {
imageSmoothingEnabled: false // here you go
});
fabric.Image.fromURL("https://i.sstatic.net/dQRkt.png", function(img) {
canvas.add(img);
canvas.zoomToPoint({x: 50, y: 50}, 120);
});
<script src="https://rawgit.com/kangax/fabric.js/master/dist/fabric.js"></script>
<canvas id="a" height="380" width="250"></canvas>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With