1NAME
2
3 Gimp-Perl allows GIMP extensions/plug-ins/load & save handlers in Perl.
4
5SYNOPSIS
6
7 use Gimp;
8 use Gimp::Fu;
9 podregister {
10 # your code
11 my $image = new Gimp::Image (600, 300, RGB);
12 my $bg = $image->layer_new(
13 600,300,RGB_IMAGE,"Background",100,NORMAL_MODE
14 );
15 $image->insert_layer($bg, 1, 0);
16 $image->edit_fill($bg, FOREGROUND_FILL);
17 Gimp::Display->new($image);
18 $image;
19 };
20 exit main;
21 __END__
22 =head1 NAME
23
24 example_function - Short description of the function
25
26 =head1 SYNOPSIS
27
28 <Image>/File/Create/Patterns/Example...
29
30 =head1 DESCRIPTION
31
32 Longer description of the function...
33
34 See the end of this document for a complete example script.
35
36PREREQUISITES
37
38 Perl: 5.14+
39 The GNU Image Manipulation Program (GIMP): 2.8 (pref 2.8.10)
40 http://www.gimp.org/
41 ftp://ftp.gimp.org/pub/gimp/
42 Gtk2, the perl extension for gtk+2, "gtk2-perl-xs" variant
43 http://gtk2-perl.sourceforge.net
44 PDL, the Perl Data Language: 2.0+ (2.004+ recommended)
45 http://www.cpan.org/
46 Other packages: use CPAN to install this one, and it will get these too.
47
48INSTALLATION
49
50 On Unix/Linux, you should be able to:
51 perl ./Makefile.PL && make test && make install
52 To get a listing of configuration options, enter:
53 perl ./Makefile.PL --help
54
55 After installation, these perl plug-ins should be visible from
56 within the Gimp (and many, many more):
57
58 Filters/Perl/Server
59 Filters/Artistic/Windify
60 Filters/Misc/Prepare for GIF
61 Filters/Misc/Webify
62
63 If you wish to install the plugins in your personal GIMP directory
64 instead of the system-wide one (e.g. if you don't have root
65 access), install instead using this:
66 make install GTINSTALL='gimptool-2.0 --install-bin'
67
68 To override other build or install options see ExtUtils::MakeMaker docs.
69
70 To build a slp/deb/rpm/whatever package use the normal prefix,
71 and override prefix at "make install" time (lowercase for GIMP,
72 upper for perl):
73 make prefix=`pwd`/debian/tmp/usr PREFIX=`pwd`/debian/tmp/usr install
74
75SUPPORT/MAILING LISTS/MORE INFO
76
77 Please report any problems:
78 http://bugzilla.gnome.org/browse.cgi?product=gimp-perl
79 https://rt.cpan.org/Dist/Display.html?Name=Gimp
80
81 Homepages: https://git.gnome.org/browse/gimp-perl/
82 http://search.cpan.org/dist/Gimp/
83 Currently-suggested mailing list: gimp-user
84 (see http://www.gimp.org/mail_lists.html)
85 New releases will be announced to gimp-announce.
86
87 You can also upload your scripts to the gimp registry at
88 http://registry.gimp.org/
89
90 If you want to play along at home with git:
91 git://git.gnome.org/gimp-perl
92
93EXAMPLE PERL PLUG-IN
94
95 Here is a complete plug-in, examples/example-fu:
96
97#!/usr/bin/perl
98
99use strict;
100use Gimp;
101use Gimp::Fu;
102
103podregister {
104 # no input parameters line - source filter inserts. See Gimp::Fu docs.
105 $Gimp::verbose = 1; # remove this to stop debugging output
106 Gimp::Context->push; # store current settings, so present ones preserved
107 my $img = Gimp::Image->new($width, $height, RGB);
108 $img->undo_group_start; # so all actions can be undone in one step
109 # the __ before the string will translate it if available
110 my $l = Gimp::Layer->new($img, $width, $height, RGB, __"Background", 100, NORMAL_MODE);
111 $l->insert_layer(0, 0); # required!
112 # now a few syntax examples
113 Gimp::Context->set_foreground($text_colour) unless $ignore_cols;
114 Gimp::Context->set_background($bg_colour) unless $ignore_cols;
115 fill $l BACKGROUND_FILL;
116 my $text_layer = $img->text_fontname(-1, 10, 10, $text, 5, 1, 10, PIXELS, $font);
117 Gimp::Context->set_foreground("green");
118 $img->undo_group_end; # close the undo group
119 Gimp::Context->pop; # restore original context
120 Gimp::Display->new($img);
121 $img; # return image, as Gimp::Fu added that to our output parameters
122 # because no-image-input
123};
124
125exit main;
126__END__
127
128=head1 NAME
129
130example_script - Gimp::Fu example, mostly non-functional
131
132=head1 SYNOPSIS
133
134<Image>/Filters/Languages/_Perl/_Test/Dialog
135
136=head1 DESCRIPTION
137
138Just a starting point to derive new scripts. Always remember to put a
139descriptive help message here!
140
141=head1 PARAMETERS
142
143 # one of each type of parameter here
144 # argument type, variable name, short description, default, extra arguments
145 [PF_SLIDER , "width" , "Image width" , 360, [300, 500]],
146 [PF_SPINNER , "height" , "Image height" , 100, [100, 200]],
147 [PF_STRING , "text" , "Message" , "example text"],
148 [PF_TEXT , "longtext" , "Longer text" , "more example text"],
149 [PF_FILE , "file" , "File" , "/tmp"],
150 [PF_INT8 , "int8" , "8-bit int" , 10],
151 [PF_INT32 , "bordersize" , "Border size" , 10],
152 [PF_FLOAT , "borderwidth" , "Border width" , 1/5],
153 [PF_FONT , "font" , "Font"],
154 [PF_COLOUR , "text_colour" , "Text colour", [10,10,10]],
155 [PF_COLOUR , "bg_colour" , "Background colour" , [0xff,0x80,0]],
156 [PF_TOGGLE , "ignore_cols" , "Ignore colours" , 0],
157 [PF_IMAGE , "extra_image" , "Additional picture to ignore"],
158 [PF_DRAWABLE , "extra_draw" , "Something to ignore as well" ],
159 [PF_RADIO , "type" , "Effect type" , 0, [small => 0, large => 1]],
160 [PF_BRUSH , "a_brush" , "An unused brush"],
161 [PF_PATTERN , "a_pattern" , "An unused pattern"],
162 [PF_GRADIENT , "a_gradients" , "An unused gradients"],
163
164=head1 AUTHOR
165
166Marc Lehmann <pcg@goof.com>
167
168=head1 DATE
169
1702000-03-21
171
172=head1 LICENSE
173
174(c) 1998,1999,2000 Marc Lehmann
175
176Distributed under the same terms as Gimp-Perl.
177