An SWI-Prolog interface to ImageMagick.

Hanoi Towers



ImageMagick logo

plimk is a prolog interface to the ImageMagick graphics manipulation library.

From ImageMagick website: ImageMagick™ is a robust collection of tools and libraries to read, write, and manipulate an image in many image formats (over 90 major formats) including popular formats like TIFF, JPEG, PNG, PDF, PhotoCD, and GIF. With ImageMagick you can create images dynamically, making it suitable for Web applications. You can also resize, rotate, sharpen, color reduce, or add special effects to an image or image sequence and save your completed work in the same or differing image format.

plimk is distributed under the GNU Lesser General Public License.

At this moment plimk is only tested on Linux, although I hope it would work on other Unix systems too. About Windows, well... patches are welcome!!!


plimk is available from SourceForge download area, here.


plimk uses autoconf for automatic configuration.

As a first step, ensure that both SWI-Prolog plld and ImageMagick Wand-config utilities are on your PATH.

then extract the plink archive...

      $ tar xzf plimk-0.01
      $ cd plimk-0.01

...and run...

      $ ./configure
      $ make
      $ make install

...and it's done!

plimk is generated with the help of pwig (another one of my free software projects :-). But don't worry about that, you will need pwig only if you want to change something inside plimk itself.


looking for food

There is not any specific documentation for plimk but it is a direct mapping of the MagickWand C API so read the documentation there.

Just remember some simple rules about how C functions are wrapped on prolog:


This is beta quality software, expect bugs, although not too many.

Send bug reports to this address.

Known bugs:


On the distribution, on the samples directory, you will find, a prolog program able to solve the classical "Towers of Hanoi" problem creating an animation with the solution.

run it as...

    ?- ['samples/hanoi'].
    %  library(plimk) compiled into plimk 0.09 sec, 250,620 bytes
    % samples/hanoi compiled 0.09 sec, 260,076 bytes

    ?- hanoi([red, green, yellow, purple, gray]).

the animation will show!