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

I want to write a script to read in a few bitmaps, stick them together in a row and output the result to a new bitmap. Is there a module that can accomplish this for me? I'm using activestate perl on a win32 machine, so I may need some help installing it..

Replies are listed 'Best First'.
Re: Concatenate bitmaps?
by zentara (Cardinal) on Oct 12, 2004 at 13:46 UTC
    What you want is here-> Image Magick Since you are on Win32 you will need to find a precompiled version. When you get it setup, you want the "montage" function. It will join a bunch of graphics files.

    If you want to try and do it manually, check out BMP file manipulation


    I'm not really a human, but I play one on earth. flash japh
      Okay, I have ImageMagick 6.1.0-Q8 installed and I can use the command-line utilities. So I need to install perlmagick. I downloaded the zip file (despite claiming it's included I couldn't find it) and unzipped to c:\temp\perlmagick\ and ran 'ppm install Image-Magick.ppd' and I got: "Error: no suitable installation target found for package Image-Magick." Help!
Re: Concatenate bitmaps?
by osunderdog (Deacon) on Oct 12, 2004 at 13:39 UTC

    I think probably GD is what you are looking for. Specifically GD::Image. I've had this working on windows in the past. I know that the GD package depends on the GD library which is available for windows.

    Not exactly a slam-dunk but it'll get you there.


    "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.
    OSUnderdog
Re: Concatenate bitmaps?
by borisz (Canon) on Oct 12, 2004 at 12:42 UTC
    What is a bitmap? A set of bits? A picture?
    perldoc -f pack perldoc -f unpack perldoc -f vec
    or Image::Magick
    Boris
      A picture. I searched ppm for 'image' but the closest I got was Apache-ImageMagick..? Is this it?
Re: Concatenate bitmaps?
by samtregar (Abbot) on Oct 12, 2004 at 15:10 UTC
    I've done something very similar with Imager. I'm sure GD or ImageMagick would get you there too but I've found Imager to be easier to install and easier to use.

    -sam

Re: Concatenate bitmaps?
by DrHyde (Prior) on Oct 13, 2004 at 08:39 UTC
    ImageMagick is your friend. While there are perl bindings for it, I've never got them to build properly even on a sane platform, so don't even try on Windows. Just use system() to execute the relevant ImageMagick commands.
      Yeah, it's a simple enough script so I think I'll do that. Thanks everyone for the help!
Re: Concatenate bitmaps?
by zentara (Cardinal) on Oct 12, 2004 at 19:34 UTC
    I don't use Windows, so I can't tell you what to do about installing on Windows. You might want to try this page. ImageMagickTips

    If you have the commandline utils installed, you could start playing with "montage" without the perl interface. Try typing "montage --help". A Win32 guru should help you soon, or post another question "Installing ImageMagick on Win32" to get their attention..


    I'm not really a human, but I play one on earth. flash japh