> GraphicsMagick Perl API -- PerlMagick

> Introduction

PerlMagick is an objected-oriented Perl interface to GraphicsMagick. Use the module to read, manipulate, or write an image or image sequence from within a Perl script. This makes it very suitable for Web CGI scripts. You must have GraphicsMagick 1.0.0 or above and Perl version 5.005_02 or greater installed on your system for either of these utilities to work.
There are a number of useful scripts available to show you the value of PerlMagick. The PerlMagick demo directory provides a number of sample demos. You can try PerlMagick from your Web browser at the ImageMagick Studio. Or, you can see examples of select PerlMagick functions.

Back to Contents
 

> Installation

UNIX
PerlMagick is installed by default by installing GraphicsMagick. Installing PerlMagick as a subordinate package of GraphicsMagick is the best way to avoid problems.
For Unix, you typically need to be root to install the software. There are ways around this. Consult the Perl manual pages for more information.
Windows XP / Windows 2000
Please note that a nice GUI installer is available for GraphicsMagick. PerlMagick is included in this installer. If you are using the installer, then there is no need to compile PerlMagick.
After GraphicsMagick has been compiled from the GraphicsMagick Windows source distribution using Microsoft Visual C++, PerlMagick may be manually built and installed by opening a CLI window and performing the following steps:
 cd PerlMagick
 copy Makefile.nt Makefile.PL
 perl Makefile.PL
 nmake
 nmake install
See the PerlMagick Windows HowTo page for further installation instructions.
Running the Regression Tests
 To verify a correct installation, type
 make test
Use nmake test under Windows. There are a few demonstration scripts available to exercise many of the functions PerlMagick can perform. Type
 cd demo
 make
You are now ready to utilize the PerlMagick methods from within your Perl scripts.

Back to Contents
 

> Overview

Any script that wants to use PerlMagick methods must first define the methods within its namespace and instantiate an image object. Do this with:
 use Graphics::Magick;
 $image=Graphics::Magick->new;
Note that this differs from the ImageMagick version of PerlMagick which uses the namespace Image::Magick. Any PerlMagick code written for the ImageMagick version of PerlMagick requires a global substition of Image::Magick to Graphics::Magick in order to work with the GraphicsMagick version.
The new() method takes the same parameters as SetAttribute . For example,
 $image=Graphics::Magick->new(size=>'384x256');
Next you will want to read an image or image sequence, manipulate it, and then display or write it. The input and output methods for PerlMagick are defined in Read or Write an Image. See Set an Image Attribute for methods that affect the way an image is read or written. Refer to Manipulate an Image for a list of methods to transform an image. Get an Image Attribute describes how to retrieve an attribute for an image. Refer to Create an Image Montage for details about tiling your images as thumbnails on a background. Finally, some methods do not neatly fit into any of the categories just mentioned. Review Miscellaneous Methods for a list of these methods.
Once you are finished with a PerlMagick object you should consider destroying it. Each image in an image sequence is stored in either virtual memory or as a file in the system's temporary file directory. This can potentially add up to megabytes of memory or disk. Upon destroying a PerlMagick object, the memory is returned for use by other Perl methods. The recommended way to destroy an object is with undef:
 undef $image;
To delete all the images but retain the Graphics::Magick object use
 @$image = ();
and finally, to delete a single image from a multi-image sequence, use
 undef $image->[x];
The next section illustrates how to use various PerlMagick methods to manipulate an image sequence.
Some of the PerlMagick methods require external programs such as Ghostscript. This may require an explicit path in your PATH environment variable to work properlyfile
  <?xml version="1.0"?>
  <typemap>
    <include file="type-windows.mgk" />
    <type
      name="AvantGarde-Book"
      fullname="AvantGarde Book"
      family="AvantGarde"
      foundry="URW"
      weight="400"
      style="normal"
      stretch="normal"
      format="type1"
      metrics="/usr/local/share/ghostscript/fonts/a010013l.afm"
      glyphs="/usr/local/share/ghostscript/fonts/a010013l.pfb"
    />
  </typemap>

Back to Contents  

> Acknowledgements

The MIT X Consortium for making network transparent graphics a reality.

