From Mageia wiki
Jump to: navigation, search

Packages

  • graphicsmagick
  • libgraphicsmagick3
  • libgraphicsmagickwand2
  • libgraphicsmagick-devel
  • perl-Graphics-Magick
  • graphicsmagick-doc

From SRPM:

  • graphicsmagick


Testing procedure

The following commands should be enough to test some of the main functions of GraphicsMagick. You need to have a terminal open in a directory where you have one or more image files available.


The results of these commands can be checked by opening the output files in your file browser and/or by using the command:

$ gm display filename.ext


To convert images from one format to another:

  • $ gm convert filename.jpg filename.png
  • $ gm convert filename.jpg filename.tiff
  • $ gm convert filename.jpg filename.pdf


To add a black rectangle near the top-left corner of an image:

$ gm convert -draw "rectangle 20,20 150,100" filename1.jpg filename2.jpg


To rotate a JPG image by 90 degrees clockwise:

$ gm convert -rotate +90 filename1.jpg filename2.jpg


To display a TIFF image flipped on its horizontal edge (i.e. upside down):

$ gm display -flip filename.tiff


To display some basic information about a JPG image:

$ gm identify filename.jpg


To make a montage of three JPG images:

$ gm montage filename1.jpg filename2.jpg filename3.jpg outputfilename.jpg


To take a screenshot of the entire screen and save it as a PNG file:

$ gm import -window root filename.png


Testing procedure for perl-Graphics-Magick

#!/usr/local/bin/perl
# taken from http://www.graphicsmagick.org/perl.html#example-script
use Graphics::Magick;
my($image, $status);
$image = Graphics::Magick->new;
$status = $image->Read('test1.png', 'test2.png', 'test3.png');
warn "$status" if "$status";
$status = $image->Write('x.gif');
warn "$status" if "$status";

Save it as test.pl, make it executable, then execute it "perl test.pl" in a directory containing 3 png images : test{1,2,3}.png The script reads the 3 images and writes a single image (x.gif) as a GIF animation sequence.

Test successful if you obtain the gif animation.