Difference between revisions of "PascalMagick/fr"

From Lazarus wiki
Jump to navigationJump to search
(Traduction avec réagencements et réécriture de certaines parties)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{PascalMagick}}
 
{{PascalMagick}}
  
=== Au sujet de ===
+
==== Au sujet d'ImageMagick ====
  
==== Au sujet d'ImageMagick  ====
 
  
 +
[http://www.imagemagick.org ImageMagick] est une suite libre de logiciels de développement pour crée, éditer et compose des bitmaps. Il supporte un nombre énorme de format d'image (plus de 200 !) dont PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, et SVG. Les images peuvent être redimensionner, mise en miroir, tourner, déformer, cisailler et transformer. Vous pouvez ajuster les couleurs d'image, appliquer différents effets ou dessiner du texte, des lignes, des polygones, des ellipses et des courbes de Bézier.
  
[http://www.imagemagick.org 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.
+
Cette suite tourne sur la majorité des OS (il est préinstaller sur plusieurs distibutions Linux) et peut également être utiliser en ligne de commande.
  
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.
+
ImageMagick dipose également de ces fonctionalité :
  
Features and Capabilities:
+
* Convertir une image d'un type à l'autre (ex PNG→JPEG)
 +
* Crée un montage de vignettes
 +
* Il gère la transparence (utile pour le web)
 +
* Peut générez des GIF à partir de plusieurs images
 +
* Crée une image à partir de plusieurs
 +
* Crée une bordure décorative à l'image
 +
* Décrire le format et les caractéristiques de l'image
  
* Convert an image from one format to another (e.g. PNG to JPEG)
+
Au fait, l'es unités de l'API sont disponibles dans 21 langages (dont le pascal)
* 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
 
  
==== ImageMagick Book ====
+
===== ImageMagick Book =====
  
 
[http://www.packtpub.com/imagemagick/book ImageMagick Tricks] This fast paced and practical tutorial is packed with examples of photo manipulations, logo creation, animations, and complete web projects. With this book up your sleeve, you'll be creating spellbinding images from code in no time.
 
[http://www.packtpub.com/imagemagick/book ImageMagick Tricks] This fast paced and practical tutorial is packed with examples of photo manipulations, logo creation, animations, and complete web projects. With this book up your sleeve, you'll be creating spellbinding images from code in no time.
  
==== About MagickWand ====
+
===== MagickWand =====
 
 
 
 
The [http://www.imagemagick.org/script/magick-wand.php 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 for ImageMagick.
 
  
==== About PascalMagick ====
 
  
This port is a translation of the c header files for both MagickWand and Magick Core.
+
L'[http://www.imagemagick.org/script/magick-wand.php API MagickWand] est l'interface recommandée par l'équipe d'ImageMagick. C'est une couche entre L'application et [https://www.imagemagick.org/script/magick-core.php MagickCore], l'API de bas niveau
  
=== Screenshot ===
+
==== Licence ====
  
 +
ImageMagick est sous une licence du style BSD mais compatible avec la GPL.
  
=== Authors ===
+
Vous lire la licence [http://www.imagemagick.org/script/license.php ici].
 
 
[[User:Sekelsenmat|Felipe Monteiro de Carvalho]]
 
 
 
[[User:Arcnor|Ángel Eduardo García]]
 
 
 
=== License ===
 
 
 
BSD-style and compatible with the GPL.
 
 
 
You can read the Licence [http://www.imagemagick.org/script/license.php here].
 
 
 
=== 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 ===
 
=== Installation ===
  
The current version of PascalMagick works on Windows and Linux. Beta testers are necessary for the Mac OS X version.
+
==== Installation de imagemagick.pas ====
  
To start with, install ImageMagick binaries from the official website: http://www.imagemagick.org/script/binary-releases.php
+
Par défaut ImageMagick est fournit avec un FPC réçent dans l'unité ImageMagick.
  
Now download and unzip PascalMagick package (Instructions on the Download section above).
+
Si non alors utiliser fppkg : fppkg install imagemagick
  
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.
+
Via svn FPC : svn checkout http://svn.freepascal.org/svn/fpc/trunk/packages/imagemagick imagemagick
 +
Placer alors le dossier "imagemagick" dans celui des paquets FPC (sous Linux /usr/share/fpcsrc/3.0.0/packages/). (FIXME : Non testé)
  
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.
+
Sinon elle est [https://sourceforge.net/projects/lazarus-ccr/files/PascalMagick/ ici] ('''méthode déconseillé''').  
 +
Si vous installer via cette méthode sachez que aucun paquet n'est fournie. Bien que l'installation soit dans les sources de FPC je vous conseille de crée un [[Lazarus Packages]]  ''(en, la version française est de toute façon actuellement en anglais et elle est meilleure, à rediger vers fr après amélioration)'' et d'inclure ce qui est dans "wand" et "magick" (dans FPC les 2 parties sont mélangée dans un seul dossier)
  
One Extra step is necessary on Linux: Rename the image.PNG to image.png due to case issues.
+
==== Installation des binaires ====
  
 +
Si ImageMagick n'est pas installée chez vous allez directement sur leur [https://www.imagemagick.org/script/binary-releases.php page de téléchargement]
  
Under linux you must edit the file PascalMagick/magick/ImageMagick.pas and change <br>
+
Si vous vous êtes sous Debian installer le paquet imagemagick.
''<code>WandExport = 'libWand';</code>''  by ''<code>WandExport = 'libMagickWand';</code>''
 
 
 
=== Demonstration program 1 ===
 
  
 +
=== Démo ===
 +
Placer dans dossier le programme et des PNG (extension .png et non .PNG si vous êtes sous Linux à cause de la sensibilité à la casse).
 +
Au lancement il va redimensionner les PNG vers du 106 par 80 et les convertir en jpeg (.jpg)
 
<pre>
 
<pre>
 
{
 
{
Line 143: Line 121:
 
</pre>
 
</pre>
  
 
=== 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 ===
 
=== Bug Reporting/Feature Request ===

Latest revision as of 16:26, 20 November 2016

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

Au sujet d'ImageMagick

ImageMagick est une suite libre de logiciels de développement pour crée, éditer et compose des bitmaps. Il supporte un nombre énorme de format d'image (plus de 200 !) dont PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, et SVG. Les images peuvent être redimensionner, mise en miroir, tourner, déformer, cisailler et transformer. Vous pouvez ajuster les couleurs d'image, appliquer différents effets ou dessiner du texte, des lignes, des polygones, des ellipses et des courbes de Bézier.

Cette suite tourne sur la majorité des OS (il est préinstaller sur plusieurs distibutions Linux) et peut également être utiliser en ligne de commande.

ImageMagick dipose également de ces fonctionalité :

  • Convertir une image d'un type à l'autre (ex PNG→JPEG)
  • Crée un montage de vignettes
  • Il gère la transparence (utile pour le web)
  • Peut générez des GIF à partir de plusieurs images
  • Crée une image à partir de plusieurs
  • Crée une bordure décorative à l'image
  • Décrire le format et les caractéristiques de l'image

Au fait, l'es unités de l'API sont disponibles dans 21 langages (dont le pascal)

ImageMagick Book

ImageMagick Tricks This fast paced and practical tutorial is packed with examples of photo manipulations, logo creation, animations, and complete web projects. With this book up your sleeve, you'll be creating spellbinding images from code in no time.

MagickWand

L'API MagickWand est l'interface recommandée par l'équipe d'ImageMagick. C'est une couche entre L'application et MagickCore, l'API de bas niveau

Licence

ImageMagick est sous une licence du style BSD mais compatible avec la GPL.

Vous lire la licence ici.

Installation

Installation de imagemagick.pas

Par défaut ImageMagick est fournit avec un FPC réçent dans l'unité ImageMagick.

Si non alors utiliser fppkg : fppkg install imagemagick

Via svn FPC : svn checkout http://svn.freepascal.org/svn/fpc/trunk/packages/imagemagick imagemagick Placer alors le dossier "imagemagick" dans celui des paquets FPC (sous Linux /usr/share/fpcsrc/3.0.0/packages/). (FIXME : Non testé)

Sinon elle est ici (méthode déconseillé). Si vous installer via cette méthode sachez que aucun paquet n'est fournie. Bien que l'installation soit dans les sources de FPC je vous conseille de crée un Lazarus Packages (en, la version française est de toute façon actuellement en anglais et elle est meilleure, à rediger vers fr après amélioration) et d'inclure ce qui est dans "wand" et "magick" (dans FPC les 2 parties sont mélangée dans un seul dossier)

Installation des binaires

Si ImageMagick n'est pas installée chez vous allez directement sur leur page de téléchargement

Si vous vous êtes sous Debian installer le paquet imagemagick.

Démo

Placer dans dossier le programme et des PNG (extension .png et non .PNG si vous êtes sous Linux à cause de la sensibilité à la casse). Au lancement il va redimensionner les PNG vers du 106 par 80 et les convertir en jpeg (.jpg)

{
  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.


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:


Bug 1

There is an error in pixel_iterator.inc The correct declaration is function NewPixelIterator(wand: PMagickWand): PPixelIterator; cdecl; external WandExport;

also the following declarations should be added function PixelGetNextIteratorRow(iterator: PPixeliterator; var wandCount : Cardinal) : PPPixelWand; cdecl; external WandExport;

function PixelGetPreviousIteratorRow(iterator: PPixeliterator; var wandCount : Cardinal) : PPPixelWand; cdecl; external WandExport;

Cheers, Todd.

Status: Fixed on 0.3


Bug 2

There is a problem in "magick_wand.pas" and "ImageMagick.pas": the compiler option "{$PACKRECORDS C}" must be in the "{$ifdef FPC}[...]{$endif}". Otherwise the units do not compile with Delphi (Delphi 7 in my case).

Best wishes, Marc Geldon (PRO IT SYSTEMS)


Bug 3

your definition of "MagickGetImagePage" in magick_image.inc:

function MagickGetImagePage(wand: PMagickWand; width, height: PCardinal; x, y: Integer): MagickBooleanType; cdecl; external WandExport;

correct definition (x and y are "PInteger"!):

function MagickGetImagePage(wand: PMagickWand; width, height: PCardinal; x, y: PInteger): MagickBooleanType; cdecl; external WandExport;

Best wishes, Marc Geldon (PRO IT SYSTEMS)


Bug 4

ImageMagick 6.2.7 (don't know exactly what version) introduced a few changes in MagickWand record and others. Also, a few variable definitions were incorrectly declared, and some function imports missed the "cdecl", so they didn't work (like NewMagickWand()). I've fixed all this issues. Can I upload the changes somewhere?

Best regards, Arcnor

Hello, you can send it to me, and I´ll apply the changes. My e-mail is felipemonteiro.carvalho@gmail.com By the way, did you correct bugs 2 and 3 also? thanks a lot --Sekelsenmat 05:07, 8 June 2006 (CEST)

Bug 5

MagickNewImage parameters convention is cdecl.

Correct definition of MagickNewImage in magick_image.inc:

function MagickNewImage(wand: PMagickWand; const columns, rows: Cardinal;
 const background: PPixelWand): MagickBooleanType; cdecl; external WandExport;

Bug 6

MagickCompositeImage : Composite_wand is a PMagickWand constant.

Correct definition of MagickCompositeImage in magick_image.inc:

function MagickCompositeImage(wand: PMagickWand; const composite_wand: PMagickWand; 
 const compose: CompositeOperator; const x, y: Integer): MagickBooleanType; cdecl; external WandExport;


--RuBBeR 18:03, 3 July 2006 (CEST)


Status: Bugs 2-6 fixed on v0.4. Thanks to all (Arcnor)

Change Log

  • 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. MagickWand API fully translated
  2. 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.