Peder Langlo, Hewlett Packard, Norway, made hundreds of suggestions and bug reports. Without Peder, GraphicsMagick would not be nearly as useful as it is today.

Rod Bogart and John W. Peterson, University of Utah. Image compositing is loosely based on rlecomp of the Utah Raster Toolkit.

Michael Halle, Spatial Imaging Group at MIT, for the initial implementation of Alan Paeth's image rotation algorithm.

David Pensak, E. I. du Pont de Nemours and Company, for providing a computing environment that made this program possible.

Paul Raveling, USC Information Sciences Institute. The spatial subdivision color reduction algorithm is based on his Img software.

Back to Contents  

> Authors

John Cristy,
Bob Friesenhahn,
Glenn Randers-Pehrson,
William Radcliff,
Leonard Rosenthol.

 

Back to Contents  

> Copyright

Copyright (C) 2002, 2003 GraphicsMagick Group, an organization dedicated to making software imaging solutions freely available.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ("GraphicsMagick"), to deal in GraphicsMagick without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of GraphicsMagick, and to permit persons to whom GraphicsMagick is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of GraphicsMagick.

The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall GraphicsMagick Group be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with GraphicsMagick or the use or other dealings in GraphicsMagick.

Except as contained in this notice, the name of the GraphicsMagick Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in GraphicsMagick without prior written authorization from the GraphicsMagick Group.

Additional copyrights and licenses apply to this software. You should have received a copy of Copyright.txt with this package, which describes additional copyrights and licenses which apply to this software; otherwise see http://www.graphicsmagick.org/www/Copyright.html.

Back to Contents  


[Home] [Utilities Index]

Copyright © GraphicsMagick Group 2002, 2003

./usr/share/doc/graphicsmagick/www/perl.html0000644000000000000000000023531011262515404020025 0ustar rootroot GraphicsMagick Perl API

> GraphicsMagick Perl API -- PerlMagick

> Introduction

PerlMagick is an objected-oriented Perl interface to GraphicsMagick. Use the module to read, manipulate, or write an image or image sequence from within a Perl script. This makes it very suitable for Web CGI scripts. You must have GraphicsMagick 1.0.0 or above and Perl version 5.005_02 or greater installed on your system for either of these utilities to work.
There are a number of useful scripts available to show you the value of PerlMagick. The PerlMagick demo directory provides a number of sample demos. You can try PerlMagick from your Web browser at the ImageMagick Studio. Or, you can see examples of select PerlMagick functions.

Back to Contents
 

> Installation

UNIX
PerlMagick is installed by default by installing GraphicsMagick. Installing PerlMagick as a subordinate package of GraphicsMagick is the best way to avoid problems.
For Unix, you typically need to be root to install the software. There are ways around this. Consult the Perl manual pages for more information.
Windows XP / Windows 2000
Please note that a nice GUI installer is available for GraphicsMagick. PerlMagick is included in this installer. If you are using the installer, then there is no need to compile PerlMagick.
After GraphicsMagick has been compiled from the GraphicsMagick Windows source distribution using Microsoft Visual C++, PerlMagick may be manually built and installed by opening a CLI window and performing the following steps:
 cd PerlMagick
 copy Makefile.nt Makefile.PL
 perl Makefile.PL
 nmake
 nmake install
See the PerlMagick Windows HowTo page for further installation instructions.
Running the Regression Tests
 To verify a correct installation, type
 make test
Use nmake test under Windows. There are a few demonstration scripts available to exercise many of the functions PerlMagick can perform. Type
 cd demo
 make
You are now ready to utilize the PerlMagick methods from within your Perl scripts.

Back to Contents
 

> Overview

Any script that wants to use PerlMagick methods must first define the methods within its namespace and instantiate an image object. Do this with:
 use Graphics::Magick;
 $image=Graphics::Magick->new;
Note that this differs from the ImageMagick version of PerlMagick which uses the namespace Image::Magick. Any PerlMagick code written for the ImageMagick version of PerlMagick requires a global substition of Image::Magick to Graphics::Magick in order to work with the GraphicsMagick version.
The new() method takes the same parameters as SetAttribute . For example,
 $image=Graphics::Magick->new(size=>'384x256');
