roux.tophe has asked for the wisdom of the Perl Monks concerning the following question:

I have a few (old) scripts using perlMagick. Today, no way to install ImageMagick v6 and V7 seems not compatible... Are there alternatives to ImageMagick with perl API ? Thanks --Tophe

Replies are listed 'Best First'.
Re: imagemagick alternative
by Corion (Patriarch) on May 31, 2023 at 14:30 UTC

    I'm somewhat fond of using Imager. It supports fewer image formats, but it works well enough.

Re: imagemagick alternative
by hippo (Archbishop) on May 31, 2023 at 15:54 UTC

    +1 for Imager - switched to it from ImageMagick around 6 years ago and haven't looked back.


    🦛

Re: imagemagick alternative
by Tux (Canon) on Jun 01, 2023 at 08:41 UTC

    I agree that Imager is great, but as we are listing alternatives here, I'd like to mention Tk::Photo to be a serious contestant when generating images from within a Tk script/application.

    # Create an xpm image of this graph my $img = $w->Photo (-format => "Window", -data => oct ($w->id)); $img->write ("speed.xpm", -format => "xpm");

    Enjoy, Have FUN! H.Merijn

      ++ Good suggestion. The images in the animation on my home node were all made using Tk::Photo.

      — Ken

Re: imagemagick alternative
by Discipulus (Canon) on Jun 01, 2023 at 06:47 UTC
    Hello roux.tophe,

    I used GD to create and modify images in Perl. There is also a simplified version of it: GD::Simple

    I see also Prima::Image but I never used it nor the parent module Prima (is in the TOTRY list since.. boh?), it is a good collection of modules.

    Anyway.. what do you need to do with images? Knowing this aspect can change the answer a lot.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: imagemagick alternative
by 1nickt (Canon) on Jun 01, 2023 at 10:28 UTC

    For another alternative, depending on your use case, see Cairo : "Cairo provides Perl bindings for the vector graphics library cairo. It supports multiple output targets, including PNG, PDF and SVG."

    (Although personally I would use a Javascript library and create charts and graphs in the browser these days...)

    Hope this helps!


    The way forward always starts with a minimal test.
Re: imagemagick alternative
by harangzsolt33 (Deacon) on Jun 01, 2023 at 00:03 UTC
    Could you tell me what you are trying to accomplish with ImageMagick or Imager? I'm just curious.
      «Could you tell…?»

      According to the friendly user manual possibly something like this:

      «Imager is a module for creating and altering images. It can read and write various image formats, draw primitive shapes like lines,and polygons, blend multiple images together in various ways, scale, crop, render text and more.»

      Otherwise there are few other options.

      «The Crux of the Biscuit is the Apostrophe»