• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/perl
2#
3# An example of applying many settings in preparation for image creation.
4#
5# Extracted from PerlMagick Discussion forums..
6# Gravity center, caption and wrapped text
7#   https://imagemagick.org/discourse-server/viewtopic.php?f=7&t=17282
8#
9use strict;
10use warnings;
11use Image::Magick;
12
13my $im = new Image::Magick;
14my $e = $im->Set(
15        background => 'none',
16        fill => 'white',
17        stroke => 'black',
18        strokewidth => 2,
19        Gravity => 'East',
20        pointsize => 48,
21        size => '200x300',
22);
23die $e if $e;
24
25$e = $im->Read("caption:Lorem ipsum etc etc");
26die $e if $e;
27
28$e = $im->Trim();
29die $e if $e;
30
31$e = $im->Write('settings.png');
32die $e if $e;
33