Next you will want to read an image or image sequence, manipulate it, and then display or write it. The input and output methods for PerlMagick are defined in Read or Write an Image. See Set an Image Attribute for methods that affect the way an image is read or written. Refer to Manipulate an Image for a list of methods to transform an image. Get an Image Attribute describes how to retrieve an attribute for an image. Refer to Create an Image Montage for details about tiling your images as thumbnails on a background. Finally, some methods do not neatly fit into any of the categories just mentioned. Review Miscellaneous Methods for a list of these methods.
Once you are finished with a PerlMagick object you should consider destroying it. Each image in an image sequence is stored in either virtual memory or as a file in the system's temporary file directory. This can potentially add up to megabytes of memory or disk. Upon destroying a PerlMagick object, the memory is returned for use by other Perl methods. The recommended way to destroy an object is with undef:
 undef $image;
To delete all the images but retain the Graphics::Magick object use
 @$image = ();
and finally, to delete a single image from a multi-image sequence, use
 undef $image->[x];
The next section illustrates how to use various PerlMagick methods to manipulate an image sequence.
Some of the PerlMagick methods require external programs such as Ghostscript. This may require an explicit path in your PATH environment variable to work properlyfile
  <?xml version="1.0"?>
  <typemap>
    <include file="type-windows.mgk" />
    <type
      name="AvantGarde-Book"
      fullname="AvantGarde Book"
      family="AvantGarde"
      foundry="URW"
      weight="400"
      style="normal"
      stretch="normal"
      format="type1"
      metrics="/usr/local/share/ghostscript/fonts/a010013l.afm"
      glyphs="/usr/local/share/ghostscript/fonts/a010013l.pfb"
    />
  </typemap>

Back to Contents  

> Acknowledgements

The MIT X Consortium for making network transparent graphics a reality.

Peder Langlo, Hewlett Packard, Norway, made hundreds of suggestions and bug reports. Without Peder, GraphicsMagick would not be nearly as useful as it is today.

Rod Bogart and John W. Peterson, University of Utah. Image compositing is loosely based on rlecomp of the Utah Raster Toolkit.

Michael Halle, Spatial Imaging Group at MIT, for the initial implementation of Alan Paeth's image rotation algorithm.

David Pensak, E. I. du Pont de Nemours and Company, for providing a computing environment that made this program possible.

Paul Raveling, USC Information Sciences Institute. The spatial subdivision color reduction algorithm is based on his Img software.

Back to Contents  

> Authors

John Cristy,
Bob Friesenhahn,
Glenn Randers-Pehrson,
William Radcliff,
Leonard Rosenthol.

 

Back to Contents  

> Copyright

Copyright (C) 2002, 2003 GraphicsMagick Group, an organization dedicated to making software imaging solutions freely available.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ("GraphicsMagick"), to deal in GraphicsMagick without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of GraphicsMagick, and to permit persons to whom GraphicsMagick is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of GraphicsMagick.

The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall GraphicsMagick Group be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with GraphicsMagick or the use or other dealings in GraphicsMagick.

Except as contained in this notice, the name of the GraphicsMagick Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in GraphicsMagick without prior written authorization from the GraphicsMagick Group.

Additional copyrights and licenses apply to this software. You should have received a copy of Copyright.txt with this package, which describes additional copyrights and licenses which apply to this software; otherwise see http://www.graphicsmagick.org/www/Copyright.html.

Back to Contents  


[Home] [Utilities Index]

Copyright © GraphicsMagick Group 2002, 2003

./usr/share/doc/graphicsmagick/www/perl.html0000644000000000000000000023531011262515404020025 0ustar rootroot GraphicsMagick Perl API

> GraphicsMagick Perl API -- PerlMagick

> Introduction

PerlMagick is an objected-oriented Perl interface to GraphicsMagick. Use the module to read, manipulate, or write an image or image sequence from within a Perl script. This makes it very suitable for Web CGI scripts. You must have GraphicsMagick 1.0.0 or above and Perl version 5.005_02 or greater installed on your system for either of these utilities to work.
There are a number of useful scripts available to show you the value of PerlMagick. The PerlMagick demo directory provides a number of sample demos. You can try PerlMagick from your Web browser at the ImageMagick Studio. Or, you can see examples of select PerlMagick functions.

Back to Contents
 

> Installation

