I have a client that needs text placed on a supplied vector graphic, and that text needs to be vector information, so that the final image is a vector graphic that he can use with his laser CNC machine.
I've worked with GD before, but I've not seen any functionality that allows for what I've been asked to do.
So, my questions are:
- Is this possible?
- if so, how can it be done?
Any help would be greatly appreciated!
I've been pouring over the IM docs about vector graphics, but I'm not that well versed in manipulating images. So, what I found at the bottom was this paragraph:
SVG Output Handling
As of IM v6.4.2, IM can convert ANY bitmap image into an SVG vector graphic! The conversion is not always successful, but larger and/or simpler images (like a bitmap mask) will convert very well. For example here I convert a horrible bitmap shape into a SVG image, then convert it back again, so as to smooth the bitmap into a proper anti-aliased shape.
convert -pointsize 72 -font Candice label:A -threshold 50% \ -trim +repage -bordercolor white -border 5x5 A.gif
convert A.gif A.svg
convert A.svg A.png
It would appear that in the version talked about I could perform the manipulations to the images using the GD library and save them as a bitmap image, then execute the IM line:
exec('usr/bin/convert image.png image.svg');
in order to get the final vector graphic that I need. However, it does not seem to be working, and I'm not sure how to test (as I don't have command line access) to see what version is being run.
Do any of you see a problem in this solution to what I need? If so, please let me know where I've gone wrong.