views:

115

answers:

3

This is a beautiful image. I'm wondering how it can be generated programmatically with an image-processing library like imagemagick or gd?

http://robertbasic.com/img/sign-letters.gif

alt text

My general idea is that the frame itself could be defined separately, but is there way to fill that frame with letters in the same way they're doing it here but programmatically?

question rephrased for clarity based on answers

+1  A: 

CSS has nothing to do with image-generation, just presentation of DOM elements--if you want to create it in an HTML/DOM window, you could do such, but if you're looking to actually generate an image via PHP, ImageMagick is generally route people go (though you'll need ImageMagick installed on the server).

Marc Bollinger
+1 for ImageMagick - it makes this a lot easier. It's not impossible using GD, either, but it's easiert in IM. See http://www.imagemagick.org/Usage/ for a full "examples" manual - especially http://www.imagemagick.org/Usage/text/#mixed_font_lines
Pekka
+1  A: 

The best approach would probably be entirely server side (i.e. with php or you language of choice). The other option would be entirely client side, that is, with Javascript and CSS - here you would need each letter to be absolutely positioned, and there would likely be a bit of performance overhead.

wsanville
it depends on what you meant by "performance overhead". If there is twenty queries to the server requesting this page, then the server-side script will get overloaded; OTOH if you do client-side scripting, your server may still survive that. The best middle ground however will be to pre-create the image and just send that single image.
Lie Ryan
+1  A: 

I'm not quite clear what you're asking. "Filling the frame" can be pretty easily done by using a mask. Most graphic platforms support this, on the server (gd, image magick) or on the client (flash, html canvas).

If you're asking how to programmatically create one of these, this is going to be slightly more complicated ;)

stereofrog
+1 Nice link.. how? For some reason, Processing comes to mind, though I don't actually know any Processing and maybe it can be done with normal php libraries?
jblue
how what? how to make a mask or how to automate font drawings?
stereofrog
@stereofrog I mean the font drawings. The general idea at least
jblue
i'd start with an ascii art generator like http://www.glassgiant.com/ascii/ascii.php?sample=monroe
stereofrog