UNIX
PerlMagick is installed by default by installing GraphicsMagick. Installing PerlMagick as a subordinate package of GraphicsMagick is the best way to avoid problems.
For Unix, you typically need to be root to install the software. There are ways around this. Consult the Perl manual pages for more information.
Windows XP / Windows 2000
Please note that a nice GUI installer is available for GraphicsMagick. PerlMagick is included in this installer. If you are using the installer, then there is no need to compile PerlMagick.
After GraphicsMagick has been compiled from the GraphicsMagick Windows source distribution using Microsoft Visual C++, PerlMagick may be manually built and installed by opening a CLI window and performing the following steps:
 cd PerlMagick
 copy Makefile.nt Makefile.PL
 perl Makefile.PL
 nmake
 nmake install
See the PerlMagick Windows HowTo page for further installation instructions.
Running the Regression Tests
 To verify a correct installation, type
 make test
Use nmake test under Windows. There are a few demonstration scripts available to exercise many of the functions PerlMagick can perform. Type
 cd demo
 make
You are now ready to utilize the PerlMagick methods from within your Perl scripts.

Back to Contents
 

> Overview

Any script that wants to use PerlMagick methods must first define the methods within its namespace and instantiate an image object. Do this with:
 use Graphics::Magick;
 $image=Graphics::Magick->new;
Note that this differs from the ImageMagick version of PerlMagick which uses the namespace Image::Magick. Any PerlMagick code written for the ImageMagick version of PerlMagick requires a global substition of Image::Magick to Graphics::Magick in order to work with the GraphicsMagick version.
The new() method takes the same parameters as SetAttribute . For example,
 $image=Graphics::Magick->new(size=>'384x256');
Next you will want to read an image or image sequence, manipulate it, and then display or write it. The input and output methods for PerlMagick are defined in Read or Write an Image. See Set an Image Attribute for methods that affect the way an image is read or written. Refer to Manipulate an Image for a list of methods to transform an image. Get an Image Attribute describes how to retrieve an attribute for an image. Refer to Create an Image Montage for details about tiling your images as thumbnails on a background. Finally, some methods do not neatly fit into any of the categories just mentioned. Review Miscellaneous Methods for a list of these methods.
Once you are finished with a PerlMagick object you should consider destroying it. Each image in an image sequence is stored in either virtual memory or as a file in the system's temporary file directory. This can potentially add up to megabytes of memory or disk. Upon destroying a PerlMagick object, the memory is returned for use by other Perl methods. The recommended way to destroy an object is with undef:
 undef $image;
To delete all the images but retain the Graphics::Magick object use
 @$image = ();
and finally, to delete a single image from a multi-image sequence, use
 undef $image->[x];
The next section illustrates how to use various PerlMagick methods to manipulate an image sequence.
Some of the PerlMagick methods require external programs such as Ghostscript. This may require an explicit path in your PATH environment variable to work properlyfile
  <?xml version="1.0"?>
  <typemap>
    <include file="type-windows.mgk" />
    <type
      name="AvantGarde-Book"
      fullname="AvantGarde Book"
      family="AvantGarde"
      foundry="URW"
      weight="400"
      style="normal"
      stretch="normal"
      format="type1"
      metrics="/usr/local/share/ghostscript/fonts/a010013l.afm"
      glyphs="/usr/local/share/ghostscript/fonts/a010013l.pfb"
    />
  </typemap>

Back to Contents  

> Acknowledgements

The MIT X Consortium for making network transparent graphics a reality.

Peder Langlo, Hewlett Packard, Norway, made hundreds of suggestions and bug reports. Without Peder, GraphicsMagick would not be nearly as useful as it is today.

Rod Bogart and John W. Peterson, University of Utah. Image compositing is loosely based on rlecomp of the Utah Raster Toolkit.

Michael Halle, Spatial Imaging Group at MIT, for the initial implementation of Alan Paeth's image rotation algorithm.

David Pensak, E. I. du Pont de Nemours and Company, for providing a computing environment that made this program possible.

Paul Raveling, USC Information Sciences Institute. The spatial subdivision color reduction algorithm is based on his Img software.

Back to Contents  

> Authors

John Cristy,
Bob Friesenhahn,
Glenn Randers-Pehrson,
William Radcliff,
Leonard Rosenthol.

 

