Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I want to create a counter on a page...
is there a way to make a perl script generate one image out of several images??

ex:
I have the files 0.gif | 1.gif | 2.gif ..... 9.gif which represent the numbers.. can I make the perl file read these files and generate a single image file counter.gif out of them.. this way I can use it in the html like :
<IMG SRC="./path/to/counter.pl">
thanx in advance

Replies are listed 'Best First'.
Re: Image Generation
by Beatnik (Parson) on Jan 24, 2001 at 18:43 UTC
Re: Image Generation
by t0mas (Priest) on Jan 24, 2001 at 18:48 UTC
    Image::Magick has a command called montage that you can use to combine several images into one.

    /brother t0mas
Re: Image Generation
by davorg (Chancellor) on Jan 24, 2001 at 18:41 UTC

    You can probably do this with ImageMagick or (older) versions of GD.

    However, it's worth knowing the legal implications of creating GIFs without paying large sums of money to Unisys. this article has the gory details.

    --
    <http://www.dave.org.uk>

    "Perl makes the fun jobs fun
    and the boring jobs bearable" - me

Re: Image Generation
by mr.nick (Chaplain) on Jan 24, 2001 at 19:34 UTC
    Also note that the extension ".pl" is rarely used by servers as an executable script extension (though it can be, I just never have seen it). ".cgi" is the usual extension.
    Hehe, whoops! That's what I get to writing a node before my gallon of coffee in the morning. I suppose all Slashcode and Everything derivitives use .pl as their extention. Ah well.
      There is no "usual" extension. A server can be configured to recognize CGI scripts "anywhere" via extensions such as ".cgi" and ".pl". This is bad. Much safer is to have a specific directory under which all files (regardless of extension) are treated as CGI. This is good. I won't repeat the details... this has been hashed about before here and other places.

      -- Randal L. Schwartz, Perl hacker