PascalMagick/es

From Lazarus wiki
Jump to navigationJump to search

English (en) español (es) français (fr) Bahasa Indonesia (id) 日本語 (ja) português (pt) русский (ru) 中文(中国大陆)‎ (zh_CN)

En breve

Sobre ImageMagick

ImageMagick es un conjunto de librerías de software libre desarrollado para crear, editar y componer imágenes de mapa de bits. Soporta una gran variedad de formatos (más de 90) incluyendo formatos como GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF y DPX. Las imágenes pueden ser recortadas, sus colores pueden cambiarse, aplicarles varios efectos, pueden ser giradas y combinadas; texto, líneas, polígonos, elipses y curvas de Bézier se pueden añadir a las imágenes y ajustadas y rotadas.

ImageMagick funciona en los principales sistemas operativos y se puede utilizar desde la línea de órdenes y el paquete con el utilitario de línea de órdenes es un paquete estándar de Linux en muchas distribuciones.

Características y capacidades:

  • Convertir una imagen de un formato a otro (por ejemplo, PNG a JPEG)
  • Escalar, rotar, mejorar, reducir los colores, o agregar efectos especiales a una imagen
  • Crear un montaje con miniaturas de las imágenes
  • Crear una imagen transparente adecuada para su uso en la Web
  • Convertir un grupo de imágenes en una secuencia de animación GIF
  • Crear una imagen compuesta por la combinación de varias imágenes separadas
  • Dibujar formas o texto en una imagen
  • Decorar una imagen con un borde o marco
  • Describir el formato y las características de una imagen

Sobre el libro ImageMagick Tricks

ImageMagick Tricks Este rápido y práctico libro está repleto de ejemplos de manipulación de fotos, la creación de logotipos, animaciones y proyectos web completos. Con este libro a mano, va a crear imágenes fascinantes desde su código en un momento.

Sobre MagickWand

MagickWand API es la interfaz recomendada por el equipo de ImageMagick. Es la interfaz de programación más fácil utilizar el para trabajar con ImageMagick.

Sobre MagickCore

La API MagickCore API es una interfaz de bajo nivel para ImageMagick.

Sobre PascalMagick

Esta adaptación es una traducción de los archivos de cabecera C tanto de MagickWand como de Magick Core.

Pantallazos

Autores

Felipe Monteiro de Carvalho

Ángel Eduardo García

Licencia

Tipo BSD ompatible con GPL.

Puedes leer la licencia.

Download

PascalMagick 0.4 is available here: http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=174103&release_id=431432

Status: Magick Wand headers are complete and working on both Windows and Linux.

Installation

The current version of PascalMagick works on Windows and Linux. Beta testers are necessary for the Mac OS X version.

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

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

To check that everything is working, open the PascalMagick/wand/wanddemo.lpi project. Now go to the Project --> "Compiler Options dialog" and change the "Other Units" field to point to "../magick", so it can find the PascalMagick/magick/ImageMagick.pas file. After this you can compile and run the test program.

If the program 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.

One Extra step is necessary on Linux: Rename the image.PNG to image.png due to case issues.

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.


Subversion

You can download the subversion version of this project using this command:

svn checkout http://svn.freepascal.org/svn/fpc/trunk/packages/base/imagemagick imagemagick

You can also download the full fpc 2.1.1 repository and it will be included.

Bug Reporting/Feature Request

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

Please post Bug Reports / Feature Requests in the discussion page.

Change Log

  • 07.11.07
  1. Added 4 missing functions on magick_image.inc on fpc subversion, but no new release
  • 12.07.06 PascalMagick version 0.4 released
  1. Last bugs fixed
  • 24.05.06 PascalMagick version 0.3 released
  1. Minor fixes on the bindings
  • 10.04.06 PascalMagick version 0.2 released
  1. Based on ImageMagic 6.2
  2. MagickWand API fully translated
  3. Added a second demonstration program
  • 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
  • 14.12.05 Began working on a pascal port for the c headers

Help

Please send help requests to the Lazarus Forum or the Lazarus mailling list.