Well, you probably want to use ImageMagick or GD . But keep in mind that you cannot convert from PNG / JPEG / BMP to SVG, which is a one-way street.
Edit: development
Converting an SVG (vector) image to a PNG (raster) image is trivial. ImageMagick can do this for sure, and I'm pretty sure GD should be able to. If not, there are also PHP bindings for rsvg.
Converting PNG (bitmap) to SVG (vector), on the other hand, is a whole problem. The core of the problem is that the bitmap quite simply contains less information than the vector image: information about the shapes, lines and structure, in particular, is smoothed to the pixel vertex and irretrievably lost. In some cases, this information may be recovered, but will never be recovered or rediscovered.
Vectorization is just a method of creating a new vector image based on a raster image when the computer tries to detect lines and shapes. This problem is far from trivial, and this process, of course, is not ideal and is not even reliable in automated configuration.
Only John Skeet can convert PNG to SVG.
Reedit: Auto Tracing and Personal Experience
Some time ago, I really worked a bit on tracing a bitmap to prototype a small web application ( find it here, MNSFW, it requires FFx / Safari / Opera ). The vector was created using potrace to repeatedly track the threshold black and white image to select elements and then reconstruct the image manually. It was a grueling process, but at that time I did not work and had nothing better.
Point: automatic tracing of raster images to create vector images at best is hits and misses, and to get good results reliably requires
- Good source image
- A lot of effort
Williham Totland
source share