Back to Contents  

> Copyright

Copyright (C) 2002, 2003 GraphicsMagick Group, an organization dedicated to making software imaging solutions freely available.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ("GraphicsMagick"), to deal in GraphicsMagick without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of GraphicsMagick, and to permit persons to whom GraphicsMagick is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of GraphicsMagick.

The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall GraphicsMagick Group be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with GraphicsMagick or the use or other dealings in GraphicsMagick.

Except as contained in this notice, the name of the GraphicsMagick Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in GraphicsMagick without prior written authorization from the GraphicsMagick Group.

Additional copyrights and licenses apply to this software. You should have received a copy of Copyright.txt with this package, which describes additional copyrights and licenses which apply to this software; otherwise see http://www.graphicsmagick.org/www/Copyright.html.

Back to Contents  


[Home] [Utilities Index]

Copyright © GraphicsMagick Group 2002, 2003

./usr/share/doc/graphicsmagick/www/perl.html0000644000000000000000000023531011262515404020025 0ustar rootroot GraphicsMagick Perl API

> GraphicsMagick Perl API -- PerlMagick

> Introduction

PerlMagick is an objected-oriented Perl interface to GraphicsMagick. Use the module to read, manipulate, or write an image or image sequence from within a Perl script. This makes it very suitable for Web CGI scripts. You must have GraphicsMagick 1.0.0 or above and Perl version 5.005_02 or greater installed on your system for either of these utilities to work.
There are a number of useful scripts available to show you the value of PerlMagick. The PerlMagick demo directory provides a number of sample demos. You can try PerlMagick from your Web browser at the ImageMagick Studio. Or, you can see examples of select PerlMagick functions.

Back to Contents
 

> Installation

UNIX
PerlMagick is installed by default by installing GraphicsMagick. Installing PerlMagick as a subordinate package of GraphicsMagick is the best way to avoid problems.
For Unix, you typically need to be root to install the software. There are ways around this. Consult the Perl manual pages for more information.
Windows XP / Windows 2000
Please note that a nice GUI installer is available for GraphicsMagick. PerlMagick is included in this installer. If you are using the installer, then there is no need to compile PerlMagick.
After GraphicsMagick has been compiled from the GraphicsMagick Windows source distribution using Microsoft Visual C++, PerlMagick may be manually built and installed by opening a CLI window and performing the following steps:
 cd PerlMagick
 copy Makefile.nt Makefile.PL
 perl Makefile.PL
 nmake
 nmake install
See the PerlMagick Windows HowTo page for further installation instructions.
Running the Regression Tests
 To verify a correct installation, type
 make test
Use nmake test under Windows. There are a few demonstration scripts available to exercise many of the functions PerlMagick can perform. Type
 cd demo
 make
You are now ready to utilize the PerlMagick methods from within your Perl scripts.

Back to Contents
 

> Overview

Any script that wants to use PerlMagick methods must first define the methods within its namespace and instantiate an image object. Do this with:
 use Graphics::Magick;
 $image=Graphics::Magick->new;
Note that this differs from the ImageMagick version of PerlMagick which uses the namespace Image::Magick. Any PerlMagick code written for the ImageMagick version of PerlMagick requires a global substition of Image::Magick to Graphics::Magick in order to work with the GraphicsMagick version.
The new() method takes the same parameters as SetAttribute . For example,
 $image=Graphics::Magick->new(size=>'384x256');
Next you will want to read an image or image sequence, manipulate it, and then display or write it. The input and output methods for PerlMagick are defined in Read or Write an Image. See Set an Image Attribute for methods that affect the way an image is read or written. Refer to Manipulate an Image for a list of methods to transform an image. Get an Image Attribute describes how to retrieve an attribute for an image. Refer to Create an Image Montage for details about tiling your images as thumbnails on a background. Finally, some methods do not neatly fit into any of the categories just mentioned. Review Miscellaneous Methods for a list of these methods.
Once you are finished with a PerlMagick object you should consider destroying it. Each image in an image sequence is stored in either virtual memory or as a file in the system's temporary file directory. This can potentially add up to megabytes of memory or disk. Upon destroying a PerlMagick object, the memory is returned for use by other Perl methods. The recommended way to destroy an object is with undef:
 undef $image;
