Closed confile closed 10 years ago
I tested KineticJS 5.10 with an svg image:
var stage = new Kinetic.Stage({ container: 'container', width: 400, height: 400 }); var layer = new Kinetic.Layer(); stage.add(layer); var img=new Image(); img.onload = function () { var image = new Kinetic.Image({ image: img, width: 100, height: 100, }); layer.add(image); layer.draw(); } img.crossOrigin="anonymous"; img.src = "https://dl.dropboxusercontent.com/u/139992952/stackoverflow/rocket.svg";
After that I downscale the image (keeping the aspect ratio):
image.scale({ x: 30, y: 30 }); layer.draw();
After that I exported the stage as a jpeg image with quality 1.0:
stage.toDataURL({ mimeType: "image/jpeg", quality: 1.0, callback: function(dataUrl) { // save image dataUrl to file } });
It turns out that the quality of the svg image is very bad only if you downscale it. When you increase the size the quality does not change.
I made a demo here: http://jsfiddle.net/confile/p6Eey/
As you can see in the exported image the edges are very crispy and not very sharp.
http://stackoverflow.com/a/23787397/512042
I tested KineticJS 5.10 with an svg image:
After that I downscale the image (keeping the aspect ratio):
After that I exported the stage as a jpeg image with quality 1.0:
It turns out that the quality of the svg image is very bad only if you downscale it. When you increase the size the quality does not change.