1

I want to convert PNG files to SVG format with PHP and ImageMagick.

My PNG files background are transparent and colors are black. So there is an color shape (black). I used this code "convert a.png b.svg" on terminal but, converted file's size very big. (9 MB ~). My png's size is only 16 KB.

How Can I convert PNG to SVG with other method ?

[NOTE !]: I don't want to convert SVG to PNG !!!

Ex. My PNG file: enter image description here

s3yfullah
  • 165
  • 1
  • 6
  • 22
  • Oops, sorry about that! – Steve Oct 01 '14 at 12:36
  • 1
    I suggest you try using a tool like [AutoTrace](http://autotrace.sourceforge.net/) or [Delineate](http://delineate.sourceforge.net/). – r3mainer Oct 01 '14 at 13:23
  • I solved this problem ;) I used convert + potrace ;) – s3yfullah Oct 01 '14 at 17:38
  • @s3yfullah I am stuck with same issue. can you please share your code snippet. – Abhinav Kulshreshtha Aug 30 '15 at 11:13
  • @AbhinavKulshreshtha For this conversion you need to install ImageMagick and potrace. potrace can convert pbm/pgm/ppm/bmp to svg. So at first we need to convert png/jpg to pbm/pgm/ppm/bmp using imagemagick. Than we will convert it to svg using potrace via command line. https://github.com/IJmouri/raster-_images-png-jpg-_to_svg – Mouri May 24 '22 at 06:18

0 Answers0