How to rasterize svg to png without aliasing effect with "data:image/svg+xml" with Inkscape?

859 Views Asked by At


I have a problem while export svg to png with svg which includes some element image objects using Inkscape.

Example:

<image  xlink:href="data:image/svg+xml;base64,PD94bWwgdm....Zz4=" x="-312" y="-139" width="624" height="278"></image>


Notes:
- When I open svg in web browsers, when zoom in browser images are nice, and not have aliasing effect.
- But using Inkscape command :
/Applications/Inkscape.app/Contents/Resources/bin/inkscape /test/test.svg -e /test/test.png -d 300 --> image is aliasing.

Here is result on browser and output png file:
enter image description here

Here is my files:
1. https://drive.google.com/open?id=1Wjt-QnX4iPL3QYHfYLI7wVfq26yBCe3e --> svg file which include with svg data "data:image/svg+xml"
2. Exported png using inkscape with dpi 300
https://drive.google.com/open?id=1k171_ARwnw0-5iyM7vwJsH_h6tFWpb1v


Please help me!
Thank you!

1

There are 1 best solutions below

0
On
  1. Use a raster file that uses the correct export dpi
  2. Scale it to the correct size in Inkscape
  3. Position it at a full pixel value

(untested, but should work)

In (future) Inkscape 1.0, you can also uncheck the antialiasing functionality in the export dialog, but not sure how that affects raster images. It might not look good.