To delete all the images but retain the Graphics::Magick object use
 @$image = ();
and finally, to delete a single image from a multi-image sequence, use
 undef $image->[x];
The next section illustrates how to use various PerlMagick methods to manipulate an image sequence.
Some of the PerlMagick methods require external programs such as Ghostscript. This may require an explicit path in your PATH environment variable to work properlyfile
  <?xml version="1.0"?>
  <typemap>
    <include file="type-windows.mgk" />
    <type
      name="AvantGarde-Book"
      fullname="AvantGarde Book"
      family="AvantGarde"
      foundry="URW"
      weight="400"
      style="normal"
      stretch="normal"
      format="type1"
      metrics="/usr/local/share/ghostscript/fonts/a010013l.afm"
      glyphs="/usr/local/share/ghostscript/fonts/a010013l.pfb"
    />
  </typemap>

Back to Contents  

> Acknowledgements

The MIT X Consortium for making network transparent graphics a reality.

Peder Langlo, Hewlett Packard, Norway, made hundreds of suggestions and bug reports. Without Peder, GraphicsMagick would not be nearly as useful as it is today.

Rod Bogart and John W. Peterson, University of Utah. Image compositing is loosely based on rlecomp of the Utah Raster Toolkit.

Michael Halle, Spatial Imaging Group at MIT, for the initial implementation of Alan Paeth's image rotation algorithm.

David Pensak, E. I. du Pont de Nemours and Company, for providing a computing environment that made this program possible.

Paul Raveling, USC Information Sciences Institute. The spatial subdivision color reduction algorithm is based on his Img software.

Back to Contents  

> Authors

John Cristy,
Bob Friesenhahn,
Glenn Randers-Pehrson,
William Radcliff,
Leonard Rosenthol.

 

Back to Contents  

> Copyright

Copyright (C) 2002, 2003 GraphicsMagick Group, an organization dedicated to making software imaging solutions freely available.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ("GraphicsMagick"), to deal in GraphicsMagick without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of GraphicsMagick, and to permit persons to whom GraphicsMagick is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of GraphicsMagick.

The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall GraphicsMagick Group be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with GraphicsMagick or the use or other dealings in GraphicsMagick.

Except as contained in this notice, the name of the GraphicsMagick Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in GraphicsMagick without prior written authorization from the GraphicsMagick Group.

Additional copyrights and licenses apply to this software. You should have received a copy of Copyright.txt with this package, which describes additional copyrights and licenses which apply to this software; otherwise see http://www.graphicsmagick.org/www/Copyright.html.

Back to Contents  


[Home] [Utilities Index]

Copyright © GraphicsMagick Group 2002, 2003

./usr/share/doc/graphicsmagick/www/perl.html0000644000000000000000000023531011262515404020025 0ustar rootroot GraphicsMagick Perl API

> GraphicsMagick Perl API -- PerlMagick

> Introduction

PerlMagick is an objected-oriented Perl interface to GraphicsMagick. Use the module to read, manipulate, or write an image or image sequence from within a Perl script. This makes it very suitable for Web CGI scripts. You must have GraphicsMagick 1.0.0 or above and Perl version 5.005_02 or greater installed on your system for either of these utilities to work.
There are a number of useful scripts available to show you the value of PerlMagick. The PerlMagick demo directory provides a number of sample demos. You can try PerlMagick from your Web browser at the ImageMagick Studio. Or, you can see examples of select PerlMagick functions.

Back to Contents
 

> Installation

UNIX
PerlMagick is installed by default by installing GraphicsMagick. Installing PerlMagick as a subordinate package of GraphicsMagick is the best way to avoid problems.
For Unix, you typically need to be root to install the software. There are ways around this. Consult the Perl manual pages for more information.
Windows XP / Windows 2000
Please note that a nice GUI installer is available for GraphicsMagick. PerlMagick is included in this installer. If you are using the installer, then there is no need to compile PerlMagick.
After GraphicsMagick has been compiled from the GraphicsMagick Windows source distribution using Microsoft Visual C++, PerlMagick may be manually built and installed by opening a CLI window and performing the following steps:
 cd PerlMagick
 copy Makefile.nt Makefile.PL
 perl Makefile.PL
 nmake
 nmake install
See the PerlMagick Windows HowTo page for further installation instructions.
Running the Regression Tests
 To verify a correct installation, type
 make test
Use nmake test under Windows. There are a few demonstration scripts available to exercise many of the functions PerlMagick can perform. Type
 cd demo
 make
You are now ready to utilize the PerlMagick methods from within your Perl scripts.

Back to Contents
 

> Overview

Any script that wants to use PerlMagick methods must first define the methods within its namespace and instantiate an image object. Do this with:
 use Graphics::Magick;
 $image=Graphics::Magick->new;
Note that this differs from the ImageMagick version of PerlMagick which uses the namespace Image::Magick. Any PerlMagick code written for the ImageMagick version of PerlMagick requires a global substition of Image::Magick to Graphics::Magick in order to work with the GraphicsMagick version.
The new() method takes the same parameters as SetAttribute . For example,
 $image=Graphics::Magick->new(size=>'384x256');
Next you will want to read an image or image sequence, manipulate it, and then display or write it. The input and output methods for PerlMagick are defined in Read or Write an Image. See Set an Image Attribute for methods that affect the way an image is read or written. Refer to Manipulate an Image for a list of methods to transform an image. Get an Image Attribute describes how to retrieve an attribute for an image. Refer to Create an Image Montage for details about tiling your images as thumbnails on a background. Finally, some methods do not neatly fit into any of the categories just mentioned. Review Miscellaneous Methods for a list of these methods.
Once you are finished with a PerlMagick object you should consider destroying it. Each image in an image sequence is stored in either virtual memory or as a file in the system's temporary file directory. This can potentially add up to megabytes of memory or disk. Upon destroying a PerlMagick object, the memory is returned for use by other Perl methods. The recommended way to destroy an object is with undef:
 undef $image;
To delete all the images but retain the Graphics::Magick object use
 @$image = ();
and finally, to delete a single image from a multi-image sequence, use
 undef $image->[x];
The next section illustrates how to use various PerlMagick methods to manipulate an image sequence.
Some of the PerlMagick methods require external programs such as Ghostscript. This may require an explicit path in your PATH environment variable to work properlyfile
  <?xml version="1.0"?>
  <typemap>
    <include file="type-windows.mgk" />
    <type
      name="AvantGarde-Book"
      fullname="AvantGarde Book"
      family="AvantGarde"
      foundry="URW"
      weight="400"
      style="normal"
      stretch="normal"
      format="type1"
      metrics="/usr/local/share/ghostscript/fonts/a010013l.afm"
      glyphs="/usr/local/share/ghostscript/fonts/a010013l.pfb"
    />
  </typemap>

Back to Contents  

> Acknowledgements

The MIT X Consortium for making network transparent graphics a reality.

Peder Langlo, Hewlett Packard, Norway, made hundreds of suggestions and bug reports. Without Peder, GraphicsMagick would not be nearly as useful as it is today.

Rod Bogart and John W. Peterson, University of Utah. Image compositing is loosely based on rlecomp of the Utah Raster Toolkit.

Michael Halle, Spatial Imaging Group at MIT, for the initial implementation of Alan Paeth's image rotation algorithm.

David Pensak, E. I. du Pont de Nemours and Company, for providing a computing environment that made this program possible.

Paul Raveling, USC Information Sciences Institute. The spatial subdivision color reduction algorithm is based on his Img software.

Back to Contents  

> Authors

John Cristy,
Bob Friesenhahn,
Glenn Randers-Pehrson,
William Radcliff,
Leonard Rosenthol.

 

Back to Contents  

> Copyright

Copyright (C) 2002, 2003 GraphicsMagick Group, an organization dedicated to making software imaging solutions freely available.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ("GraphicsMagick"), to deal in GraphicsMagick without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of GraphicsMagick, and to permit persons to whom GraphicsMagick is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of GraphicsMagick.

The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall GraphicsMagick Group be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with GraphicsMagick or the use or other dealings in GraphicsMagick.

Except as contained in this notice, the name of the GraphicsMagick Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in GraphicsMagick without prior written authorization from the GraphicsMagick Group.

Additional copyrights and licenses apply to this software. You should have received a copy of Copyright.txt with this package,