Difference between revisions of "PascalMagick"

From Lazarus wiki
Jump to navigationJump to search
(ImageMagick doesn't seem to be available for Mac OS)
Line 53: Line 53:
 
===Installation===
 
===Installation===
  
The current version of PascalMagick, 0.1, is only known to work on Windows. Future versions will also be tested on Linux and Mac OS, as the library itself is available on many platforms.
+
The current version of PascalMagick, 0.1, is only known to work on Windows. Future versions will also be tested on Linux and Mac OS X, as the library itself is available on many platforms.
  
 
To start with, install ImageMagick binaries for Windows on the official website: http://www.imagemagick.org/script/binary-releases.php
 
To start with, install ImageMagick binaries for Windows on the official website: http://www.imagemagick.org/script/binary-releases.php

Revision as of 13:34, 27 December 2005

About

About ImageMagick


ImageMagick is a free software suite developed to create, edit, and compose bitmap images. It supports a huge variety of formats (over 90) including formats like GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Images can be cropped, colors can be changed, various effects can be applied, images can be rotated and combined, and text, lines, polygons, ellipses and Bézier curves can be added to images and stretched and rotated.

The suite runs on all major operating systems and it can also be used from the command line and it´s command line tools package is one of Linux standard packages, being distributed with many distributions.

Features and Capabilities:

  • Convert an image from one format to another (e.g. PNG to JPEG)
  • Resize, rotate, sharpen, color reduce, or add special effects to an image
  • Create a montage of image thumbnails
  • Create a transparent image suitable for use on the Web
  • Turn a group of images into a GIF animation sequence
  • Create a composite image by combining several separate image
  • Draw shapes or text on an image
  • Decorate an image with a border or frame
  • Describe the format and characteristics of an image


About MagickWand


The MagickWand API is the recommended interface by the ImageMagick team. It is an easy to use programming interface for using the suite.


About MagickCore


The MagickCore API is a low-level interface. This port is a translation of the c header files for both MagickWand and Magick Core.


Screenshot

Author

Felipe Monteiro de Carvalho

License

BSD-style and compatible with the GLP.

You can read the Licence here.

Download

PascalMagick 0.1 is available here: http://sourceforge.net/project/showfiles.php?group_id=92177

Status: Incomplete, but usable on Windows

Installation

The current version of PascalMagick, 0.1, is only known to work on Windows. Future versions will also be tested on Linux and Mac OS X, as the library itself is available on many platforms.

To start with, install ImageMagick binaries for Windows on the official website: http://www.imagemagick.org/script/binary-releases.php

Now download and unzip PascalMagick package (Instructions on the above section).

To check that everything is working, compile the PascalMagick/wand/wanddemo.lpi project and run the program. If it is working, it will load the image.png image located on the same directory as he is, resize it and then save it as a jpg called image.jpg.

Demonstration program 1

{
  Demonstration program for the ImageMagick Library

  This program was converted from c by: Felipe Monteiro de Carvalho

  Usage: Just execute the program. It will resize the image.png image
  on it´s directory to fit (106, 80) and convert it to a jpg.
  
  Dez/2005
}
{Version 0.1}
program wanddemo;

{$mode objfpc}{$H+}

uses SysUtils, magick_wand, ImageMagick;

procedure ThrowWandException(wand: PMagickWand);
var
  description: PChar;
  severity: ExceptionType;
begin
  description := MagickGetException(wand, @severity);
  WriteLn(Format('An error ocurred. Description: %s', [description]));
  description := MagickRelinquishMemory(description);
  Abort;
end;

var
  status: MagickBooleanType;
  wand: PMagickWand;
begin
  { Read an image. }
  
  MagickWandGenesis;

  wand := NewMagickWand;
  
  try
    status := MagickReadImage(wand, 'image.png');
    if (status = MagickFalse) then ThrowWandException(wand);

    { Turn the images into a thumbnail sequence. }

    MagickResetIterator(wand);

    while (MagickNextImage(wand) <> MagickFalse) do
     MagickResizeImage(wand, 106, 80, LanczosFilter, 1.0);

    { Write the image as MIFF and destroy it. }
  
    status := MagickWriteImages(wand, 'image.jpg', MagickTrue);
    if (status = MagickFalse) then ThrowWandException(wand);

  finally
    wand := DestroyMagickWand(wand);

    MagickWandTerminus;
  end;
end.


CVS

Not yet available.

Bug Reporting/Feature Request

Tests are necessary to verify if the bindings work with all versions of ImageMagick.

You can post Bug Reports / Feature Requests here:

Change Log

  • 14.12.05 Began working on a pascal port for the c headers
  • 27.12.05 PascalMagick version 0.1 released
  1. About 80% of the MagickWand API is translated
  2. The basic demonstration program is working well
  3. Only the very minimum necessary MagickCode headers were translated

Help

Help requests can be posted here: