Vector Graphics

17 Oct 2003

My church has a new logo. The sample I was given suffered from aliasing, despite being over 2000 pixels wide.

Using a combination of AutoTrace and Sodipodi, as well as a lot of manual XML editing to get rid of tiny paths caused by noise in the original image, I’ve managed to convert it to an acceptable SVG format.

The next step is to write a page that allows the user (probably church members only to save my poor server) to convert the SVG file to a PNG file of a size specified by them for use in publications. This will probably use the ImageMagick suite accessed via PHP.

20 Oct 2003

Following on from the above, it turns out the logo was originally created as a vector graphic, in EPS format. It looks as though convert from the ImageMagick suite can convert that to a raster graphic, but I need to install Ghostscript as a shared library.

That’s compiling right now. I’m having an interesting time trying to persuade it to compile without X support.

I'll report on success later. Things take a while to build on this (P90) server…

21 Oct 2003

At last, finished. I never managed to get ImageMagick to compile with Ghostscript’s libgs. My solution was not to use ImageMagick, but to use Ghostscript directly. The form asks the user for a pixel width, then calculates the required resolution from the EPS dimensions, and calls gs thus:

/usr/local/bin/gs -sDEVICE=png16m -sOutputFile=$outfile -dNOPAUSE 
-dEPSCrop -dBATCH  -dTextAlphaBits=4 -dGraphicsAlphaBits=4  
-dNOPLATFONTS -dSAFER -r$res $infile

The page that generates the logos is only available to church members, to avoid overloading the server. It has since been enhanced to allow greyscale and monochrome versions to be created.

[Notes index]