[gimp-perl] Big doc tidy plus update examples to podregister



commit 4f33caf5870e91632709f72e1ce4c9ae9ade2dd2
Author: Ed J <edj src gnome org>
Date:   Thu Apr 24 07:02:03 2014 +0100

    Big doc tidy plus update examples to podregister

 Gimp.pm                      |    6 +-
 Gimp/Fu.pm                   |   10 +-
 README                       |  275 +++++++++++-------------
 TODO                         |   11 +-
 examples/animate_cells       |  147 ++++++-------
 examples/billboard           |  215 ++++++++++---------
 examples/blended2            |  256 +++++++++++-----------
 examples/blowinout           |  135 ++++++------
 examples/bricks              |  226 ++++++++++---------
 examples/burst               |  177 ++++++++--------
 examples/centerguide         |   68 ++++---
 examples/colorhtml           |  232 +++++++++++---------
 examples/dataurl             |  492 +++++++++++++++++++++---------------------
 examples/ditherize           |   77 ++++---
 examples/exceptiontest       |   46 +++--
 examples/fade-alpha          |  212 ++++++++++---------
 examples/frame_filter        |  104 +++++-----
 examples/frame_reshuffle     |  111 +++++-----
 examples/glowing_steel       |   52 ++---
 examples/goldenmean          |   97 +++++----
 examples/gouge               |   61 ++++--
 examples/guidegrid           |  142 ++++++-------
 examples/guides_to_selection |  108 +++++-----
 examples/innerbevel          |  182 ++++++++--------
 examples/layerfuncs          |   55 +++--
 examples/map_to_gradient     |   52 +++--
 examples/mirrorsplit         |   87 +++++---
 examples/perlotine           |  371 +++++++++++++------------------
 examples/pixelmap            |   36 ++--
 examples/prep4gif            |  174 +++++++--------
 examples/randomart1          |   83 ++++----
 examples/randomblends        |   71 ++++---
 examples/redeye              |  206 +++++++++---------
 examples/repdup              |   91 +++++----
 examples/roundsel            |   70 ++++---
 examples/scratches           |   84 ++++----
 examples/selective_sharpen   |   41 ++--
 examples/sethspin            |  338 ++++++++++++++---------------
 examples/stamps              |  108 +++++-----
 examples/translogo           |  182 +++++++++-------
 examples/warp-sharp          |  169 ++++++++-------
 examples/webify              |  100 +++++----
 examples/windify             |  143 ++++++------
 examples/xachlego            |  196 +++++++++--------
 examples/xachshadow          |  163 ++++++++-------
 examples/xachvision          |  107 +++++-----
 examples/yinyang             |  230 +++++++++------------
 47 files changed, 3338 insertions(+), 3261 deletions(-)
---
diff --git a/Gimp.pm b/Gimp.pm
index 691436b..c776c85 100644
--- a/Gimp.pm
+++ b/Gimp.pm
@@ -303,7 +303,7 @@ sub AUTOLOAD {
        shift unless ref $_[0];
        #goto &$ref; # does not work, PERLBUG! #FIXME
        my @r = eval { &$ref };
-       die $@ if $@; wantarray ? @r : $r[0];
+       croak $@ if $@; wantarray ? @r : $r[0];
       };
       goto &$AUTOLOAD;
     } elsif (UNIVERSAL::can($interface_pkg,$sub)) {
@@ -312,7 +312,7 @@ sub AUTOLOAD {
        shift unless ref $_[0];
        #goto &$ref; # does not work, PERLBUG! #FIXME
        my @r = eval { &$ref };
-       die $@ if $@; wantarray ? @r : $r[0];
+       croak $@ if $@; wantarray ? @r : $r[0];
       };
       goto &$AUTOLOAD;
     } elsif (gimp_procedural_db_proc_exists($sub)) {
@@ -323,7 +323,7 @@ sub AUTOLOAD {
        #goto &gimp_call_procedure; # does not work, PERLBUG! #FIXME
        warn "$$-gimp_call_procedure{1}(@_)" if $Gimp::verbose;
        my @r = eval { gimp_call_procedure (@_) };
-       die $@ if $@; wantarray ? @r : $r[0];
+       croak $@ if $@; wantarray ? @r : $r[0];
       };
       goto &$AUTOLOAD;
     }
diff --git a/Gimp/Fu.pm b/Gimp/Fu.pm
index 305364a..c408005 100644
--- a/Gimp/Fu.pm
+++ b/Gimp/Fu.pm
@@ -284,8 +284,14 @@ sub fixup_args {
    @p[0,1] = (getpod($pod,'NAME')//'') =~ /(.*?)\s*-\s*(.*)/ unless $p[0] or $p[1];
    ($p[0]) = File::Basename::fileparse($RealScript, qr/\.[^.]*/) unless $p[0];
    while (my ($k, $v) = each %IND2SECT) { $p[$k] ||= getpod($pod, $v); }
-   $p[8] ||= [ eval (getpod($pod, 'PARAMETERS') // '') ]; die $@ if $@;
-   $p[9] ||= [ eval getpod($pod, 'RETURN VALUES') // '' ]; die $@ if $@;
+   $p[8] ||= [
+      eval "package main;\n#line 0 \"$0 PARAMETERS\"\n".
+        (getpod($pod, 'PARAMETERS') // '')
+   ]; die $@ if $@;
+   $p[9] ||= [
+      eval "package main;\n#line 0 \"$0 RETURN VALUES\"\n".
+        (getpod($pod, 'RETURN VALUES') // '')
+   ]; die $@ if $@;
    for my $i (0..6, 10) {
       croak "$0: Need arg $i (or POD ".($IND2SECT{$i}//'')." section)" unless $p[$i]
    }
diff --git a/README b/README
index 70d3e94..d09e8ed 100644
--- a/README
+++ b/README
@@ -1,29 +1,39 @@
 NAME
 
-       gimp-perl is a plug-in used for writing GIMP extensions/plug-ins/load &
-       save handlers in Perl.
+       Gimp-Perl allows GIMP extensions/plug-ins/load & save handlers in Perl.
 
-WARNING
+SYNOPSIS
 
-       This version of the module is for use with GIMP 2.8.0 or
-       later. Please report all problems:
-       https://rt.cpan.org/Dist/Display.html?Name=Gimp
+         use Gimp;
+         use Gimp::Fu;
+         podregister {
+           # your code
+          my $image = new Gimp::Image (600, 300, RGB);
+          my $bg = $image->layer_new(
+            600,300,RGB_IMAGE,"Background",100,NORMAL_MODE
+          );
+          $image->insert_layer($bg, 1, 0);
+          $image->edit_fill($bg, FOREGROUND_FILL);
+          Gimp::Display->new($image);
+          $image;
+         };
+         exit main;
+         __END__
+         =head1 NAME
 
-SYNOPSIS
+         example_function - Short description of the function
 
-       my $img = new Gimp::Image (600, 300, RGB);
-       my $bg = $img->layer_new(600,300,RGB_IMAGE,"Background",100,NORMAL_MODE);
-       $img->insert_layer($bg, 1, 0);
-       $img->edit_fill($bg, FOREGROUND_FILL);
-       Gimp::Display->new($img);
+         =head1 SYNOPSIS
 
-       A complete & documented example script can be found at the end of
-       this document (search for EXAMPLE).
+         <Image>/File/Create/Patterns/Example...
 
-PREREQUISITES
+         =head1 DESCRIPTION
+
+         Longer description of the function...
 
-       To install/use this perl extension, you need to have the following
-       software packages installed (the given order is best):
+       See the end of this document for a complete example script.
+
+PREREQUISITES
 
        Perl: 5.14+
        The GNU Image Manipulation Program (GIMP): 2.8 (pref 2.8.10)
@@ -33,175 +43,132 @@ PREREQUISITES
         http://gtk2-perl.sourceforge.net
        PDL, the Perl Data Language: 2.0+ (2.004+ recommended)
         http://www.cpan.org/
+       Other packages: use CPAN to install this one, and it will get these too.
 
 INSTALLATION
 
-       On Unix/Linux, you should be able to run "perl Makefile.PL", make, make
-       test && make install. To get a listing of configuration options, enter:
-
-       perl ./Makefile.PL --help
-
-       Simply using "perl Makefile.PL" should do the job on most systems,
-       but watch out for warnings. If everything went fine, enter "make",
-       "make test, (su to appropriate level if you are installing system-wide),
-       "make install".
+       On Unix/Linux, you should be able to:
+         perl ./Makefile.PL && make test && make install
+       To get a listing of configuration options, enter:
+         perl ./Makefile.PL --help
 
        After installation, these perl plug-ins should be visible from
        within the Gimp (and many, many more):
 
-       Filters/Perl/Server
-       Filters/Artistic/Windify
-       Filters/Misc/Prepare for GIF
-       Filters/Misc/Webify
+          Filters/Perl/Server
+          Filters/Artistic/Windify
+          Filters/Misc/Prepare for GIF
+          Filters/Misc/Webify
 
        If you wish to install the plugins in your personal GIMP directory
        instead of the system-wide one (e.g. if you don't have root
        access), install instead using this:
+         make install GTINSTALL='gimptool-2.0 --install-bin'
 
-       make install GTINSTALL='gimptool-2.0 --install-bin'
+       To override other build or install options see ExtUtils::MakeMaker docs.
 
-OVERWRITING INSTALL LOCATIONS (PREFIX)
+       To build a slp/deb/rpm/whatever package use the normal prefix,
+       and override prefix at "make install" time (lowercase for GIMP,
+       upper for perl):
+          make prefix=`pwd`/debian/tmp/usr PREFIX=`pwd`/debian/tmp/usr install
 
-       In the rare case that you want to install the gimp-perl modules
-       somewhere else than in the standard location then there is a
-       standard way to accomplish this.
+SUPPORT/MAILING LISTS/MORE INFO
 
-       Usually, you can just use the PREFIX=/path option to the
-       Makefile.PL, or the other common solution of adding the INST* path
-       definitions onto the "make install" commandline.
+       Please report any problems:
+         http://bugzilla.gnome.org/browse.cgi?product=gimp-perl
+         https://rt.cpan.org/Dist/Display.html?Name=Gimp
 
-       These options are described in the "perldoc ExtUtils::MakeMaker"
-       manpage.
+       Homepages: https://git.gnome.org/browse/gimp-perl/
+                 http://search.cpan.org/dist/Gimp/
+       Currently-suggested mailing list: gimp-user
+         (see http://www.gimp.org/mail_lists.html)
+       New releases will be announced to gimp-announce.
 
-       If you are building a slp/deb/rpm/whatever package you usually want
-       to use the normal prefix, while overwriting the prefix at "make
-       install" time. In that case, just build gimp-perl (or the whole
-       GIMP) as usual, but instead of just calling "make install", use
-       something like the following command (this example is for debian):
+       You can also upload your scripts to the gimp registry at
+         http://registry.gimp.org/
 
-          make prefix=`pwd`/debian/tmp/usr PREFIX=`pwd`/debian/tmp/usr \
-               install
+       If you want to play along at home with git:
+         git://git.gnome.org/gimp-perl
 
-       The lowercase prefix is used by the Gimp, the uppercase PREFIX is
-       used by perl.  Rarely you also want to specifiy manpage directories
-       etc.. you can also overwrite these (see "man ExtUtils::MakeMaker")
-       as well, e.g. for debian:
+EXAMPLE PERL PLUG-IN
 
-          make prefix=`pwd`/debian/tmp/usr PREFIX=`pwd`/debian/tmp/usr \
-               INSTALLMAN1DIR=`pwd`/debian/tmp/usr/man/man1 \
-               INSTALLMAN3DIR=`pwd`/debian/tmp/usr/man/man3 \
-               install
+       Here is a complete plug-in, examples/example-fu:
 
-SUPPORT/MAILING LISTS/MORE INFO
+#!/usr/bin/perl
+
+use strict;
+use Gimp;
+use Gimp::Fu;
 
-       The gimp-user and gimp-developer lists (see
-       http://www.gimp.org/mail_lists.html) are currently the suggested
-       mailing lists.
+podregister {
+  # no input parameters line - source filter inserts. See Gimp::Fu docs.
+  Gimp::set_trace(TRACE_CALL); # remove this to stop debugging output
+  Gimp::Context->push; # store current settings, so present ones preserved
+  my $img = Gimp::Image->new($width, $height, RGB);
+  $img->undo_group_start; # so all actions can be undone in one step
+  # the __ before the string will translate it if available
+  my $l = Gimp::Layer->new($img, $width, $height, RGB, __"Background", 100, NORMAL_MODE);
+  $l->insert_layer(0, 0); # required!
+  # now a few syntax examples
+  Gimp::Context->set_foreground($text_colour) unless $ignore_cols;
+  Gimp::Context->set_background($bg_colour) unless $ignore_cols;
+  fill $l BACKGROUND_FILL;
+  my $text_layer = $img->text_fontname(-1, 10, 10, $text, 5, 1, 10, PIXELS, $font);
+  Gimp::Context->set_foreground("green");
+  $img->undo_group_end; # close the undo group
+  Gimp::Context->pop; # restore original context
+  Gimp::Display->new($img);
+  $img; # return image, as Gimp::Fu added that to our output parameters
+        # because no-image-input
+};
 
-       New releases will be announced to gimp-announce.
+exit main;
+__END__
 
-       You can also upload your scripts to the gimp registry at
-       http://registry.gimp.org/.
+=head1 NAME
 
-BLURB
+example_script - Gimp::Fu example, mostly non-functional
 
-       gimp-perl is a usable, debuggable, and flexible interface to GIMP
-       through use of Perl.
+=head1 SYNOPSIS
 
-LICENSE
+<Image>/Filters/Languages/_Perl/_Test/Dialog
 
-       The gimp-perl module is available under the GNU Public License
-       (see COPYING.GPL for details) and the Artistic License (see
-       COPYING.Artistic for details). Many of the scripts in the example
-       section follow these rules, but some of them have a different
-       licensing approach.  Each should have a licensing statement; please
-       consult individual plugin sources/POD for more info.
+=head1 DESCRIPTION
 
-       (c)1998,1999 Marc Lehmann <pcg goof com>
-       (c)2003,2004 Seth Burgess <sjburges gimp org>
+Just a starting point to derive new scripts. Always remember to put a
+descriptive help message here!
 
-EXAMPLE PERL PLUG-IN
+=head1 PARAMETERS
 
-        To get even more look & feel, here is a complete plug-in source,
-        it's the examples/example-fu script from the distribution.
+  # one of each type of parameter here
+  # argument type, variable name, short description, default, extra arguments
+  [PF_SLIDER   , "width"       , "Image width"         , 360, [300, 500]],
+  [PF_SPINNER  , "height"      , "Image height"        , 100, [100, 200]],
+  [PF_STRING   , "text"        , "Message"             , "example text"],
+  [PF_TEXT     , "longtext"    , "Longer text"         , "more example text"],
+  [PF_INT32    , "bordersize"  , "Border size"         , 10],
+  [PF_FLOAT    , "borderwidth" , "Border width"        , 1/5],
+  [PF_FONT     , "font"        , "Font"],
+  [PF_COLOUR   , "text_colour" , "Text colour", [10,10,10]],
+  [PF_COLOUR   , "bg_colour"   , "Background colour"   , [0xff,0x80,0]],
+  [PF_TOGGLE   , "ignore_cols" , "Ignore colours"      , 0],
+  [PF_IMAGE    , "extra_image" , "Additional picture to ignore"],
+  [PF_DRAWABLE , "extra_draw"  , "Something to ignore as well" ],
+  [PF_RADIO    , "type"        , "Effect type"         , 0, [small => 0, large => 1]],
+  [PF_BRUSH    , "a_brush"     , "An unused brush"],
+  [PF_PATTERN  , "a_pattern"   , "An unused pattern"],
+  [PF_GRADIENT , "a_gradients" , "An unused gradients"],
 
-#!/usr/bin/perl
+=head1 AUTHOR
 
-use Gimp;
-use Gimp::Fu;
+Marc Lehmann <pcg goof com>
 
-# expand your terminal to 121 across to read easily...
-
-register
-  "gimp_fu_example_script",                    # fill in a function name
-  "An example of Gimp::Fu usage, mostly non-functional",       # and a short description,
-  "Just a starting point to derive new ".        # a (possibly multiline) help text
-    "scripts. Always remember to put a long".
-    "help message here!",
-  "Marc Lehmann <pcg\ goof com>",              # don't forget your name (author)
-  "(c)1998,1999,2000 Marc Lehmann",            # and your copyright!
-  "20000321",                                  # the date this script was written (YYYYMMDD)
-  N_"<Toolbox>/Xtns/Perl/Gimp::Fu Example...", # the menu path - the 'N_' is for internationalization
-  "",                                          # image types to accept (RGB, RGAB and GRAYA) - blank or 
undef means don't need one
-  [ # one of each type of parameter here
-    # argument type, switch name       , a short description           , default value, extra arguments
-    [PF_SLIDER , "width"       , "The image width"             , 360, [300, 500]],
-    [PF_SPINNER        , "height"      , "The image height"            , 100, [100, 200]],
-    [PF_STRING , "text"        , "The Message"                 , "example text"],
-    [PF_INT32  , "bordersize"  , "The bordersize"              , 10],
-    [PF_FLOAT  , "borderwidth" , "The borderwidth"             , 1/5],
-    [PF_FONT   , "font"        , "The Font Family"             ],
-    [PF_COLOUR , "text_colour" , "The (foreground) text colour", [10,10,10]],
-    [PF_COLOUR , "bg_colour"   , "The background colour"       , [0xff,0x80,0]],
-    [PF_TOGGLE , "ignore_cols" , "Ignore colours"              , 0],
-    [PF_IMAGE  , "extra_image" , "An additonal picture to ignore"],
-    [PF_DRAWABLE       , "extra_draw"  , "Somehting to ignroe as well" ],
-    [PF_RADIO  , "type"        , "The effect type"             , 0, [small => 0, large => 1]],
-    [PF_BRUSH  , "a_brush"     , "An unused brush"             ],
-    [PF_PATTERN        , "a_pattern"   , "An unused pattern"           ],
-    [PF_GRADIENT       , "a_gradients" , "An unused gradients"         ],
-  ],
-  [
-    [PF_IMAGE  , "output image", "Output image"],
-  ],
-  sub {
-
-   # now do something useful with our parameters
-   
my($width,$height,$text,$brd1,$brd2,$font,$fg,$bg,$ignore,$xtraimg,$xtradrw,$effecttype,$brush,$pattern,$gradient)=
 _;
-
-   # set tracing, disable this to get rid of the debugging output
-   Gimp::set_trace(TRACE_CALL);
-
-   # store current context, so that present settings aren't affected
-   Gimp::Context->push();
-
-   my $img = new Gimp::Image ($width, $height, RGB);
-
-   # put an undo group around any modifications, so that
-   # they can be undone in one step.
-   $img->undo_group_start;
-
-   # the __ before the string in the next line indicates text that must be translated
-   my $l = new Gimp::Layer ($img, $width, $height, RGB, __"Background", 100, NORMAL_MODE);
-   $l->insert_layer(0, 0);
-
-   # now a few syntax examples
-
-   Gimp::Context->set_foreground($fg) unless $ignore;
-   Gimp::Context->set_background($bg) unless $ignore;
-
-   fill $l BACKGROUND_FILL;
-   my $text_layer = $img->text_fontname(-1, 10, 10, $text, 5, 1, 10, PIXELS, $font);
-
-   Gimp::Context->set_foreground("green");
-
-   # close the undo push group
-   $img->undo_group_end;
-
-   # restore original context
-   Gimp::Context->pop();
-
-   $img;       # return the image, as it's on our output parameters
-};
+=head1 DATE
 
-exit main;
+2000-03-21
+
+=head1 LICENSE
+
+(c) 1998,1999,2000 Marc Lehmann
+
+Distributed under the same terms as Gimp-Perl.
diff --git a/TODO b/TODO
index 3f8d079..e637d7d 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,8 @@
-Items as of 2014-04-19 (by Ed J)
-* <Load> and <Save> need any registration as such done in Gimp::Fu - see pod
+Items as of 2014-04-23 (by Ed J)
+* <Load> and <Save> need any registration as such done in Gimp::Fu - see pod and e/dataurl
+* Gimp::Fu must doc command-line usage
+* e/fade-alpha should generate buttons, not hardcode
+* ensure Server startup, security note in docs
 * image in Gimp.pm POD http://perlmaven.com/how-to-add-images-to-cpan -
   input image -> output image of a plugin
 * examples POD
@@ -9,10 +12,6 @@ Items as of 2014-04-19 (by Ed J)
   way to pass GIMP data back and forth directly via typemap system. May
   involve a gimp-perl "wrapper" data structure that pairs an SV with its
   GimpParam counterpart - Gimp::Lib::Data?
-* gimp-perl website: maybe just gimp.org/glossary entry - only needs
-  links to CPAN, bugzilla, git - make sure CPAN has all POD docs
-  - https://mail.gnome.org/mailman/listinfo/gimp-developer-list
-  - https://bugzilla.gnome.org/buglist.cgi?quicksearch=product:gimp-perl
 * Get gimp PDL objects working right over Gimp::Net - infrastructure is there
 * Restructure dirs so all libs under lib/ using ExtUtils::MakeMaker::BigHelper
 * http://search.cpan.org/dist/Glib-Object-Introspection/
diff --git a/examples/animate_cells b/examples/animate_cells
index 2298082..4793728 100755
--- a/examples/animate_cells
+++ b/examples/animate_cells
@@ -1,96 +1,61 @@
-#!/usr/bin/perl
-
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-#
-# A plug-in for GIMP which animates a series of layers as if
-# they were animation cells (different from the normal gimp animation,
-# in that each cell REPLACES the previous, instead of adding. The
-# background cell (bottom most layer) is always kept.
-#
-# Written in 1999 (c) by Aaron Sherman <ajs ajs com>.
-# This plugin may be distributed under the same terms as The Gimp itself.
-# See http://www.gimp.org/ for more information on The Gimp.
-#
-
-require 5.004;
-
-use Gimp qw(:auto __ N_);
+#!/usr/bin/perl -w
+
+use Gimp;
 use Gimp::Fu;
 use Gimp::Util;
 
-$animate_cells_version = "1.2";
-$animate_cells_released = "3/12/1999";
+use strict;
 
-# use strict;
+sub fix_cell_layer {
+  my $image = shift; # The image
+  my $target = shift; # The target layer
+  my $prev = shift; # The layer before it
+  my $back = shift; # The background layer
+  my $lnum = shift; # The new layer's number
+  my $dup = $prev->copy(0);
+  # Tried to do a gimp_layer_get_position($target), here, but it failed...
+  $image->insert_layer($dup, 0, $lnum);
+  $image->selection_sharpen; # No feathered or fuzzy selection areas
+  $image->selection_grow(1); # XXX - Gets around gimp 1-pixel bug
+  $back->edit_copy();
+  my $float = $dup->edit_paste(0);
+  $float->floating_sel_anchor();
+  $image->select_item(CHANNEL_OP_REPLACE,$target);
+}
 
-sub perl_fu_animate_cells {
-  my $image = shift;
-  my $drawable = shift; # Unused
-  my $makecopy = shift;
-  $image = gimp_image_duplicate($image) if $makecopy;
-  gimp_image_undo_disable($image);
-  gimp_progress_init("Animating cell layers...",MESSAGE_BOX);
+podregister {
+  $image = $image->duplicate if $work_on_copy;
+  $image->undo_disable;
+  Gimp::Progress->init("Animating cell layers...",MESSAGE_BOX);
 
-  my @ids = reverse gimp_image_get_layers($image);
+  my @ids = reverse $image->get_layers;
   my $back = shift @ids;
 
   if (@ids < 2) {
-    gimp_image_delete($image) if $makecopy;
+    $image->delete if $work_on_copy;
     die "animate_cells: too few cells (layers) in image\n";
     return;
   }
 
-  gimp_image_select_item($image,CHANNEL_OP_REPLACE,$ids[0]);
-  for($i=1;$i<@ids;$i++) {
-    gimp_progress_update(1/(@ids-1)/2*$i);
-    $lnum = $#ids+1-$i;
+  $image->select_item(CHANNEL_OP_REPLACE,$ids[0]);
+  for(my $i=1;$i<@ids;$i++) {
+    Gimp::Progress->update(1/(@ids-1)/2*$i);
+    my $lnum = $#ids+1-$i;
     fix_cell_layer($image, $ids[$i], $ids[$i-1], $back, $lnum);
   }
 
-  for($i=$#ids;$i>=0;$i--) {
-    gimp_progress_update(0.5+1/@ids*(@ids-$i));
-    gimp_image_merge_down($image, $ids[$i], EXPAND_AS_NECESSARY);
+  for(my $i=$#ids;$i>=0;$i--) {
+    Gimp::Progress->update(0.5+1/@ids*(@ids-$i));
+    $image->merge_down($image, $ids[$i], EXPAND_AS_NECESSARY);
   }
 
-  gimp_progress_update(1.0);
-
-  gimp_display_new($image) if $makecopy;
-  gimp_selection_none($image);
-  gimp_image_undo_enable($image);
-  gimp_displays_flush();
-}
-
-sub fix_cell_layer {
-  my $img = shift; # The image
-  my $target = shift; # The target layer
-  my $prev = shift; # The layer before it
-  my $back = shift; # The background layer
-  my $lnum = shift; # The new layer's number
-  my $dup = gimp_layer_copy($prev,0);
-  # Tried to do a gimp_layer_get_position($target), here, but it failed...
-  gimp_image_insert_layer($img, $dup, 0, $lnum);
-  gimp_selection_sharpen($img); # No feathered or fuzzy selection areas
-  gimp_selection_grow($img,1); # XXX - Gets around gimp 1-pixel bug
-  gimp_edit_copy($back);
-  my $float = gimp_edit_paste($dup,0);
-  gimp_floating_sel_anchor($float);
-  gimp_image_select_item($img,CHANNEL_OP_REPLACE,$target);
-}
+  Gimp::Progress->update(1.0);
 
-# Gimp::Fu registration routine for placing this function into gimp's PDB
-register
-  "animate_cells",
-  "Perform cell animation from a single, layered image",
-  "Use this plugin to animate a series of layers in the same way that\
-       a physical animation process would use cells. Version $animate_cells_version",
-  "Aaron Sherman", "Aaron Sherman (c)", $animate_cells_released,
-  N_"<Image>/Filters/Animation/Animate Cells...",
-  "*",
-  [
-   [PF_TOGGLE, "work_on_copy", "", 1]
-  ],
-  \&perl_fu_animate_cells;
+  Gimp::Display->new($image) if $work_on_copy;
+  $image->selection_none;
+  $image->undo_enable($image);
+  Gimp->displays_flush();
+};
 
 exit main;
 
@@ -98,16 +63,18 @@ __END__
 
 =head1 NAME
 
-animate_cells - Animate an image
+animate_cells - Perform cell animation from a single, layered image
 
 =head1 SYNOPSIS
 
-Called from the Gimp. Use Gimp's user interface to call this function.
-By default "C<E<lt>ImageE<gt>/Perl Fu/Animate Cells>".
+<Image>/Filters/Animation/Animate Cells...
 
 =head1 DESCRIPTION
 
-This Gimp plugin makes animation of images much simpler. The idea is that
+Use this plugin to animate a series of layers in the same way that
+a physical animation process would use cells. Version 1.2
+
+This GIMP plugin makes animation of images much simpler. The idea is that
 (as was the case with physical "cell" animation) you simply create a
 background and as many cell layers as you like. Each layer represents a
 frame to be animated on top of the background, but unlike normal Gimp
@@ -119,19 +86,31 @@ the time involved in creating new animations, especially where a single
 object is moving over a static background (more complex animation may
 still require just as much work as before).
 
-=head1 PARAMETERS
-
 The script only asks if you want to work on a copy of the image. Otherwise,
 you just need an image with a background layer and two or more layers
 on top of it which represent your "cells".
 
+=head1 PARAMETERS
+
+  [PF_TOGGLE, "work_on_copy", "", 1]
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 DATE
+
+3/12/1999
+
 =head1 AUTHOR
 
-Written in 1999 (c) by Aaron Sherman E<lt>ajs ajs comE<gt>
+Aaron Sherman E<lt>ajs ajs comE<gt>
 
-=head1 SEE ALSO
+=head1 LICENSE
 
-L<gimp>, L<perl>, L<Gimp>: the Gimp module for perl.
+This plugin may be distributed under the same terms as GIMP itself.
+See L<http://www.gimp.org/> for more information on GIMP.
 
-=cut
+=head1 SEE ALSO
 
+L<gimp>, L<perl>, L<Gimp>: the Gimp module for perl.
diff --git a/examples/billboard b/examples/billboard
index 59f99aa..6c11174 100755
--- a/examples/billboard
+++ b/examples/billboard
@@ -1,16 +1,6 @@
 #!/usr/bin/perl -w
 
-# I'm hacking this on top of my sethspin script, so this is doing even more
-# stuff it wasn't really designed to do.  Hence if you thought sethspin was
-# a bit ugly, look at this one...
-
-# I think it was tigert that suggested this.  It turned out to be less
-# complex than I originally thought so I figured I'd give it a spin.
-
-# Seth Burgess
-# <sjburges gimp org>
-
-use Gimp qw(:auto);
+use Gimp;
 use Gimp::Fu;
 use Gimp::Util;
 
@@ -33,13 +23,13 @@ sub saw {  # a sawtooth function on PI
 }
 
 sub spin_layer { # the function for actually spinning the layer
-  my ($img, $spin, $dest, $numframes, $prp, $blinds) = @_;
+  my ($img, $spin, $destination, $numframes, $prp, $blinds) = @_;
   # Now lets spin it!
   $stepsize = 3.14159/$numframes; # in radians
   for ($i=0; $i<=3.14159; $i+=$stepsize) {
     Gimp->progress_update ($i/3.14159);
     # create a new layer for spinning
-    $framelay = ($i < 3.14159/2.0) ?  $spin->copy(1) : $dest->copy(1);
+    $framelay = ($i < 3.14159/2.0) ?  $spin->copy(1) : $destination->copy(1);
     $img->insert_layer($framelay, 0, 0);
     # spin it a step
     # Here I need to make the proper selection, repeatedly if necessary
@@ -84,103 +74,122 @@ sub spin_layer { # the function for actually spinning the layer
   $img->remove_layer($all_layers[$numframes+1]);
 }
 
-register
-  "billboard",
-  "Billboard",
-  "Take one image.  Spin it about the horizontal axis, and end up with another image.  I made it for easy 
web buttons, mostly because somebody suggested to me.",
-  "Seth Burgess",
-  "Seth Burgess <sjburges\ gimp org>",
-  "1.3",
-  N_"<Image>/Filters/Animation/Billboard...",
-  "*",
-  [
-    [PF_DRAWABLE, "destination","What drawable to spin to?"],
-    [PF_INT8, "frames", "How many frames to use?", 16],
-    [PF_COLOR, "background", "What color to use for background if not transparent", 'black'],
-    [PF_INT8, "perspective", "How much perspective effect to get", 40],
-    [PF_TOGGLE, "spin_back", "Also spin back?" , 0],
-    [PF_TOGGLE, "convert_indexed", "Convert to indexed?", 1],
-    [PF_SPINNER, "billboard_slats", "Number of shades", 3, [1,50,1]],
-  ],
-  [],
-  sub {
-    my($in_img,$src,$dest,$frames,$color,$psp,$spinback,$indexed,$shadenum)= _;
-    $maxwide = ($src->width > $dest->width) ? $src->width : $dest->width;
-    $maxhigh = ($src->height > $dest->height) ? $src->height: $dest->height;
-    $img = gimp_image_new($maxwide, $maxhigh, RGB);
-
-    $tmpimglayer = $img->add_new_layer(0,3,1);
-    $img->display_new;
-    Gimp->progress_init("Billboard...",-1);
-    Gimp::Context->push();
-    Gimp::Context->set_background($color);
-    $src->edit_copy();
-    $spinlayer = $tmpimglayer->edit_paste(1);
-    $spinlayer->floating_sel_to_layer();
-
-    $dest->edit_copy();
-    $destlayer = $tmpimglayer->edit_paste(1);
-    $destlayer->floating_sel_to_layer();
-
-    $tmpimglayer->remove_layer;
-
-    $spinlayer->resize($maxwide, $maxhigh, $spinlayer->offsets);
-    $destlayer->resize($maxwide, $maxhigh, $destlayer->offsets);
-    # work around for PF_SLIDER when < 1
-    $psp = $psp/255.0;
-
-    # need an even number of frames for spinback
-    if ($frames%2 && $spinback) {
-      $frames++;
-      gimp_message(<<EOF);
+podregister {
+  $maxwide = ($drawable->width > $destination->width) ? $drawable->width : $destination->width;
+  $maxhigh = ($drawable->height > $destination->height) ? $drawable->height: $destination->height;
+  $img = gimp_image_new($maxwide, $maxhigh, RGB);
+
+  $tmpimglayer = $img->add_new_layer(0,3,1);
+  $img->display_new;
+  Gimp::Progress->init("Billboard...",-1);
+  Gimp::Context->push();
+  Gimp::Context->set_background($background);
+  $drawable->edit_copy();
+  $spinlayer = $tmpimglayer->edit_paste(1);
+  $spinlayer->floating_sel_to_layer();
+
+  $destination->edit_copy();
+  $destination = $tmpimglayer->edit_paste(1);
+  $destination->floating_sel_to_layer();
+
+  $tmpimglayer->remove_layer;
+
+  $spinlayer->resize($maxwide, $maxhigh, $spinlayer->offsets);
+  $destlayer->resize($maxwide, $maxhigh, $destlayer->offsets);
+  # work around for PF_SLIDER when < 1
+  $perspective = $perspective/255.0;
+
+  # need an even number of frames for spin_back
+  if ($frames%2 && $spin_back) {
+    $frames++;
+    Gimp->message(<<EOF);
 An even number of frames is needed for spin back.
 Adjusted frames up to $frames
 EOF
-    }
+  }
 
-    spin_layer($img, $spinlayer, $destlayer, $spinback ? $frames/2 : $frames-1, $psp, $shadenum);
-    $img->set_visible($img->add_new_layer(1),($img->get_layers)[0]);
-    $img->merge_visible_layers(0);
+  spin_layer($img, $spinlayer, $destlayer, $spin_back ? $frames/2 : $frames-1, $perspective, 
$billboard_slats);
+  $img->set_visible($img->add_new_layer(1),($img->get_layers)[0]);
+  $img->merge_visible_layers(0);
+
+  if ($spin_back) {
+    @layerlist = $img->get_layers();
+    $img->insert_layer($layerlist[$frames/2]->copy(0),0,0);
+    @layerlist = $img->get_layers();
+    spin_layer($img, $layerlist[1], $layerlist[0], $frames/2, $perspective, $billboard_slats);
+    $img->remove_layer(($img->get_layers)[0]);
+  }
 
-    if ($spinback) {
-      @layerlist = $img->get_layers();
-      $img->insert_layer($layerlist[$frames/2]->copy(0),0,0);
-      @layerlist = $img->get_layers();
-      spin_layer($img, $layerlist[1], $layerlist[0], $frames/2, $psp, $shadenum);
-      $img->remove_layer(($img->get_layers)[0]);
-    }
-
-    # unhide and name layers
-    @all_layers = $img->get_layers;
-    $img->set_visible(@all_layers);
-    for ($i=1; $i<=$frames ; $i++) {
-      $all_layers[$i-1]->set_name("Spin Layer $i (50ms)");
-    }
-    $all_layers[$frames-1]->set_name("Spin Layer SRC (250ms)");
-
-    if ($spinback) {
-      $all_layers[$frames/2-1]->set_name("Spin Layer DEST (250ms)");
-    } else {
-      $all_layers[0]->set_name("Spin Layer DEST (250ms)");
-    }
-
-    # indexed conversion wants a display for some reason
-    if ($indexed) {
-      $img->convert_indexed(1,            # dither type = fs
-        MAKE_PALETTE, # palette type
-        255,          # number of colors
-        0,            # don't dither transparency
-        1,            # (ignored)
-        "Custom"      # custom palette name
-      );
-    }
-
-    Gimp::Context->pop();
-    gimp_displays_flush();
-    return();
-  };
+  # unhide and name layers
+  @all_layers = $img->get_layers;
+  $img->set_visible(@all_layers);
+  for ($i=1; $i<=$frames ; $i++) {
+    $all_layers[$i-1]->set_name("Spin Layer $i (50ms)");
+  }
+  $all_layers[$frames-1]->set_name("Spin Layer SRC (250ms)");
+
+  if ($spin_back) {
+    $all_layers[$frames/2-1]->set_name("Spin Layer DEST (250ms)");
+  } else {
+    $all_layers[0]->set_name("Spin Layer DEST (250ms)");
+  }
+
+  # indexed conversion wants a display for some reason
+  if ($convert_indexed) {
+    $img->convert_indexed(1,            # dither type = fs
+      MAKE_PALETTE, # palette type
+      255,          # number of colors
+      0,            # don't dither transparency
+      1,            # (ignored)
+      "Custom"      # custom palette name
+    );
+  }
+
+  Gimp::Context->pop();
+  Gimp->displays_flush();
+  return();
+};
 
 exit main;
+__END__
+
+=head1 NAME
+
+billboard - Spin image about the horizontal axis, and end up with another image.
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Animation/Billboard...
+
+=head1 DESCRIPTION
+
+Take one image.  Spin image about the horizontal axis, and end up with
+another image.  I made it for easy web buttons, mostly because somebody
+suggested to me.
+
+I think it was tigert that suggested this.
+
+=head1 PARAMETERS
+
+  [PF_DRAWABLE, "destination","What drawable to spin to?"],
+  [PF_INT8, "frames", "How many frames to use?", 16],
+  [PF_COLOR, "background", "What color to use for background if not transparent", 'black'],
+  [PF_INT8, "perspective", "How much perspective effect to get", 40],
+  [PF_TOGGLE, "spin_back", "Also spin back?" , 0],
+  [PF_TOGGLE, "convert_indexed", "Convert to indexed?", 1],
+  [PF_SPINNER, "billboard_slats", "Number of shades", 3, [1,50,1]],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Seth Burgess <sjburges gimp org>
+
+=head1 DATE
+
+Version 1.3
 
 =head1 LICENSE
 
diff --git a/examples/blended2 b/examples/blended2
index 7c99d5d..2fbf4f0 100755
--- a/examples/blended2
+++ b/examples/blended2
@@ -6,136 +6,144 @@ use Gimp::Util;
 
 # Gimp::set_trace(TRACE_ALL);
 
-sub my_innerbevel {
-       my ($image, $drawable, $bg_col, $bl1, $bl2, $elev, $depth, $rad_tog) = @_;
-       # if you specify RGBA as your type, this die is only there for
-       # running it non-interactively
-       $drawable->has_alpha or die "You can't run this script without an ALPHA CHANNEL!!";
-
-       # get release of gimp, so we can be compatible between versions
-       my $gimpversion = Gimp->version;
-       $gimpversion =~ m/^(\d)\.(\d)\.\d/;
-       my $gimpmajor = $1;
-       my $gimpminor = $2;
-       my $api22 = 0; my $api23 = 0;
-
-       if ($gimpmajor == 2 && $gimpminor == 2) { $api22 = 1; }
-       elsif ($gimpmajor == 2 && $gimpminor >= 3) { $api23 = 1; }
-       else {die "Don't know how to handle gimp version $gimpversion with this plugin!\n"};
-
-       Gimp::Context->push();
-
-       my $img = gimp_image_new (256, 100, RGB_IMAGE);
-       $drawable->get_image->selection_all;
-       $drawable->edit_copy;
-       gimp_selection_none ($image);
-       if ($rad_tog == 0) {
-               my $bg_layer;
-               $bg_layer=$img->layer_new($drawable->width,$drawable->height,$image->layertype(1), 
"Background", 100, NORMAL_MODE);
-               Gimp::Context->set_background ($bg_col);
-               $bg_layer->drawable_fill(BACKGROUND_FILL);
-               $img->insert_layer($bg_layer,0,0);
-       }
-       $img->resize($drawable->width,$drawable->height, 0, 0);
-       my $text1_lay;
-       $text1_lay=$img->layer_new($drawable->width,$drawable->height,$image->layertype(1), "Text -1-", 100, 
NORMAL_MODE);
-       $img->insert_layer($text1_lay,0,-1);
-       gimp_edit_clear ($text1_lay);
-       $text1_lay->edit_paste(0)->floating_sel_anchor;
-       if ($api22) {
-         $text1_lay->set_preserve_trans(1);
-       }
-       elsif ($api23) {
-         $text1_lay->set_lock_alpha(1);
-       }
-       Gimp::Context->set_foreground ($bl1);
-       Gimp::Context->set_background ($bl2);
-       @start = ($text1_lay->width / 2 - 5, 0);
-       @end = ($text1_lay->width / 2 + 5, $text1_lay->height);
-       gimp_edit_blend ($text1_lay,
-                        FG_BG_RGB_MODE,
-                        NORMAL_MODE,
-                        GRADIENT_LINEAR,
-                        100,
-                        FALSE,
-                        REPEAT_NONE,
-                        FALSE, # reverse
-                        FALSE, # supersampling
-                        2, # recursion levels
-                        0.30, # threshold
-                        FALSE, # dithering
-                        @start, @end);
-       my $text2_lay;
-       $text2_lay=$text1_lay->copy(1);
-       $text2_lay->add_alpha;
-       $img->insert_layer($text2_lay, 0, -1);
-       Gimp::Context->set_background ([255, 255, 255]);
-       $text2_lay->edit_fill(BACKGROUND_FILL);
-       if ($api22) {
-         $text1_lay->set_preserve_trans(0);
-         $text2_lay->set_preserve_trans(0);
-       }
-       elsif ($api23) {
-         $text1_lay->set_lock_alpha(0);
-         $text2_lay->set_lock_alpha(0);
-       }
-       plug_in_gauss_rle ($text2_lay, 6, 1, 1);
-       plug_in_bump_map ($img, $text1_lay, $text2_lay, 110.0, $elev, $depth, 0, 0, 0, 0, 0, 0, 0);
-       $text2_lay->invert;
-       $img->lower_item($text2_lay);
-       $text2_lay->translate(2, 3);
-       $text2_lay->set_opacity(75);
-       if ($rad_tog == 1) {
-               $img->flatten;
-               gimp_image_convert_indexed ($img, 0, MAKE_PALETTE, 256, 0, 0, "");
-               my $new = gimp_image_get_active_drawable ($img);
-               gimp_layer_add_alpha ($new);
-               gimp_context_set_sample_threshold(55);
-               gimp_context_set_antialias(0);
-               gimp_context_set_feather(0);
-               gimp_context_set_feather_radius(0);
-               gimp_context_set_sample_merged(0);
-               gimp_image_select_color ($img, CHANNEL_OP_ADD, $new, [255, 255, 255]);
-               gimp_edit_clear ($new);
-               gimp_selection_none ($img);
-       } else {
-               $img->flatten;
-       }
+podregister {
+  # if you specify RGBA as your type, this die is only there for
+  # running it non-interactively
+  $drawable->has_alpha or die "You can't run this script without an ALPHA CHANNEL!!";
+
+  # get release of gimp, so we can be compatible between versions
+  my $gimpversion = Gimp->version;
+  $gimpversion =~ m/^(\d)\.(\d)\.\d/;
+  my $gimpmajor = $1;
+  my $gimpminor = $2;
+  my $api22 = 0; my $api23 = 0;
+
+  if ($gimpmajor == 2 && $gimpminor == 2) { $api22 = 1; }
+  elsif ($gimpmajor == 2 && $gimpminor >= 3) { $api23 = 1; }
+  else {die "Don't know how to handle gimp version $gimpversion with this plugin!\n"};
+
+  Gimp::Context->push();
+
+  my $img = gimp_image_new (256, 100, RGB_IMAGE);
+  $drawable->get_image->selection_all;
+  $drawable->edit_copy;
+  gimp_selection_none ($image);
+  if ($rad_tog == 0) {
+         my $bg_layer;
+         $bg_layer=$img->layer_new($drawable->width,$drawable->height,$image->layertype(1), "Background", 
100, NORMAL_MODE);
+         Gimp::Context->set_background ($bg_col);
+         $bg_layer->drawable_fill(BACKGROUND_FILL);
+         $img->insert_layer($bg_layer,0,0);
+  }
+  $img->resize($drawable->width,$drawable->height, 0, 0);
+  my $text1_lay;
+  $text1_lay=$img->layer_new($drawable->width,$drawable->height,$image->layertype(1), "Text -1-", 100, 
NORMAL_MODE);
+  $img->insert_layer($text1_lay,0,-1);
+  gimp_edit_clear ($text1_lay);
+  $text1_lay->edit_paste(0)->floating_sel_anchor;
+  if ($api22) {
+    $text1_lay->set_preserve_trans(1);
+  }
+  elsif ($api23) {
+    $text1_lay->set_lock_alpha(1);
+  }
+  Gimp::Context->set_foreground ($bl1);
+  Gimp::Context->set_background ($bl2);
+  @start = ($text1_lay->width / 2 - 5, 0);
+  @end = ($text1_lay->width / 2 + 5, $text1_lay->height);
+  gimp_edit_blend ($text1_lay,
+                  FG_BG_RGB_MODE,
+                  NORMAL_MODE,
+                  GRADIENT_LINEAR,
+                  100,
+                  FALSE,
+                  REPEAT_NONE,
+                  FALSE, # reverse
+                  FALSE, # supersampling
+                  2, # recursion levels
+                  0.30, # threshold
+                  FALSE, # dithering
+                  @start, @end);
+  my $text2_lay;
+  $text2_lay=$text1_lay->copy(1);
+  $text2_lay->add_alpha;
+  $img->insert_layer($text2_lay, 0, -1);
+  Gimp::Context->set_background ([255, 255, 255]);
+  $text2_lay->edit_fill(BACKGROUND_FILL);
+  if ($api22) {
+    $text1_lay->set_preserve_trans(0);
+    $text2_lay->set_preserve_trans(0);
+  }
+  elsif ($api23) {
+    $text1_lay->set_lock_alpha(0);
+    $text2_lay->set_lock_alpha(0);
+  }
+  plug_in_gauss_rle ($text2_lay, 6, 1, 1);
+  plug_in_bump_map ($img, $text1_lay, $text2_lay, 110.0, $elev, $depth, 0, 0, 0, 0, 0, 0, 0);
+  $text2_lay->invert;
+  $img->lower_item($text2_lay);
+  $text2_lay->translate(2, 3);
+  $text2_lay->set_opacity(75);
+  if ($rad_tog == 1) {
+         $img->flatten;
+         gimp_image_convert_indexed ($img, 0, MAKE_PALETTE, 256, 0, 0, "");
+         my $new = gimp_image_get_active_drawable ($img);
+         gimp_layer_add_alpha ($new);
+         gimp_context_set_sample_threshold(55);
+         gimp_context_set_antialias(0);
+         gimp_context_set_feather(0);
+         gimp_context_set_feather_radius(0);
+         gimp_context_set_sample_merged(0);
+         gimp_image_select_color ($img, CHANNEL_OP_ADD, $new, [255, 255, 255]);
+         gimp_edit_clear ($new);
+         gimp_selection_none ($img);
+  } else {
+         $img->flatten;
+  }
 #      gimp_display_new ($img);
-       ();
-}
-$help=<<EOF.$help;
+  ();
+};
+exit main;
+__END__
+
+=head1 NAME
+
+make_bevel_logos - A script to get blended beveled logos
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Render/Blended Logo...
+
+=head1 DESCRIPTION
+
 This script will produce a nice blended beveled logo from your alpha
-layer, which must have a black text. You can choose the initial and finals colours
-of the blend, the background, and how to tweak the bevel effect.
+layer, which must have a black text. You can choose the initial and finals
+colours of the blend, the background, and how to tweak the bevel effect.
 It uses a techinque quite similar to that in the Inner Bevel Logo.
 
-EOF
-
-register "make_bevel_logos",
-        "A script to get blended beveled logos",
-        $help,
-        "Michele Gherlone <mikem\ enet it>",
-        "(c) 2000 M. Gherlone",
-        "20000130",
-        N_"<Image>/Filters/Render/Blended Logo...",
-        "RGBA",
-        [
-          [PF_COLOUR   , 'choose_bg_colour', "Choose the background colour", [255, 255, 255]],
-          [PF_COLOUR   , 'blend_start',  "Choose the 1st blend colour", [247, 231, 9]],
-          [PF_COLOUR   , 'blend_stop',   "Choose the 2nd blend colour", [255, 0, 0]],
-          [PF_SLIDER   , 'strength_of_bevel', "Strength of bevel", 45.00, [0.00, 60.00, 0.50]],
-          [PF_SLIDER   , 'depth_of_bevel', "Depth of bevel", 4, [0, 60, 1]],
-          [PF_RADIO    , 'user_choice', "The user's choice", 0, [Background => 0, Transparent => 1]],
-        ],
-        \&my_innerbevel;
-exit main;
+=head1 PARAMETERS
 
-=head1 LICENSE
+ [PF_COLOUR    , 'bg_col', "Choose the background colour", [255, 255, 255]],
+ [PF_COLOUR    , 'bl1',  "Choose the 1st blend colour", [247, 231, 9]],
+ [PF_COLOUR    , 'bl2',   "Choose the 2nd blend colour", [255, 0, 0]],
+ [PF_SLIDER    , 'elev', "Strength of bevel", 45.00, [0.00, 60.00, 0.50]],
+ [PF_SLIDER    , 'depth', "Depth of bevel", 4, [0, 60, 1]],
+ [PF_RADIO     , 'rad_tog', "The user's choice", 0, [Background => 0, Transparent => 1]],
 
-Copyright Michele Gherlone.
+=head1 IMAGE TYPES
 
-Unknown license status.
+RGBA
+
+=head1 AUTHOR
+
+Michele Gherlone <mikem enet it>
 
-=cut
+=head1 DATE
 
+20000130
+
+=head1 LICENSE
+
+(c) 2000 Michele Gherlone.
+
+Unknown license status.
diff --git a/examples/blowinout b/examples/blowinout
index b93812c..6e019f0 100755
--- a/examples/blowinout
+++ b/examples/blowinout
@@ -1,42 +1,34 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
-# Blow In/Out
-# John Pitney
-
-use Gimp qw(:auto __ N_);
+use Gimp;
 use Gimp::Fu;
-
-# print "hello there\n";
+use strict;
 
 # Gimp::set_trace(TRACE_CALL);
 
-
-sub blowinout {
-    my ($img, $drawable, $angle, $nsteps, $distance, $inmode, $arithmode) = @_;
+podregister {
     # bail out if $drawable isn't a layer
+    die "Not a layer\n" unless $drawable->is_layer;
+    $drawable->become('Gimp::Layer');
 #    print "Starting\n";
-    if( gimp_selection_is_empty($img) == 0) { return };
+    if( $image->selection_is_empty == 0) { return };
 #    if ($nsteps == 0) return;
-    eval { $img->undo_group_start };
-    # save the background color for later restoration
-    my $oldbg = gimp_context_get_background();
+    eval { $image->undo_group_start };
+    Gimp::Context->push();
     #get the drawable dimensions
-    my $xsize = gimp_drawable_width($drawable);
-    my $ysize = gimp_drawable_height($drawable);
+    my $xsize = $drawable->width;
+    my $ysize = $drawable->height;
 
     # Set background color to 128, for clearing dm
-    gimp_context_set_background([128,128,128]);
+    Gimp::Context->set_background([128,128,128]);
 
     # Create a grayscale workspace image for displacement map
-    my $dm = gimp_image_new($xsize, $ysize, 1);
+    my $dm = Gimp::Image->new($xsize, $ysize, 1);
     eval { $dm->undo_group_start };
     # It needs to have 2 layers
-    my $dmlayer = gimp_layer_new($dm, $xsize, $ysize, GRAY_IMAGE, "newlayer",
+    my $dmlayer = Gimp::Layer->new($dm, $xsize, $ysize, GRAY_IMAGE, "newlayer",
         100, NORMAL_MODE);
-    gimp_image_insert_layer($dm, $dmlayer, 0, 0);
+    $dm->insert_layer($dmlayer, 0, 0);
 
     # Create the layers, one-by-one
     my $i = 1;
@@ -46,16 +38,14 @@ sub blowinout {
     my $ydist = ($arithmode) ?
         $i * $distance / $nsteps * sin($angle * 3.14159 / 180) :
         $distance ** ($i/$nsteps) * sin($angle * 3.14159 / 180);
-    gimp_edit_clear($dmlayer);
-    plug_in_noisify($dm, $dmlayer, 0, 255, 255, 255, 0);
-    gimp_levels($dmlayer, 0, 0, 255, 1.0, 128, 255);
-    $drawable = gimp_layer_copy($drawable, 0);
-    gimp_image_insert_layer($img, $drawable, 0, -1);
-    plug_in_displace($img, $drawable, $xdist, $ydist, 1, 1, $dmlayer,
-        $dmlayer, 1);
-    if ( $inmode == 1 )
-    {
-        gimp_image_lower_item($img, $drawable);
+    $dmlayer->edit_clear;
+    $dmlayer->noisify(0, 255, 255, 255, 0);
+    $dmlayer->levels(0, 0, 255, 1.0, 128, 255);
+    $drawable = $drawable->copy(0);
+    $image->insert_layer($drawable, 0, -1);
+    $drawable->displace($xdist, $ydist, 1, 1, $dmlayer, $dmlayer, 1);
+    if ( $inmode == 1 ) {
+        $image->lower_item($drawable);
     };
     for ( $i = 2; $i <= $nsteps; $i++ ) {
         $xdist = ($arithmode) ?
@@ -64,52 +54,65 @@ sub blowinout {
         $ydist = ($arithmode) ?
             $i * $distance / $nsteps * sin($angle * 3.14159 / 180) :
             $distance ** ($i/$nsteps) * sin($angle * 3.14159 / 180);
-        gimp_edit_clear($dmlayer);
-        plug_in_noisify($dm, $dmlayer, 0, 255, 255, 255, 0);
-        gimp_levels($dmlayer, 0, 0, 255, 1.0, 128, 255);
-        $drawable = gimp_layer_copy($drawable, 0);
-        gimp_image_insert_layer($img, $drawable, 0, -1);
-        plug_in_displace($img, $drawable, $xdist, $ydist, 1, 1, $dmlayer,
-            $dmlayer, 1);
-        if ( $inmode == 1 )
-        {
-            gimp_image_lower_item($img, $drawable);
+        $dmlayer->edit_clear;
+        $dmlayer->noisify(0, 255, 255, 255, 0);
+        $dmlayer->levels(0, 0, 255, 1.0, 128, 255);
+       $drawable = $drawable->copy(0);
+       $image->insert_layer($drawable, 0, -1);
+       $drawable->displace($xdist, $ydist, 1, 1, $dmlayer, $dmlayer, 1);
+        if ( $inmode == 1 ) {
+           $image->lower_item($drawable);
         };
     }
 
     eval { $dm->undo_group_end };
 #    gimp_image_remove_layer($dm, $dmlayer);
 #    gimp_image_delete ($dm);
-    gimp_context_set_background($oldbg);
-    eval { $img->undo_group_end };
+    Gimp::Context->pop;
+    eval { $image->undo_group_end };
 #    gimp_displays_flush(); unneccessary (and dangerous ;)
 
     (); # I like smileys ;)
-}
-
-register
-       "blowinout",
-       "Blow selected layer inout",
-       "Generates an animation thats blows the selected layer in or out",
-       "John Pitney",
-       "John Pitney <john\ pitney org>",
-       "1999-03-15",
-       N_"<Image>/Filters/Animation/BlowInOut...",
-       "*",
-       [
-        [PF_INT32, "angle", "Wind Angle, 0 is left", 120],
-         [PF_INT32, "steps", "Number of Steps/Layers", 5],
-        [PF_VALUE, "distance", "How far to blow",30],
-        [PF_RADIO, "direction", "Blow direction", 0, [In => 1, Out => 0]],
-         [PF_RADIO, "series", "Kind of series", 1, [Arithmetic => 1, Geometric => 0]]
-       ],
-        [],
-       \&blowinout;
+};
 
 exit main;
 
+__END__
+
+=head1 NAME
+
+blowinout - Blow selected layer in/out
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Animation/BlowInOut...
+
+=head1 DESCRIPTION
+
+Generates an animation thats blows the selected layer in or out.
+
+=head1 PARAMETERS
+
+ [PF_INT32, "angle", "Wind Angle, 0 is left", 120],
+ [PF_INT32, "nsteps", "Number of Steps/Layers", 5],
+ [PF_VALUE, "distance", "How far to blow",30],
+ [PF_RADIO, "inmode", "Blow direction", 0, [In => 1, Out => 0]],
+ [PF_RADIO, "arithmode", "Kind of series", 1, [Arithmetic => 1, Geometric => 0]]
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+John Pitney <john pitney org>
+
+=head1 DATE
+
+1999-03-15
+
 =head1 LICENSE
+
 Copyright John Pitney.
 
 Released under the same terms as Gimp-Perl.
-=cut
diff --git a/examples/bricks b/examples/bricks
index 8f6413b..578b91b 100755
--- a/examples/bricks
+++ b/examples/bricks
@@ -1,104 +1,85 @@
 #!/usr/bin/perl
 
-# [10/27/1999] v0.0.1 First version.
-
-# (c) Copyright by Tels www.bloodgate.com 1999.
-
-# generate a brick texture for using in 3d games
-#
-# params: brick width/height, brick pattern, random light skew, border color
-#
-# 12/5/03: <sjburges gimp org> updated to use gimp_image_get_floating_sel,
-# rather than gimp_image_floating_sel, gimp_undo_push/gimp_image_undo_push
-#
-# 25/2/04: <sjburges gimp org> changed color specifiers.  Reordered so that
-# pasting happens after layer mask is attached to image.  Removed harmful
-# gimp_layer_delete() calls. s/gimp_channel_ops_offset/gimp_drawable_offset/.
-#
-# The plug-in is certainly incomplete, with unused parameters, artficial limiation
-# on max/min size (which silently moves it to 256?). Doesn't save/restore current
-# gimp pattern/colors before setting them.  Otherwise, it seems to work OK now :)
-
-use Gimp qw(:auto N_);
+use Gimp;
 use Gimp::Fu;
 use Gimp::Util;
 
-sub do_bricks {
-    my ($pattern,$pattern2,$bp,$clr,$bw,$brickx,$bricky,$imgw,$imgh,$skew) = @_;
+podregister {
+    my ($pattern,$pattern2,$borderpattern,$color,$borderwidth,$brickx,$bricky,$imagew,$imageh,$skew) = @_;
     my ($image, $layer, $state, $layerpat);
-    gimp_context_push();
+    Gimp::Context->push();
 
-    $imgw = abs($imgw); $imgw = 256 if (($imgw < 32) || ($imgw > 4096));
-    $imgh = abs($imgh); $imgh = 256 if (($imgh < 32) || ($imgh > 4096));
-    #print "Creating texture $imgw"."x$imgh\n";
-    $image = gimp_image_new($imgw,$imgh,RGB);
+    $imagew = abs($imagew); $imagew = 256 if (($imagew < 32) || ($imagew > 4096));
+    $imageh = abs($imageh); $imageh = 256 if (($imageh < 32) || ($imageh > 4096));
+    #print "Creating texture $imagew"."x$imageh\n";
+    $image = Gimp::Image->new($imagew,$imageh,RGB);
     # make background
-    gimp_context_set_pattern($pattern);
-    $layerpat = gimp_image_add_new_layer($image,0,0,0);
-    gimp_selection_all($image);
-    gimp_edit_bucket_fill($layerpat,2,0,100,0,0,1,1);
+    Gimp::Context->set_pattern($pattern);
+    $layerpat = $image->add_new_layer(0,0,0);
+    $image->selection_all;
+    $layerpat->edit_bucket_fill(2,0,100,0,0,1,1);
 
     # make border lines
-    gimp_context_set_foreground ([1,1,1]);
-    $layer = gimp_image_add_new_layer($image,0,0,0);
-    gimp_drawable_fill($layer,3);
+    Gimp::Context->set_foreground ([1,1,1]);
+    $layer = $image->add_new_layer(0,0,0);
+    $layer->fill(3);
     my $w = 1; my $h = 1; my $j = 0; my $wo = 0;
-    my $brickw = ($imgw / $brickx); my $brickh = ($imgh / $bricky);
-    gimp_image_undo_group_start($image);
-    while ($h < $imgh)
+    my $brickw = ($imagew / $brickx); my $brickh = ($imageh / $bricky);
+    $image->undo_group_start;
+    while ($h < $imageh)
       {
-      gimp_image_select_rectangle($image,2,0,$h,$imgw,$bw);
-      gimp_edit_bucket_fill($layer,0,0,100,0,0,0,0);
+      $image->select_rectangle(2,0,$h,$imagew,$borderwidth);
+      $layer->edit_bucket_fill(0,0,100,0,0,0,0);
       $w = 1;
       $wo = 0; $wo = ($brickw / 2) if ($j == 1);
-      while ($w < $imgw)
+      while ($w < $imagew)
         {
-        gimp_image_select_rectangle($image,2,$w+$wo,$h,$bw,$brickh+1);
-        gimp_edit_bucket_fill($layer,0,0,100,0,0,1,1);
+        $image->select_rectangle(2,$w+$wo,$h,$borderwidth,$brickh+1);
+        $layer->edit_bucket_fill(0,0,100,0,0,1,1);
 #        print "$h $w\n";
         $w += $brickw;
         }
       $j = 1 - $j;
       $h += $brickh;
       }
-    gimp_image_undo_group_end($image);
+    $image->undo_group_end;
     # make a copy of it for bump mapping
-    gimp_selection_all($image);
+    $image->selection_all;
     $layer->edit_copy();
-    $border = gimp_image_add_new_layer($image,0,0,0);
+    $border = $image->add_new_layer(0,0,0);
     #print "$border\n";
     $border->edit_paste(0);
-    gimp_floating_sel_anchor(gimp_image_get_floating_sel($image));
-    gimp_selection_none($image);
+    $image->floating_sel_anchor($image->get_floating_sel);
+    $image->selection_none;
     # somebody seems to have changed the parameter for the following 3 lines
     # omy office machine use the old variant, at home I need the new :(
     # Changed text:
     #plug_in_gauss_iir (1,$image,$border,1,1,1);
     #plug_in_gauss_iir (1,$image,$layer,2,1,1);
     #plug_in_bump_map (1,$image,$layerpat,$layer,257,40,3,0,0,0,0,1,0,1);
-    plug_in_gauss_iir (1,$border,1,1,1);
-    plug_in_gauss_iir (1,$layer,2,1,1);
-    plug_in_bump_map (1,$layerpat,$layer,280,40,2,0,0,0,0,1,0,1);
+    $border->gauss_iir (2,1,1);
+    $layer->gauss_iir (2,1,1);
+    $layer->bump_map(280,40,2,0,0,0,0,1,0,1);
     # overlay border lines and random skew bricks
-    gimp_image_undo_group_start($image);
+    $image->undo_group_start;
     $h = 0; $j = 0; $wo = 0;
-    while ($h < $imgh)
+    while ($h < $imageh)
       {
       $w = 0; $wo = 0; $wo = ($brickw / 2) if ($j == 1);
-      while ($w < $imgw)
+      while ($w < $imagew)
         {
         $r = int(rand ($skew) - ($skew / 1));
         if ($r != 0)
           {
-          gimp_context_set_foreground ("#ffffff") if ($r > 0);
-          gimp_context_set_foreground ("#000000") if ($r < 0);
-          gimp_image_select_rectangle($image,2,$w+$wo+$bp,$h+$bp,$brickw,$brickh);
-          gimp_edit_bucket_fill($layerpat,0,0,4*abs($r),0,0,1,1);
+         Gimp::Context->set_foreground ("#ffffff") if ($r > 0);
+         Gimp::Context->set_foreground ("#000000") if ($r < 0);
+          $image->select_rectangle(2,$w+$wo+$borderpattern,$h+$borderpattern,$brickw,$brickh);
+          $layerpat->edit_bucket_fill(0,0,4*abs($r),0,0,1,1);
           # halves
-          if (($j == 1) && ($w+$wo+$brickw > $imgw))
+          if (($j == 1) && ($w+$wo+$brickw > $imagew))
             {
-            gimp_image_select_rectangle($image,2,0,$h+$bp,$brickw/2,$brickh);
-            gimp_edit_bucket_fill($layerpat,0,0,4*abs($r),0,0,1,1);
+            $image->select_rectangle(2,0,$h+$borderpattern,$brickw/2,$brickh);
+            $layerpat->edit_bucket_fill(0,0,4*abs($r),0,0,1,1);
             }
           }
         $w += $brickw;
@@ -106,62 +87,91 @@ sub do_bricks {
       $j = 1 - $j;
       $h += $brickh;
       }
-    gimp_image_undo_group_end($image);
-    gimp_context_set_background ($clr);
-    $layerb = gimp_image_add_new_layer($image,1,BACKGROUND_FILL,0);
-    gimp_selection_all($image);
-    if ($bp ne "")
-      {
-      gimp_context_set_pattern($bp);
-      gimp_edit_bucket_fill($layerb,2,0,100,0,0,1,1);
-      }
+    $image->undo_group_end;
+    Gimp::Context->set_background ($color);
+    $layerb = $image->image_add_new_layer(1,BACKGROUND_FILL,0);
+    $image->selection_all;
+    if ($borderpattern ne "") {
+      Gimp::Context->set_pattern($borderpattern);
+      $layerb->edit_bucket_fill(2,0,100,0,0,1,1);
+    }
     $border->edit_copy();
-    gimp_layer_add_alpha($layerb);
-    $mask = gimp_layer_create_mask($layerb,0);
-    gimp_layer_add_mask($layerb,$mask);
+    $layerb->add_alpha;
+    $mask = $layerb->create_mask(0);
+    $layerb->add_mask($mask);
     $mask->edit_paste(0);
-    gimp_floating_sel_anchor(gimp_image_get_floating_sel($image));
-    gimp_selection_none($image);
-    gimp_image_remove_layer ($border);
-    gimp_image_remove_layer ($layer);
-    gimp_layer_remove_mask ($layerb,0);
-    gimp_drawable_offset ($layerpat,1,0,-1,-1);
-    gimp_drawable_offset ($layerb,1,0,-1,-1);
-    gimp_context_pop();
-    gimp_display_new($image);
+    $image->floating_sel_anchor($image->get_floating_sel);
+    $image->selection_none;
+    $border->remove_layer ;
+    $layer->remove_layer ;
+    $layerb->remove_mask (0);
+    $layerpat->offset (1,0,-1,-1);
+    $layerb->offset (1,0,-1,-1);
+    Gimp::Context->pop();
+    Gimp::Display->new($image);
 
     $image;
-}
-
-register
-        "do_bricks",
-        "Generate brick texture",
-        "Try it out",
-        "Tels",
-        "http://bloodgate.com";,
-        "10/26/1999a",
-        N_"<Image>/File/Create/Patterns/Bricks...",
-        undef,
-        [
-         [PF_PATTERN,  "background", "Brick pattern", "Leather"],
-         [PF_STRING,  "highlight", "Second brick pattern for some highlightin (unused)", "unused yet"],
-         [PF_STRING,  "borderpattern", "Border pattern (empty for none)", ""],
-         [PF_COLOR,   "color", "Border color", [0.80,0.80,0.80]],
-         [PF_SPINNER,  "borderwidth", "Border width", 1, [0,1000,1]],
-         [PF_STRING,  "brickx", "Bricks in X", 8],
-         [PF_STRING,  "bricky", "Bricks in Y", 16],
-         [PF_STRING,  "imagew", "Width of image", 256],
-         [PF_STRING,  "imageh", "Height of image", 256],
-         [PF_STRING,  "skew", "Random darken/lighten factor (0..20)", 0]
-        ],
-        \&do_bricks;
+};
 
 exit main();
+__END__
+
+=head1 NAME
+
+do_bricks - Generate brick texture
+
+=head1 SYNOPSIS
+
+<Image>/File/Create/Patterns/Bricks...
+
+=head1 DESCRIPTION
+
+Generate a brick texture for using in 3d games.
+
+=head1 PARAMETERS
+
+ [PF_PATTERN,  "pattern", "Brick pattern", "Leather"],
+ [PF_STRING,  "pattern2", "Second brick pattern for some highlightin (unused)", "unused yet"],
+ [PF_STRING,  "borderpattern", "Border pattern (empty for none)", ""],
+ [PF_COLOR,   "color", "Border color", [0.80,0.80,0.80]],
+ [PF_SPINNER,  "borderwidth", "Border width", 1, [0,1000,1]],
+ [PF_STRING,  "brickx", "Bricks in X", 8],
+ [PF_STRING,  "bricky", "Bricks in Y", 16],
+ [PF_STRING,  "imagew", "Width of image", 256],
+ [PF_STRING,  "imageh", "Height of image", 256],
+ [PF_STRING,  "skew", "Random darken/lighten factor (0..20)", 0]
+
+=head1 IMAGE TYPES
+
+=head1 AUTHOR
+
+Tels
+
+=head1 HISTORY
+
+[10/27/1999] v0.0.1 First version.
+
+params: brick width/height, brick pattern, random light skew, border color
+
+12/5/03: <sjburges gimp org> updated to use gimp_image_get_floating_sel,
+rather than gimp_image_floating_sel, gimp_undo_push/gimp_image_undo_push
+
+25/2/04: <sjburges gimp org> changed color specifiers.
+Reordered so that pasting happens after layer mask is
+attached to image.  Removed harmful gimp_layer_delete()
+calls. s/gimp_channel_ops_offset/gimp_drawable_offset/.
+
+The plug-in is certainly incomplete, with unused parameters, artficial
+limiation on max/min size (which silently moves it to 256?). Doesn't
+save/restore current gimp pattern/colors before setting them.  Otherwise,
+it seems to work OK now :)
+
+=head1 DATE
+
+10/26/1999
 
 =head1 LICENSE
 
-Copyright Tels.
+(c) Copyright by Tels www.bloodgate.com 1999.
 
 Licenced under the GNU Public License.
-
-=cut
diff --git a/examples/burst b/examples/burst
index cff68af..7a934fb 100755
--- a/examples/burst
+++ b/examples/burst
@@ -1,49 +1,8 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
-# <sjburges gimp org>
-#
 use Gimp;
 use Gimp::Fu;
 use Gimp::Util;
-
-# This script was requested by jimmac, and I thought it sounded moderately
-# useful.  I could have just made a couple selection masks and made it
-# moderately useful, but instead I redid all the math myself to make it
-# intresting and have a really nice effect on the end points (rather than
-# chopping off odd-shaped brushes when the ellipse ends).
-
-# Its good to exercise the ol geometry skills every now and then ;)
-# Enjoy,
-#  Seth Burgess <sjburges gimp org>
-
-####-----
-# Revision 03/18/2000
-#  Changed second angle to be a sweep measurement, not an absolute angle (I
-#  found that I was calculating a lot more by hand than I should be when
-#  using it)
-#
-#  Also fixed up a bug that I'd covered up, and did a decent for loop for
-#  a change.  Fixed up rectangle to not mess up on corner areas.
-#
-#  Lastly, I added a special case for 360 degrees - don't redraw the last
-#  line for a full circle; instead re-adjust end point.  I'm not entirely
-#  happy with this solution, but its close to what I expect to happen.  I
-#  don't desire to litter the interface with more strange options if possible
-#  and I suspect most users will never notice.
-#
-
-####-----
-# Revision 08/10/2003
-#  Changed PF_SLIDER to PF_SPINNER, since they're a whole lot nicer to work with
-#  for this type of operation - getting it "close" is pretty annoying with
-#  sliders.
-
 # Gimp::set_trace(TRACE_ALL);
 
 # find an equivalent polar value in the range of 0 to 2 pi
@@ -57,56 +16,28 @@ sub find_in_2pi
   return ($ang - int($ang/(2*3.1415926))*2*3.1415926);
 }
 
-# actual script
-
-register "burst",
-  "Bursts from a central location\n",
-  "Creates a Burst of various sizes from the center of the currently
-selected areas.  Can create either an elliptical burst, or some portion
-of said burst.  Also, you can specify how much (in pixels) to leave blank on
-the inside and the outside of the burst.  This uses whatever the current
-brush settings are, and lets you control which direction to have it draw the
-fades from if you have Fade set\n",
-  "Seth Burgess",
-  "Seth Burgess <sjburges\ gimp org>",
-  "1999-07-31",
-  N_"<Image>/Filters/Render/Burst...",
-  "*",
-  [
-   [PF_RADIO, "shape", "Shape To Burst Into", 0,  [Rectangle => 1, Ellipse=> 0]],
-   [PF_RADIO, "fade_dir", "Fade Direction (if fade is set)", 0,  [In => 1, Out => 0]],
-   [PF_VALUE, 'spokes', "How many spokes", 16],
-   [PF_VALUE, 'inside_pixels', "Inside Pixels", 10],
-   [PF_VALUE, 'outside_pixels', "Outside Pixels", 10],
-   [PF_SPINNER, 'start_angle', "Angle to start at, with 0 being left, and sweeping counter-clockwise.", 0, 
[-360, 360, 1]],
-   [PF_SPINNER, 'arc_angle', "How many degrees to arc through.", 360, [-360, 360, 1]]
-  ],
-  [],
-  sub {
-    my($img,$layer, $shape, $fade_dir, $points,
-       $inside_pixels, $outside_pixels, $start_angle, $arc_angle) = _;
-
+podregister {
     $pi = 3.1415927;
 
     # Special case 360
     if (abs($arc_angle) == 360)
       {
-        $end_angle = $start_angle + $arc_angle - abs ($arc_angle/$points);
+        $end_angle = $start_angle + $arc_angle - abs ($arc_angle/$spokes);
       }
     else
       {
         $end_angle = $start_angle + $arc_angle;
       }
 
-    eval { $img->undo_group_start };
+    eval { $image->undo_group_start };
 
     Gimp->progress_init("Burst");
-    $progress_increment = 1/$points;
+    $progress_increment = 1/$spokes;
     $progress = 0;
 
     my $dumb;
-    ($dumb, $x1, $y1, $x2, $y2) = $img->selection_bounds;
-    # $img->selection_none;
+    ($dumb, $x1, $y1, $x2, $y2) = $image->selection_bounds;
+    # $image->selection_none;
 
     $width = $x2 - $x1;
     $height = $y2 - $y1;
@@ -124,13 +55,13 @@ fades from if you have Fade set\n",
 
     if ($shape == 0)
       { #ellipse
-        # do $points worth
+        # do $spokes worth
         for ($i = 0;
-             $i < $points;
+             $i < $spokes;
             #$angle <$end_angle*$pi/180-0.01;
              $i++ )
           {
-            $angle = $i * abs($start_angle-$end_angle)*$pi/($points-1)/180;
+            $angle = $i * abs($start_angle-$end_angle)*$pi/($spokes-1)/180;
             $angle += $start_angle*$pi/180;
 
             # use the major/minor axis description of an ellipse:
@@ -183,11 +114,11 @@ fades from if you have Fade set\n",
 
             if ($fade_dir == 1)
               {
-                $layer->paintbrush_default(4, [$x, $y, $x_start, $y_start]);
+                $drawable->paintbrush_default(4, [$x, $y, $x_start, $y_start]);
               }
             else
               {
-                $layer->paintbrush_default(4, [$x_start, $y_start, $x, $y]);
+                $drawable->paintbrush_default(4, [$x_start, $y_start, $x, $y]);
               }
             $progress += $progress_increment;
             Gimp->progress_update($progress);
@@ -202,10 +133,10 @@ fades from if you have Fade set\n",
         #print "width = $width, height = $height\n";
 
         for ($i = 0;
-             $i < $points;
+             $i < $spokes;
              $i++ )
           {
-            $angle = $i * abs($start_angle-$end_angle)*$pi/($points-1)/180;
+            $angle = $i * abs($start_angle-$end_angle)*$pi/($spokes-1)/180;
             $angle += $start_angle*$pi/180;
 
             # get the slope
@@ -263,25 +194,95 @@ fades from if you have Fade set\n",
           $y_start = $y_start + $center_y;
           if ($fade_dir == 1)
             {
-              $layer->paintbrush_default(4, [$x, $y, $x_start, $y_start]);
+              $drawable->paintbrush_default(4, [$x, $y, $x_start, $y_start]);
             }
           else
             {
-              $layer->paintbrush_default(4, [$x_start, $y_start, $x, $y]);
+              $drawable->paintbrush_default(4, [$x_start, $y_start, $x, $y]);
             }
           $progress += $progress_increment;
           Gimp->progress_update($progress);
         }
     }
-  eval { $img->undo_group_end };
+  eval { $image->undo_group_end };
   return();
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+burst - Bursts from a central location
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Render/Burst...
+
+=head1 DESCRIPTION
+
+Creates a Burst of various sizes from the center of the currently
+selected areas.  Can create either an elliptical burst, or some portion
+of said burst.  Also, you can specify how much (in pixels) to leave blank on
+the inside and the outside of the burst.  This uses whatever the current
+brush settings are, and lets you control which direction to have it draw the
+fades from if you have Fade set
+
+=head1 PARAMETERS
+
+ [PF_RADIO, "shape", "Shape To Burst Into", 0,  [Rectangle => 1, Ellipse=> 0]],
+ [PF_RADIO, "fade_dir", "Fade Direction (if fade is set)", 0,  [In => 1, Out => 0]],
+ [PF_VALUE, 'spokes', "How many spokes", 16],
+ [PF_VALUE, 'inside_pixels', "Inside Pixels", 10],
+ [PF_VALUE, 'outside_pixels', "Outside Pixels", 10],
+ [PF_SPINNER, 'start_angle', "Angle to start at, with 0 being left, and sweeping counter-clockwise.", 0, 
[-360, 360, 1]],
+ [PF_SPINNER, 'arc_angle', "How many degrees to arc through.", 360, [-360, 360, 1]]
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Seth Burgess
+
+=head1 DATE
+
+1999-07-31
+
+=head1 HISTORY
+
+This script was requested by jimmac, and I thought it sounded moderately
+useful.  I could have just made a couple selection masks and made it
+moderately useful, but instead I redid all the math myself to make it
+interesting and have a really nice effect on the end points (rather than
+chopping off odd-shaped brushes when the ellipse ends).
+
+Its good to exercise the ol geometry skills every now and then ;)
+Enjoy,
+Seth Burgess <sjburges gimp org>
+
+Revision 03/18/2000
+Changed second angle to be a sweep measurement, not an absolute angle (I
+found that I was calculating a lot more by hand than I should be when
+using it)
+
+Also fixed up a bug that I'd covered up, and did a decent for loop for
+a change.  Fixed up rectangle to not mess up on corner areas.
+
+Lastly, I added a special case for 360 degrees - don't redraw the last
+line for a full circle; instead re-adjust end point.  I'm not entirely
+happy with this solution, but its close to what I expect to happen.  I
+don't desire to litter the interface with more strange options if possible
+and I suspect most users will never notice.
+
+Revision 08/10/2003
+Changed PF_SLIDER to PF_SPINNER, since they're a whole lot nicer to work with
+this type of operation - getting it "close" is pretty annoying with
+sliders.
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
-Distributed under the same terms as Gimp-Perl.
+Seth Burgess <sjburges gimp org>
 
-=cut
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/centerguide b/examples/centerguide
index 817eb58..a32639c 100755
--- a/examples/centerguide
+++ b/examples/centerguide
@@ -1,8 +1,5 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
 # 7/15/03 <sjburges gimp org>
 # Changed spot that its registered from <Image>/Guides to <Image>/Image/Guides
 # to reduce horizontal clutter on menubar
@@ -10,43 +7,56 @@ eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 
-register       "center_guide",
-               "Creates h- & v-guides at the center of the image.",
-               "Physical center = width/2 and height/2; Optical center = the Golden Mean.",
-               "Claes G Lindblad <claesg\ algonet se>",
-               "Claes G Lindblad",
-               "990323",
-               N_"<Image>/Image/Guides/Center Guide...",
-               "*",
-               [
-               [PF_RADIO,
-                       "center",
-                       "center",
-                        0,
-                       [Physical => 0, Optical => 1]
-               ]
-               ],
+podregister
        sub {
-               my ($img, $layer, $center) = @_;
+               my ($image, $drawable, $center) = @_;
 
-               $w = $img->width();
-               $h = $img->height();
+               $w = $image->width();
+               $h = $image->height();
                $hc = int($h/2 + 0.5);
                $vc = int($w/2 + 0.5);
 
                if ($center == 1) {
                        $hc = int(($h / 2.6179) + 0.5);
                };
-                $img->undo_group_start;
-               $bit_bucket = $img->add_hguide($hc);
-               $bit_bucket = $img->add_vguide($vc);
-               gimp_drawable_update($layer, 0, 0, $w, $h);
-                $img->undo_group_end;
+                $image->undo_group_start;
+               $bit_bucket = $image->add_hguide($hc);
+               $bit_bucket = $image->add_vguide($vc);
+               gimp_drawable_update($drawable, 0, 0, $w, $h);
+                $image->undo_group_end;
        };
 exit main;
+__END__
+
+=head1 NAME
+
+center_guide - Creates h- & v-guides at the center of the image.
+
+=head1 SYNOPSIS
+
+<Image>/Image/Guides/Center Guide...
+
+=head1 DESCRIPTION
+
+Physical center = width/2 and height/2; Optical center = the Golden Mean.
+
+=head1 PARAMETERS
+
+  [PF_RADIO, "center", "center", 0, [Physical => 0, Optical => 1] ]
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Claes G Lindblad <claesg algonet se>
+
+=head1 DATE
+
+990323
+
 =head1 LICENSE
 
 Copyright Claes G Lindblad.
 Distributed under the terms of the GNU Public License.
-
-=cut
diff --git a/examples/colorhtml b/examples/colorhtml
index 9d64f0c..55d1e72 100755
--- a/examples/colorhtml
+++ b/examples/colorhtml
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# pcg goof com
+
 use Gimp;
 use Gimp::Fu;
 use Gimp::UI;
@@ -10,74 +10,52 @@ my %replace = (
   ">" => "&gt;",
 );
 
-register
-  "file_colorhtml_save",
-  "Saves the image as coloured html text",
-  "=pod",
-  "Marc Lehmann",
-  "Marc Lehmann <pcg\ goof com>",
-  "1999-11-22",
-  "<Save>/COLORHTML",
-  "*",
-  [
-    [PF_RADIO, "character_source", "where to take the characters from", 0,
-                 [sourcecode => 0, textfile => 1, textblock => 2]],
-    [
-      PF_FILE, "characters",
-      "the filename to read or the characters to use", ""
-    ],
-    [PF_STRING, "font_size", "the html font size (1..7 or -7 .. +7)", 2],
-    [PF_BOOL, "use_css", "use CSS?", 1],
-    [PF_BOOL, "compatible", "html-4.0 compliance?", 1],
-    [PF_BOOL, "closetag", "add closing tag?", 1],
-  ],
-  sub {
-    my($img,$drawable,$filename,$filename2,$source,$text,$size,$css,$html40,$closetag) = @_;
-    my($new_img,$new_drawable);
-    my $export = Gimp::UI::export_image(
-      $new_img=$img,
-      $new_drawable=$drawable,
-      "COLORHTML",
-      EXPORT_CAN_HANDLE_RGB
-    );
-    die __"Export cancelled" if $export == EXPORT_CANCEL;
-    my ($w,$h) = ($new_drawable->width, $new_drawable->height);
-    Gimp->tile_cache_ntiles($w / Gimp->tile_width + 1);
-    my $io = io($filename) or die __"write '$filename': $!\n";
-    my ($cssfile, $cssio);
-    if ($css) {
-      if ($filename =~ /(.*)\.[^.]+$/) {
-       $cssfile = "$1.css"
-      } elsif ($filename =~ /\.$/) {
-       $cssfile = "${filename}css"
-      } else {
-       $cssfile = "$filename.css"
-      }
-      $cssio = io($cssfile) or die __"write '$cssfile': $!\n";
-    }
-    my $data;
-    if ($source == 0) {
-      seek DATA, 0, 0;
-      local $/;
-      $data = <DATA>;
-    } elsif ($source == 1) {
-      $data = io($text)->all or die "$text: $!\n";
-    } elsif ($source == 2) {
-      $data = $text;
+podregister {
+  my($new_image,$new_drawable);
+  my $export = Gimp::UI::export_image(
+    $new_image=$image,
+    $new_drawable=$drawable,
+    "COLORHTML",
+    EXPORT_CAN_HANDLE_RGB
+  );
+  die __"Export cancelled" if $export == EXPORT_CANCEL;
+  my ($w,$h) = ($new_drawable->width, $new_drawable->height);
+  Gimp->tile_cache_ntiles($w / Gimp->tile_width + 1);
+  my $io = io($filename) or die __"write '$filename': $!\n";
+  my ($cssfile, $cssio);
+  if ($use_css) {
+    if ($filename =~ /(.*)\.[^.]+$/) {
+      $cssfile = "$1.css"
+    } elsif ($filename =~ /\.$/) {
+      $cssfile = "${filename}css"
+    } else {
+      $cssfile = "$filename.css"
     }
-    my @data;
-    $data =~ y/\x21-\x7f//cd;
-    @data = split //, $data;
-    for (@data) { s/([&<>])/$replace{$1}/e; }
-    @data = ("X") x 80 unless @data;
-    my @chars;
-    my $region = $new_drawable->get->pixel_rgn(0, 0, $w, $h, 0, 0);
-    Gimp::Progress->init(__"Saving '$filename' as COLORHTML...");
-    $closetag = $closetag ? "</font>" : "";
-    if ($css) {
-      my $file = $cssfile;
-      $file = $1 if ($cssfile =~ m@/([^/]+)$@);
-      $io->print(<<HEADER);
+    $cssio = io($cssfile) or die __"write '$cssfile': $!\n";
+  }
+  my $data;
+  if ($character_source == 0) {
+    seek DATA, 0, 0;
+    local $/;
+    $data = <DATA>;
+  } elsif ($character_source == 1) {
+    $data = io($characters)->all or die "$characters: $!\n";
+  } elsif ($character_source == 2) {
+    $data = $characters;
+  }
+  my @data;
+  $data =~ y/\x21-\x7f//cd;
+  @data = split //, $data;
+  for (@data) { s/([&<>])/$replace{$1}/e; }
+  @data = ("X") x 80 unless @data;
+  my @chars;
+  my $region = $new_drawable->get->pixel_rgn(0, 0, $w, $h, 0, 0);
+  Gimp::Progress->init(__"Saving '$filename' as COLORHTML...");
+  $closetag = $closetag ? "</font>" : "";
+  if ($use_css) {
+    my $file = $cssfile;
+    $file = $1 if ($cssfile =~ m@/([^/]+)$@);
+    $io->print(<<HEADER);
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
@@ -87,72 +65,116 @@ register
 </head>
 <body><pre>
 HEADER
-     $size = 8 + ($size - 2) * 2;
-     $cssio->print(<<HEADER);
+   $font_size = 8 + ($font_size - 2) * 2;
+   $cssio->print(<<HEADER);
 body {
 width: 100%;
 font-weight: bold;
 font-family: Courier, "Courier New", "Andale Mono", Monaco, monospace;
-font-size: ${size}px;
+font-size: ${font_size}px;
 background-color: #000000;
 color: #ffffff;
 }
 HEADER
+  } else {
+    $io->print("<html><body bgcolor=black>\n<font size=\"$font_size\"><pre>\n");
+  }
+  my %colors;
+  for (my $y = 0; $y < $h; $y++) {
+    my $pel = $region->get_row2 (0, $y, $w);
+    push @chars,@data while @chars < $w;
+    if ($use_css) {
+       $pel =~ s{(...)}{
+         "<span class=\"N".unpack("H*",$1)."\">".shift(@chars)."</span>"
+       }ges;
+       while ($pel =~ /"N([0-9a-fA-F]{6})"/g) {
+          my $color = $1;
+          $cssio->print("span.N$color { color: #$color; background-color: #000000; }\n") unless exists 
$colors{$color};
+          $colors{$color}++;
+       }
+    } elsif ($compatible) {
+       $pel =~ s{(...)}{
+         "<font color=\"#".unpack("H*",$1)."\">".shift(@chars).$closetag;
+       }ges;
     } else {
-      $io->print("<html><body bgcolor=black>\n<font size=\"$size\"><pre>\n");
+       $pel =~ s{(...)}{
+         "<font color=".unpack("H*",$1).">".shift(@chars).$closetag;
+       }ges;
     }
-    my %colors;
-    for (my $y = 0; $y < $h; $y++) {
-      my $pel = $region->get_row2 (0, $y, $w);
-      push @chars,@data while @chars < $w;
-      if ($css) {
-        $pel =~ s{(...)}{
-           "<span class=\"N".unpack("H*",$1)."\">".shift(@chars)."</span>"
-        }ges;
-        while ($pel =~ /"N([0-9a-fA-F]{6})"/g) {
-            my $color = $1;
-            $cssio->print("span.N$color { color: #$color; background-color: #000000; }\n") unless exists 
$colors{$color};
-            $colors{$color}++;
-        }
-      } elsif ($html40) {
-        $pel =~ s{(...)}{
-           "<font color=\"#".unpack("H*",$1)."\">".shift(@chars).$closetag;
-        }ges;
-      } else {
-        $pel =~ s{(...)}{
-           "<font color=".unpack("H*",$1).">".shift(@chars).$closetag;
-        }ges;
-      }
-
-      $io->print($pel,"\n");
-      Gimp::Progress->update($y/$h);
-    }
-    $io->print("</pre>\n</html>\n");
-    $new_img->delete if $export == EXPORT_EXPORT;
-    ();
-  };
+
+    $io->print($pel,"\n");
+    Gimp::Progress->update($y/$h);
+  }
+  $io->print("</pre>\n</html>\n");
+  $new_image->delete if $export == EXPORT_EXPORT;
+  ();
+};
 
 Gimp::on_query {
    Gimp->register_save_handler("file_colorhtml_save", "colorhtml", "");
 };
 exit main;
+__END__
+
+=head1 NAME
+
+file_colorhtml_save - Saves the image as coloured html text
+
+=head1 SYNOPSIS
+
+<Save>/COLORHTML
+
+=head1 DESCRIPTION
+
+Saves the image as coloured html text.
+
 =head1 COLORHTML FILE FORMAT
+
 This file save filter writes a large regular grid filled with coloured
 characters. The characters can be stored in file and don't have anything to do
 with the image. The colour of each character, though, is taken from the image
 to save.
+
 This creates some kind of mosaic effect with characters.
 The pictures should be limited to about 120x120 pixels, since most
 browsers do not view larger images. The aspect ratio depends on the
 fixed-width font the browser is using, and is usually around 2:1 (so you
 should squash your image accordingly).
+
 The FONT tags can be saved either HTML-4.0 compliant (C<font color="#rrggbb">)
 or in a proprietary format most browsers support (C<font color=rrggbb>).
 To save even more space you can leave out the closing tag (C</font>),
 but this will potentially leave thousands of font elements open in the browser,
 and will disturb the current font colour.
+
+=head1 PARAMETERS
+
+  [PF_RADIO,   "character_source", "where to take the characters from", 0,
+               [sourcecode => 0, textfile => 1, textblock => 2]],
+  [
+    PF_FILE,   "characters",
+    "the filename to read or the characters to use", ""
+  ],
+  [PF_STRING, "font_size", "the html font size (1..7 or -7 .. +7)", 2],
+  [PF_BOOL, "use_css", "use CSS?", 1],
+  [PF_BOOL, "compatible", "html-4.0 compliance?", 1],
+  [PF_BOOL, "closetag", "add closing tag?", 1],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Marc Lehmann <pcg goof com>
+
+=head1 DATE
+
+1999-11-22
+
 =head1 LICENSE
-Copyright Marc Lehman.  CSS addtions (c) Carol Spears.
+
+Copyright Marc Lehmann.
+CSS additions (c) Carol Spears.
+
 Distributed under the same terms as Gimp-Perl.
-=cut
-__END__
diff --git a/examples/dataurl b/examples/dataurl
index c5de4ef..40279e8 100755
--- a/examples/dataurl
+++ b/examples/dataurl
@@ -1,99 +1,91 @@
-#!/usr/local/bin/perl
-
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-# pcg goof com
-# this is not totally serious...
+#!/usr/bin/perl
 
 use Gimp;
 use Gimp::Fu;
 use Gimp::UI;
-use Fcntl;
-
-sub encode_base64($) {
-    my $res = substr pack ("u", $_[0]), 1;
-    $res =~ s/\n.//mg;
-    $res =~ tr|` -_|AA-Za-z0-9+/|; #` # syntax-hiliting in emacs kanns nicht
-    my $padding = (3 - length($_[0]) % 3) % 3;
-    $res =~ s/.{$padding}$/'=' x $padding/e if $padding;
-    $res;
-}
+use MIME::Base64;
+use IO::All;
 
-register
-   "file_dataurl_save",
-   "Saves the image as many small tiles using data:-urls",
-   "=pod",
-   "Marc Lehmann",
-   "Marc Lehmann <pcg\ goof com>",
-   "1999-11-20",
-   "<Save>/DATAURL",
-   "*",
-   [
-    [PF_SPINNER,       "tile_x",       "tile width",   32, [0, 8192, 1, 10]],
-    [PF_SPINNER,       "tile_y",       "tile height",  32, [0, 8192, 1, 10]],
-    [PF_RADIO, "filetype",     "underlying file type", 0,
-                 [GIF => 0, JFIF => 1, PNG => 2]],
-   ],
-   sub {
-      my($img,$drawable,$filename,$filename2,$tx,$ty,$type) = @_;
-      my($new_img,$new_drawable);
-      my $max;
-      my $export = Gimp::UI::export_image(
-        $new_img=$img, $new_drawable=$drawable,
-        "DATAURL",
-        $type==0 ? EXPORT_CAN_HANDLE_INDEXED|EXPORT_CAN_HANDLE_ALPHA
-        : $type==1 ? EXPORT_CAN_HANDLE_RGB|EXPORT_CAN_HANDLE_GRAY
-        : $type==2 ? EXPORT_CAN_HANDLE_RGB|EXPORT_CAN_HANDLE_GRAY|EXPORT_CAN_HANDLE_INDEXED
-        : 0
-      );
-      die __"export failed" if $export == EXPORT_CANCEL;
-      my ($w,$h) = ($new_drawable->width, $new_drawable->height);
-      my $tmp = Gimp->temp_name(".img~");
-      local *FILE;
-      sysopen FILE,$filename,O_CREAT|O_TRUNC|O_WRONLY or die __"Unable to open '$filename' for writing: 
$!\n";
-      print FILE "<html><body>\n";
-      Gimp::Progress->init(__"Saving '$filename' as DATAURL...");
-      my $media = $type==0 ? "gif"
-               : $type==1 ? "jpeg"
-               : $type==2 ? "png"
-               :            "";
-      print FILE "<table width=$w cellspacing=0 cellpadding=0 border=0>";
-      for (my $y=0; $y<$h; $y+=$ty) {
-        my $wy = $h-$y < $ty ? $h-$y : $ty;
-        print FILE "<tr>";
-        for(my $x=0; $x<$w; $x+=$tx) {
-           my $wx = $w-$x < $tx ? $w-$x : $tx;
-           my $img = $new_img->duplicate;
-           $img->crop($wx,$wy,$x,$y);
-           ($img->get_layers)[0]->file_gif_save  (($tmp)x2, 0, 0, 0, 0)                   if $type==0;
-           ($img->get_layers)[0]->file_jpeg_save (($tmp)x2, 0.7, 0, 1, 0, "", 0, 1, 0, 0) if $type==1;
-           ($img->get_layers)[0]->file_png_save  (($tmp)x2, 0, 7, 0, 0, 0, 0, 0)          if $type==2;
-           $img->delete;
-           my $data = do {
-              local(*TEMP,$/);
-              open TEMP, "<$tmp" or die __"Unable to read temporary image tile $tmp: $!";
-              <TEMP>;
-           };
-           unlink $tmp;
-           $url = "data:image/$media;base64,".(encode_base64 $data);
-           $max = length($url) if length($url) > $max;
-           print FILE "<td><img src=\"", $url, "\">";
-           Gimp::Progress->update(($y*$w+$x*$ty)/($w*$h));
-        }
-      }
-      print FILE "</table>\n";
-      print FILE "</html>\n";
-      close FILE;
-      warn __"url size is too large ($max > 1024)\n" if $max > 1024;
-      $new_img->delete if $export == EXPORT_EXPORT;
-      ();
-   };
+podregister {
+  my($new_image,$new_drawable);
+  my $max;
+  my $export = Gimp::UI::export_image(
+    $new_image=$image, $new_drawable=$drawable,
+    "DATAURL",
+    $filetype==0 ? EXPORT_CAN_HANDLE_INDEXED|EXPORT_CAN_HANDLE_ALPHA
+    : $filetype==1 ? EXPORT_CAN_HANDLE_RGB|EXPORT_CAN_HANDLE_GRAY
+    : $filetype==2 ? EXPORT_CAN_HANDLE_RGB|EXPORT_CAN_HANDLE_GRAY|EXPORT_CAN_HANDLE_INDEXED
+    : 0
+  );
+  die __"export failed" if $export == EXPORT_CANCEL;
+  my ($w,$h) = ($new_drawable->width, $new_drawable->height);
+  my $tmp = Gimp->temp_name(".img~");
+  my $fh = io($filename);
+  die __"Unable to open '$filename' for writing: $!\n"
+    unless $fh->print("<html><body>\n");
+  Gimp::Progress->init(__"Saving '$filename' as DATAURL...");
+  my $media = $filetype==0 ? "gif"
+           : $filetype==1 ? "jpeg"
+           : $filetype==2 ? "png"
+           :            "";
+  append $fh "<table width=$w cellspacing=0 cellpadding=0 border=0>";
+  for (my $y=0; $y<$h; $y+=$tile_y) {
+    my $wy = $h-$y < $tile_y ? $h-$y : $tile_y;
+    append $fh "<tr>";
+    for(my $x=0; $x<$w; $x+=$tile_x) {
+      my $wx = $w-$x < $tile_x ? $w-$x : $tile_x;
+      my $image = $new_image->duplicate;
+      $image->crop($wx,$wy,$x,$y);
+      ($image->get_layers)[0]->file_gif_save  (($tmp)x2, 0, 0, 0, 0)                   if $filetype==0;
+      ($image->get_layers)[0]->file_jpeg_save (($tmp)x2, 0.7, 0, 1, 0, "", 0, 1, 0, 0) if $filetype==1;
+      ($image->get_layers)[0]->file_png_save  (($tmp)x2, 0, 7, 0, 0, 0, 0, 0)          if $filetype==2;
+      $image->delete;
+      my $data = io($tmp)->all
+       or die __"Unable to read temporary image tile $tmp: $!";
+      unlink $tmp;
+      $url = "data:image/$media;base64,".(encode_base64 $data);
+      $max = length($url) if length($url) > $max;
+      append $fh "<td><img src=\"", $url, "\">";
+      Gimp::Progress->update(($y*$w+$x*$tile_y)/($w*$h));
+    }
+  }
+  append $fh "</table>\n";
+  append $fh "</html>\n";
+  Gimp->message(__"File saved. Warning: url size is too large ($max > 1024)\n")
+    if $max > 1024;
+  $new_image->delete if $export == EXPORT_EXPORT;
+  ();
+};
 
 Gimp::on_query {
    Gimp->register_save_handler("file_dataurl_save", "dataurl", "");
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+file_dataurl_save - Saves the image as many small tiles using data:-urls
+
+=head1 SYNOPSIS
+
+<Save>/DATAURL
+
+=head1 DESCRIPTION
+
+Saves the image as many small tiles using data:-urls.
+
+=head1 PARAMETERS
+
+ [PF_SPINNER, "tile_x", "tile width", 32, [0, 8192, 1, 10]],
+ [PF_SPINNER, "tile_y", "tile height", 32, [0, 8192, 1, 10]],
+ [PF_RADIO, "filetype", "underlying file type", 0,
+    [GIF => 0, JFIF => 1, PNG => 2]],
+
+=head1 IMAGE TYPES
+
+*
 
 =head1 DATAURL FILE FORMAT
 
@@ -110,174 +102,176 @@ However, since rfc2397 is only a proposed standard, you might want to
 use much larger tile sizes (upto the image size), since most browsers
 generally do not care for the url length.
 
-Browser compatibility list (send more results to pcg goof com ;)
+Browser compatibility list:
+
+  Firefox 24.4.0 works
+
+=head1 HISTORY
 
-  Netscape 3.x displays broken image icons
-  Netscape 4.x works on some configurations (communicator!),
-                not on others (navigator!)
-  Lynx         displays the base64 code as text :(
-  MSIE 4       thousands of error messages in dialog boxes ;->
-  MSIE 5       shows broken image icon
+  <schmorp> yosh: cvs.gimp.org
+  <yosh> I mean which "removed debugging crap" one
+  <schmorp> yosh: or did you mean the debugging code in the Perl-Server?
+  <yosh> yah
+  <yosh> debian's perl whines about using -D since it's not compiled with -DDEBUGGING
+  <schmorp> yosh: ah.. I it was ebing queried..
+  <schmorp> yosh: yeah, but you did not see the <STDIN> that required people to press enter in colorhtml ;)
+  <schmorp> anybody here with netscape 3.0? or msie 5.0? or any other graphical browser?
+  <yosh> schmorp: it was in innerbevel, you must've fixed colorhtml before I had a chance to update
+  <maswan> schmorp: ns3.0 here
+  <schmorp> maswan: could you try something out? -> http://www.goof.com/pcg/marc/dataurl.html
+  <schmorp> maswan: what do you see, especially below "dataurl filter"
+  <schmorp> yosh: at least ;->
+  *** Joins: Nether [lealanko myntti helsinki fi] has joined #gimp
+  *** Mode change for #gimp by XachBot: +o Nether
+  <maswan> schmorp: slooow....
+  <Stric> schmorp, evil thingie.. I'm loading it in win98/ie on a p60 8)
+  *** Nether [lealanko myntti helsinki fi] is now known as Neth_ZzZ
+  <schmorp> that html page contains no external links, i.e. all images are embedded
+  <schmorp> and yes, the colour-changing is bogging down most browsers
+  <schmorp> i want to find out how many browsers support the data: url
+  <Stric> I get a gazillion of [x] broken image thingies at the bottom half
+  <maswan> schmorp: embedded? I got _lots_ of broken external images on the bottom half
+  <schmorp> stric: which browser?
+  <maswan> http://www.goof.com/pcg/marc/data:image/gif;base64,
+     
R0lGODlhIgAiAOMAAA8UFDo/OGt9eJecj722oFxfVIl/a+vSrn5oTtiyg7qfe6SGZUlgX+LCliElIdCldCwAAAAAIgAiAAAE/vAd9dajKlV6FddY9TTd9ZzmSWkPi2quYiUsiJ4uXd+6i/e3Vk/XQpGMRVxj9
+     
1omnE/n8nhqUGmv2lMnXY6EWBc0rNxah8IRjQQbeouw0dhKT5+562Cevu1BpWtcPy1WYHdmT2psXn1DjYF8fmdnhJCIB4VTmlyRdE5ggZhTnIFrXX6SDaKPZpN4XAd+sXV8f1GagFmmd7ZWmKaNo5ZDs1GoTh
+     k0sW5dkcGtJIeeuJ6kt7Nny7vTzXyiq2zGo7VS4NSqrdiIU8voJKLV04hypa5mB/DOw+K3qt147JQBfPLLU0Fh5IxhqdTHXh
+  <Stric> schmorp, win98/ie (4? 5?)
+  <schmorp> maswan: ok, so ns3.0 does not support it
+  <schmorp> stric: i don't know how to find out ;9
+  <Stric> schmorp, 5 appearantly...
+  <schmorp> ok... ns3.0 and msie5 show broken image icons.
+  <schmorp> msie displays one dialog box per link (evil)
+  <schmorp> lynx errornously displays the base64 data
+  <yosh> haha
+  <schmorp> so only netscape 4 displays it correctly
+  <yosh> that is too evil
+  <yosh> tried mozilla?
+  *** Quits: _vicious_:#gimp [~jirka dt062nd1 san rr com] (GEGL!)
+  <schmorp> yosh: mozilla does not run, did not run and will probably never run
+  <schmorp> yosh: everytime I come here and somebody talks about mozilla he says "well, it is quite cool"
+  <schmorp> yosh: everytime _I_ try it ends in an endless loop after 5 seconds or so
+  <yosh> heh
+  <Stric> you must be broken then
+  <schmorp> yosh: but I guess mozilla will do it as well
+  <yosh> schmorp: I get broken images with NS 4.7
+  <schmorp> yosh: really? thats cool... it works with ns 4.06 (here) and ns 4.6 (my friend)
+  <schmorp> yosh: on linux?
+  <yosh> yes
+  <schmorp> yosh: i wonder why they removed support for it..
+  <sjburges> I get broken stuff with 4.51
+  *** TomR^AwaY [~tomr judas aceldama com] is now known as Tommer
+  <yosh> hey Tommer
+  <Tommer> Works for me on NS 4.71 on LinuxPPC
+  <Tommer> Hullo yosh
+  <schmorp> tommer: really?
+  <Tommer> dataurl is very cute, schmorp
+  <Tommer> Yup
+  * yosh tries mozilla
+  <schmorp> something must be broken... 4.06 yes, 4.51 no, 4.6 yes, 4.7 no, 4.71 yes...
+  <schmorp> I see a pattern...
+  <Tommer> Oh, you mean the ($ver*100)%2 == (dataurl works) relation?
+  <Tommer> Oh wait, 4.6 doesn't match that.
+  * maswan tries ns4.61 on aix
+  <schmorp> oh, that 4.6 is probably measurement error
+  <Tommer> schmorp, for the next trick, do <frameset> <frame src=dataurl:> <frame src=dataurl:> </frameset> 
:)
+  <yosh> haha
+  <schmorp> hmm... it works with 4.51 here....
+  <maswan> eeek.
+  <Tommer> how about <body background="dataurl:...">
+  *** Quits: tigert:#gimp [tigert fun112 koivukyla hoas fi] (Ping timeout: 660 seconds)
+  <schmorp> tommer: hmm... now that would be cool... it would not even need base64 encoding, and would 
probably work even with lynx
+  <maswan> this one is sloow for some reason.
+  <tc> hmm
+  *** Topic change by sjburges on #gimp: its abuse html night
+  <Tommer> schmorp: yes, as long as you used &quot; everywhere you'd be fine :)
+  <schmorp> maswan: "aix"....
+  <tc> could it be that clinton only knows of the internet from al gore?
+  <Stric> schmorp, low mhz combined with netscape on 24bpp
+  <maswan> hmm.. or ssh. oops. :)
+  <tc> "reduce the gap between rich and poor by giving everyone internet access"
+  <Tommer> Does anyone have red+blue 3D glasses handy?
+  <tc> yay clinton. you da man
+  <maswan> schmorp: works on this one
+  <schmorp> stric: but since netscaope can't display colour icons in 24bpp it should be much faster ;->
+  <schmorp> maswan: thanks ;)
+  <Stric> schmorp, I haven't had that problem on non-linux
+  <maswan> hmm.. it is estimating speed at 2k/s
+  <schmorp> tommer: the problem is that urls are max. 1k in size
+  <Stric> schmorp, I correct that to aix/irix/solaris
+  <schmorp> tommer: but on the browsers that support it, dataurls can be much longer
+  <maswan> which means much time for that file
+  <Tommer> schmorp: can't you specify encoding=base64 _and_ encoding=gzip?
+  <yosh> hum, mozilla sucks ;)
+  <schmorp> tommer: i can't specify an encoding per se. if, then it must be a netscape extension
+  <schmorp> tommer: maybe image/gzip-jpg or something....
+  <Tommer> schmorp: oh, so you can only specify a content type, not an encoding? I was guessing about the 
encoding thing.
+  * maswan tries irix netscape 4.something
+  <maswan> 4.61 here too
+  <schmorp> tommer: the base64 is specified as ";base64", so it is somethign special
+  <schmorp> tommer: but since I can specify charset=xxx, maybe I can also add encoding=gzip...
+  <maswan> works that too
+  <schmorp> tommer: BUT... if I can use gzip, then I cna use long urls. Then I can use png, and then i don't 
need gzip
+  <Tommer> schmorp: just think, you could put a whole site in one page with framesets and dataurl :)
+  <schmorp> yosh: mozilla sucks, yes, but does it display it?
+  <Tommer> How are gzip and long urls related, schmorp?
+  <yosh> schmorp: it segfaults
+  <yosh> ;)
+  <schmorp> tommer: hmm... I'm thinking images only...
+  <schmorp> tommer: if you think text then encoding=gzip makes sense
+  <schmorp> tommer: I also haven'T tried wether these urls work in frameset and normal anchor elements
+  <schmorp> but actually, the colorhtml filter is much more portable
+  <yosh> yeah, it just takes aching long to render and scroll
+  <Tommer> schmorp: how about <img lowsrc="data:image/gif;base64, ... " src="/images/foo.gif"> ?
+  <schmorp> yes... maybe when this type of encapsulation becomes more often used... at least
+  <schmorp> we can claim that msie is not rfc2397 compatible
+  <ole_zzz> xachbot, seen dv
+  -XachBot:#gimp- I last saw dv (veillard home5 inrialpes fr) 7d 13h 17m ago [quit: (xchat exiting..)]
+  <Stric> schmorp, and who will care? 8)
+  <schmorp> tommer: that might even be a useful usage!!
+  *** Joins: JohnP [me2 d027 pnj early com] has joined #gimp
+  *** Mode change for #gimp by XachBot: +o JohnP
+  <JohnP> Hey!
+  <Tommer> schmorp: but lowsrc is an evil Netscape invention :)
+  *** Joins: tigert [~tigert fun112 koivukyla hoas fi] has joined #gimp
+  *** Mode change for #gimp by Wilber: +o tigert
+  <Stric> tigpoo
+  <JohnP> tigert!
+  <Tommer> schmorp: <img lowsrc="data:image/xbm;base64, ... " src="/images/foo.gif">
+  <schmorp> tommer: does the lowsrc image have to have the same size/resolution?
+  <Tommer> Hmm, does <img src="internal-gopher-menu"> and such work?
+  <maswan> hmm.. sleep. now.
+  <Tommer> schmorp: lowsrc _should_ have the same size/resolution. if you specify width and height then the 
lowsrc will be resized of course.
+  <schmorp> tommer: .... and since it's netscaoe only we do not need to care
+  <Tommer> schmorp: yes, if you're abusing HTML you may as well go whole hog.
+  <schmorp> tommer: hey, it's a "proposed standard" ;)
+  <yosh> heh
+  <Tommer> A nice thing about NS on the Mac is that if you shrink a mono image then it renders it 
antialiased :)
+  Tommer> Pull out your red+blue 3D glasses and go to: http://www.aceldama.com/~tomr/wx/tomrcam-3d-2.jpg
+  <schmorp> yosh: rfc2397 "data: url scheme"
+  *** Joins: jlb [~jlbec slip-32-101-161-237 nc us prserv net] has joined #gimp
+  *** Mode change for #gimp by XachBot: +o jlb
+  <schmorp> tommer: looks flashy (no 3d cam here ;)
+  <schmorp> ok, bye all!
+  <Tommer> ttyl schmorp
+  <schmorp> sjburges: have a nice time with your new g/f!
+  <yosh> interesting
+  <Tommer> schmorp: you need 3D glasses
+  <yosh> ok, food
+  *** yosh [manish graft XCF Berkeley EDU] is now known as yosh_food
+  <schmorp> tommer: if you do some weird things with urls, drop me a note ;->
+  <schmorp> tommer: ah, yes, _glasses_ i meant
 
-=for nobody
+=head1 AUTHOR
 
-<schmorp> yosh: cvs.gimp.org
-<yosh> I mean which "removed debugging crap" one
-<schmorp> yosh: or did you mean the debugging code in the Perl-Server?
-<yosh> yah
-<yosh> debian's perl whines about using -D since it's not compiled with -DDEBUGGING
-<schmorp> yosh: ah.. I it was ebing queried..
-<schmorp> yosh: yeah, but you did not see the <STDIN> that required people to press enter in colorhtml ;)
-<schmorp> anybody here with netscape 3.0? or msie 5.0? or any other graphical browser?
-<yosh> schmorp: it was in innerbevel, you must've fixed colorhtml before I had a chance to update
-<maswan> schmorp: ns3.0 here
-<schmorp> maswan: could you try something out? -> http://www.goof.com/pcg/marc/dataurl.html
-<schmorp> maswan: what do you see, especially below "dataurl filter"
-<schmorp> yosh: at least ;->
-*** Joins: Nether [lealanko myntti helsinki fi] has joined #gimp
-*** Mode change for #gimp by XachBot: +o Nether
-<maswan> schmorp: slooow....
-<Stric> schmorp, evil thingie.. I'm loading it in win98/ie on a p60 8)
-*** Nether [lealanko myntti helsinki fi] is now known as Neth_ZzZ
-<schmorp> that html page contains no external links, i.e. all images are embedded
-<schmorp> and yes, the colour-changing is bogging down most browsers
-<schmorp> i want to find out how many browsers support the data: url
-<Stric> I get a gazillion of [x] broken image thingies at the bottom half
-<maswan> schmorp: embedded? I got _lots_ of broken external images on the bottom half
-<schmorp> stric: which browser?
-<maswan> http://www.goof.com/pcg/marc/data:image/gif;base64,
-   
R0lGODlhIgAiAOMAAA8UFDo/OGt9eJecj722oFxfVIl/a+vSrn5oTtiyg7qfe6SGZUlgX+LCliElIdCldCwAAAAAIgAiAAAE/vAd9dajKlV6FddY9TTd9ZzmSWkPi2quYiUsiJ4uXd+6i/e3Vk/XQpGMRVxj9
-   
1omnE/n8nhqUGmv2lMnXY6EWBc0rNxah8IRjQQbeouw0dhKT5+562Cevu1BpWtcPy1WYHdmT2psXn1DjYF8fmdnhJCIB4VTmlyRdE5ggZhTnIFrXX6SDaKPZpN4XAd+sXV8f1GagFmmd7ZWmKaNo5ZDs1GoTh
-   k0sW5dkcGtJIeeuJ6kt7Nny7vTzXyiq2zGo7VS4NSqrdiIU8voJKLV04hypa5mB/DOw+K3qt147JQBfPLLU0Fh5IxhqdTHXh
-<Stric> schmorp, win98/ie (4? 5?)
-<schmorp> maswan: ok, so ns3.0 does not support it
-<schmorp> stric: i don't know how to find out ;9
-<Stric> schmorp, 5 appearantly...
-<schmorp> ok... ns3.0 and msie5 show broken image icons.
-<schmorp> msie displays one dialog box per link (evil)
-<schmorp> lynx errornously displays the base64 data
-<yosh> haha
-<schmorp> so only netscape 4 displays it correctly
-<yosh> that is too evil
-<yosh> tried mozilla?
-*** Quits: _vicious_:#gimp [~jirka dt062nd1 san rr com] (GEGL!)
-<schmorp> yosh: mozilla does not run, did not run and will probably never run
-<schmorp> yosh: everytime I come here and somebody talks about mozilla he says "well, it is quite cool"
-<schmorp> yosh: everytime _I_ try it ends in an endless loop after 5 seconds or so
-<yosh> heh
-<Stric> you must be broken then
-<schmorp> yosh: but I guess mozilla will do it as well
-<yosh> schmorp: I get broken images with NS 4.7
-<schmorp> yosh: really? thats cool... it works with ns 4.06 (here) and ns 4.6 (my friend)
-<schmorp> yosh: on linux?
-<yosh> yes
-<schmorp> yosh: i wonder why they removed support for it..
-<sjburges> I get broken stuff with 4.51
-*** TomR^AwaY [~tomr judas aceldama com] is now known as Tommer
-<yosh> hey Tommer
-<Tommer> Works for me on NS 4.71 on LinuxPPC
-<Tommer> Hullo yosh
-<schmorp> tommer: really?
-<Tommer> dataurl is very cute, schmorp
-<Tommer> Yup
-* yosh tries mozilla
-<schmorp> something must be broken... 4.06 yes, 4.51 no, 4.6 yes, 4.7 no, 4.71 yes...
-<schmorp> I see a pattern...
-<Tommer> Oh, you mean the ($ver*100)%2 == (dataurl works) relation?
-<Tommer> Oh wait, 4.6 doesn't match that.
-* maswan tries ns4.61 on aix
-<schmorp> oh, that 4.6 is probably measurement error
-<Tommer> schmorp, for the next trick, do <frameset> <frame src=dataurl:> <frame src=dataurl:> </frameset> :)
-<yosh> haha
-<schmorp> hmm... it works with 4.51 here....
-<maswan> eeek.
-<Tommer> how about <body background="dataurl:...">
-*** Quits: tigert:#gimp [tigert fun112 koivukyla hoas fi] (Ping timeout: 660 seconds)
-<schmorp> tommer: hmm... now that would be cool... it would not even need base64 encoding, and would 
probably work even with lynx
-<maswan> this one is sloow for some reason.
-<tc> hmm
-*** Topic change by sjburges on #gimp: its abuse html night
-<Tommer> schmorp: yes, as long as you used &quot; everywhere you'd be fine :)
-<schmorp> maswan: "aix"....
-<tc> could it be that clinton only knows of the internet from al gore?
-<Stric> schmorp, low mhz combined with netscape on 24bpp
-<maswan> hmm.. or ssh. oops. :)
-<tc> "reduce the gap between rich and poor by giving everyone internet access"
-<Tommer> Does anyone have red+blue 3D glasses handy?
-<tc> yay clinton. you da man
-<maswan> schmorp: works on this one
-<schmorp> stric: but since netscaope can't display colour icons in 24bpp it should be much faster ;->
-<schmorp> maswan: thanks ;)
-<Stric> schmorp, I haven't had that problem on non-linux
-<maswan> hmm.. it is estimating speed at 2k/s
-<schmorp> tommer: the problem is that urls are max. 1k in size
-<Stric> schmorp, I correct that to aix/irix/solaris
-<schmorp> tommer: but on the browsers that support it, dataurls can be much longer
-<maswan> which means much time for that file
-<Tommer> schmorp: can't you specify encoding=base64 _and_ encoding=gzip?
-<yosh> hum, mozilla sucks ;)
-<schmorp> tommer: i can't specify an encoding per se. if, then it must be a netscape extension
-<schmorp> tommer: maybe image/gzip-jpg or something....
-<Tommer> schmorp: oh, so you can only specify a content type, not an encoding? I was guessing about the 
encoding thing.
-* maswan tries irix netscape 4.something
-<maswan> 4.61 here too
-<schmorp> tommer: the base64 is specified as ";base64", so it is somethign special
-<schmorp> tommer: but since I can specify charset=xxx, maybe I can also add encoding=gzip...
-<maswan> works that too
-<schmorp> tommer: BUT... if I can use gzip, then I cna use long urls. Then I can use png, and then i don't 
need gzip
-<Tommer> schmorp: just think, you could put a whole site in one page with framesets and dataurl :)
-<schmorp> yosh: mozilla sucks, yes, but does it display it?
-<Tommer> How are gzip and long urls related, schmorp?
-<yosh> schmorp: it segfaults
-<yosh> ;)
-<schmorp> tommer: hmm... I'm thinking images only...
-<schmorp> tommer: if you think text then encoding=gzip makes sense
-<schmorp> tommer: I also haven'T tried wether these urls work in frameset and normal anchor elements
-<schmorp> but actually, the colorhtml filter is much more portable
-<yosh> yeah, it just takes aching long to render and scroll
-<Tommer> schmorp: how about <img lowsrc="data:image/gif;base64, ... " src="/images/foo.gif"> ?
-<schmorp> yes... maybe when this type of encapsulation becomes more often used... at least
-<schmorp> we can claim that msie is not rfc2397 compatible
-<ole_zzz> xachbot, seen dv
--XachBot:#gimp- I last saw dv (veillard home5 inrialpes fr) 7d 13h 17m ago [quit: (xchat exiting..)]
-<Stric> schmorp, and who will care? 8)
-<schmorp> tommer: that might even be a useful usage!!
-*** Joins: JohnP [me2 d027 pnj early com] has joined #gimp
-*** Mode change for #gimp by XachBot: +o JohnP
-<JohnP> Hey!
-<Tommer> schmorp: but lowsrc is an evil Netscape invention :)
-*** Joins: tigert [~tigert fun112 koivukyla hoas fi] has joined #gimp
-*** Mode change for #gimp by Wilber: +o tigert
-<Stric> tigpoo
-<JohnP> tigert!
-<Tommer> schmorp: <img lowsrc="data:image/xbm;base64, ... " src="/images/foo.gif">
-<schmorp> tommer: does the lowsrc image have to have the same size/resolution?
-<Tommer> Hmm, does <img src="internal-gopher-menu"> and such work?
-<maswan> hmm.. sleep. now.
-<Tommer> schmorp: lowsrc _should_ have the same size/resolution. if you specify width and height then the 
lowsrc will be resized of course.
-<schmorp> tommer: .... and since it's netscaoe only we do not need to care
-<Tommer> schmorp: yes, if you're abusing HTML you may as well go whole hog.
-<schmorp> tommer: hey, it's a "proposed standard" ;)
-<yosh> heh
-<Tommer> A nice thing about NS on the Mac is that if you shrink a mono image then it renders it antialiased 
:)
-Tommer> Pull out your red+blue 3D glasses and go to: http://www.aceldama.com/~tomr/wx/tomrcam-3d-2.jpg
-<schmorp> yosh: rfc2397 "data: url scheme"
-*** Joins: jlb [~jlbec slip-32-101-161-237 nc us prserv net] has joined #gimp
-*** Mode change for #gimp by XachBot: +o jlb
-<schmorp> tommer: looks flashy (no 3d cam here ;)
-<schmorp> ok, bye all!
-<Tommer> ttyl schmorp
-<schmorp> sjburges: have a nice time with your new g/f!
-<yosh> interesting
-<Tommer> schmorp: you need 3D glasses
-<yosh> ok, food
-*** yosh [manish graft XCF Berkeley EDU] is now known as yosh_food
-<schmorp> tommer: if you do some weird things with urls, drop me a note ;->
-<schmorp> tommer: ah, yes, _glasses_ i meant
+Marc Lehmann
+
+=head1 DATE
+
+1999-11-20
 
 =head1 LICENSE
 
-Copyright Marc Lehman.
-Distributed under the same terms as Gimp-Perl.
+Marc Lehmann <pcg goof com>
 
-=cut
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/ditherize b/examples/ditherize
index 81d5b87..0b70e9b 100755
--- a/examples/ditherize
+++ b/examples/ditherize
@@ -1,18 +1,9 @@
 #!/usr/bin/perl
 
-use strict 'subs';
+use strict;
 use Gimp qw(:auto);
 use Gimp::Fu;
 
-#
-# this is quite convoluted, but I found no other way to do this than:
-#
-# create a new image & one layer
-# copy & paste the layer
-# ditherize new image
-# copy & paste back
-#
-
 #Gimp::set_trace(TRACE_ALL);
 
 my %imagetype2layertype = (
@@ -21,22 +12,7 @@ my %imagetype2layertype = (
    INDEXED,    INDEXED_IMAGE,
 );
 
-register "ditherize",
-        "dithers current selection",
-        "This script takes the current selection and dithers it just like convert to indexed",
-        "Marc Lehmann",
-        "Marc Lehmann",
-        "1.2",
-        N_"<Image>/Filters/Noise/Ditherize...",
-        "RGB*, GRAY*",
-        [
-         [PF_RADIO,            "dither_type",  "The dither type (see gimp_image_convert_indexed)", 1,
-                                               [none => 0, fs => 1, "fs/low-bleed" => 2, ordered => 3]],
-         [PF_SLIDER,           "colours",      "The number of colours to dither to", 10, [0, 256, 1, 1]],
-        ],
-        sub {
-   my($image,$drawable,$dither,$colours)= _;
-
+podregister {
 #   Gimp::set_trace(-1);
 
    $drawable->is_layer or die "this plug-in only works for layers";
@@ -62,7 +38,7 @@ register "ditherize",
                        "temporary layer", 100, NORMAL_MODE);
    $copy->insert_layer ($draw, 0, 1);
    $draw->edit_paste(0)->anchor;
-   $copy->convert_indexed ($dither, MAKE_PALETTE, $colours, 1, 1, "");
+   $copy->convert_indexed ($dither_type, MAKE_PALETTE, $colours, 1, 1, "");
 
    $draw->edit_copy;
    $drawable->edit_paste(1)->anchor;
@@ -74,11 +50,50 @@ register "ditherize",
 };
 
 exit main;
+__END__
 
-=head1 LICENSE
+=head1 NAME
 
-Copyright Marc Lehman.
-Distributed under the same terms as Gimp-Perl.
+ditherize - dithers current selection
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Noise/Ditherize...
+
+=head1 DESCRIPTION
+
+This script takes the current selection and dithers it just like convert
+to indexed.
+
+=head1 PARAMETERS
+
+ [PF_RADIO, "dither_type", "The dither type (see gimp_image_convert_indexed)", 1,
+   [none => 0, fs => 1, "fs/low-bleed" => 2, ordered => 3]],
+ [PF_SLIDER, "colours",        "The number of colours to dither to", 10, [0, 256, 1, 1]],
+
+=head1 IMAGE TYPES
 
-=cut
+RGB*, GRAY*
 
+=head1 RATIONALE
+
+This is quite convoluted, but I found no other way to do this than:
+
+ create a new image & one layer
+ copy & paste the layer
+ ditherize new image
+ copy & paste back
+
+=head1 AUTHOR
+
+Marc Lehmann
+
+=head1 DATE
+
+1.2
+
+=head1 LICENSE
+
+Marc Lehmann
+
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/exceptiontest b/examples/exceptiontest
index 81f9bfd..b3bb2ad 100755
--- a/examples/exceptiontest
+++ b/examples/exceptiontest
@@ -6,25 +6,31 @@ use Gimp::Fu;
 #BEGIN { $Gimp::verbose = 1; }
 #Gimp::set_trace(TRACE_ALL);
 
-sub boilerplate_params {
-  my ($testing, $menuloc, $imagetypes) = @_;
-  (
-    ("exercise gimp-perl filter testing $testing") x 2,
-    ("boilerplate id") x 2,
-    "20140310",
-    N_$menuloc,
-    ($imagetypes // "*"),
-  );
-}
-
-&register(
-  "test_exception",
-  boilerplate_params(
-    'exceptions',
-    '<Image>/Filters/Languages/_Perl/_Test/Exception', '',
-  ),
-  [],
-  sub { die "I DIED\n" }
-);
+podregister { die "I DIED\n" };
 
 exit main;
+__END__
+
+=head1 NAME
+
+test_exception - exercise gimp-perl filter testing exceptions
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Languages/_Perl/_Test/Exception
+
+=head1 DESCRIPTION
+
+exercise gimp-perl filter testing exceptions
+
+=head1 AUTHOR
+
+boilerplate id
+
+=head1 DATE
+
+20140310
+
+=head1 LICENSE
+
+boilerplate id
diff --git a/examples/fade-alpha b/examples/fade-alpha
index da6136d..6b634c2 100755
--- a/examples/fade-alpha
+++ b/examples/fade-alpha
@@ -4,15 +4,9 @@ use Gimp;
 use Gimp::Fu;
 use strict;
 
-# 2014/04/20 Ed J: rewrite to use Gimp::Fu and PF_CUSTOM
-# 12/5/03: <sjburges gimp org>
-#  s/->mask/->get_mask
-# 3/21/04: <sjburges gimp org>
-#  s/AlphaFade/alpha_fade/ to be compatible with PDB naming conventions
-
 # XPM's that I removed the $ and the @'s from (they get interpreted in
 # strings, which makes for nasty problems).
-my @arr = (
+our @arr = (
 ["24 24 66 1",
 "      c None",
 ".     c #A0A0A0",
@@ -776,104 +770,126 @@ my @arr = (
 
 sub avg { ($_[0] + $_[1]) / 2 }
 
-register
-  "alpha_fade",
-  "Fade the alpha channel of a layer from one side to another",
-  <<EOF,
+podregister {
+  die "Can only operate on layers\n" unless $drawable->is_layer;
+  $drawable->become('Gimp::Layer');
+  $image->undo_group_start;
+  my @bounds = $image->selection_bounds;
+  $drawable->add_alpha unless $drawable->has_alpha;
+  my $mask;
+  unless ($mask = $drawable->get_mask) {
+    $mask = $drawable->create_mask(ADD_ALPHA_MASK);
+    $drawable->add_mask($mask);
+  }
+  Gimp::Context->push;
+  Gimp::Context->set_background([0.0,0.0,0.0,1.0]);
+  Gimp::Context->set_foreground([1.0,1.0,1.0,1.0]);
+  # Direction Map
+  # 0 3 6
+  # 1 4 7
+  # 2 5 8
+  # Bounds Map
+  # (1,2) (3,2)
+  # (1,4) (3,4)
+  my @blend_args = (
+    FG_BG_RGB_MODE, NORMAL_MODE,
+    ($direction == 4 ? GRADIENT_RADIAL : GRADIENT_LINEAR),
+    100.0,       # opacity
+    0.0,         # offset
+    REPEAT_NONE,
+    0,           # reverse
+    0,           # supersample
+    1,           # recursion levels
+    0.1,         # supersample threshold
+    0,          # dither
+  );
+  my %dir2argfunc = (
+    0 => sub { @_[3, 4, 1, 2] },
+    1 => sub { ($_[3], avg(@_[2,4]), $_[1], avg(@_[2,4])) },
+    2 => sub { @_[3, 2, 1, 4] },
+    3 => sub { (avg(@_[1,3]), $_[4], avg(@_[1,3]), $_[2]) },
+    4 => sub { (avg(@_[1,3]), avg(@_[2,4]), avg(@_[1,3]), $_[4]) }, # radial
+    5 => sub { (avg(@_[1,3]), $_[2], avg(@_[1,3]), $_[4]) },
+    6 => sub { @_[1, 4, 3, 2] },
+    7 => sub { ($_[1], avg(@_[2,4]), $_[3], avg(@_[2,4])) },
+    8 => sub { @_[1, 2, 3, 4] },
+  );
+  $mask->edit_blend(@blend_args, $dir2argfunc{$direction}->(@bounds));
+  $drawable->remove_mask(MASK_APPLY) if $direction >=0 && $direction <9;
+  Gimp::Context->pop;
+  $image->undo_group_end;
+};
+
+exit main;
+__END__
+
+=head1 NAME
+
+alpha_fade - Fade the alpha channel of a layer from one side to another
+
+=head1 SYNOPSIS
+
+<Image>/Layer/Transparency/_Fade...
+
+=head1 DESCRIPTION
+
 Rewritten by Ed J to use Gimp::Fu as demo of PF_CUSTOM widget. Original
 by Seth Burgess, inspired by a mailing list question that asked how to do
 exactly what this does, which is fade the alpha from one side to another.
-EOF
-  "Seth Burgess",
-  "Seth Burgess",
-  "2000",
-  "<Image>/Layer/Transparency/_Fade...",
-  "*",
-  [
-    [PF_CUSTOM, "direction", "Direction to fade(0-8)", 4, sub {
-      my $btnTable = new Gtk2::Table(3,3,1);
-      $btnTable->set_border_width(6);
-      my $btn = new Gtk2::RadioButton;
-      my $u_direction;
-      my @buttons;
-      for (my $x=0;$x<3;$x++) {
-       for (my $y=0;$y<3;$y++) {
-         my $dir = $x*3 + $y;
-         $buttons[$dir] = $btn = Gtk2::RadioButton->new_from_widget($btn);
-         $btn->set_mode(0);
-         $btn->signal_connect("clicked", sub { $u_direction = $_[1]; }, $dir);
-         $btn->show;
-         $btnTable->attach_defaults($btn, $x, $x+1, $y, $y+1);
-         my $pixmap = Gtk2::Image->new_from_pixmap(
-           Gtk2::Gdk::Pixmap->colormap_create_from_xpm_d(
-             undef, $btn->get_colormap,
-             $btn->style->bg('normal'), @{$arr[$dir]}
-           )
-         );
-         $pixmap->show;
-         $btn->add($pixmap);
-       }
-      }
-      $btnTable->show;
-      ($btnTable, sub { $buttons[$_[0]]->clicked }, sub { $u_direction });
-    },
+
+=head1 PARAMETERS
+
+  [PF_CUSTOM, "direction", "Direction to fade(0-8)", 4, sub {
+     my $btnTable = new Gtk2::Table(3,3,1);
+     $btnTable->set_border_width(6);
+     my $btn = new Gtk2::RadioButton;
+     my $u_direction;
+     my @buttons;
+     for (my $x=0;$x<3;$x++) {
+       for (my $y=0;$y<3;$y++) {
+        my $dir = $x*3 + $y;
+        $buttons[$dir] = $btn = Gtk2::RadioButton->new_from_widget($btn);
+        $btn->set_mode(0);
+        $btn->signal_connect("clicked", sub { $u_direction = $_[1]; }, $dir);
+        $btn->show;
+        $btnTable->attach_defaults($btn, $x, $x+1, $y, $y+1);
+        my $pixmap = Gtk2::Image->new_from_pixmap(
+          Gtk2::Gdk::Pixmap->colormap_create_from_xpm_d(
+            undef, $btn->get_colormap,
+            $btn->style->bg('normal'), @{$::arr[$dir]}
+          )
+        );
+        $pixmap->show;
+        $btn->add($pixmap);
+       }
+     }
+     $btnTable->show;
+     ($btnTable, sub { $buttons[$_[0]]->clicked }, sub { $u_direction });
+  },
   ]
-  ],
-  [],
-  sub {
-    my ($image, $drawable, $direction) = @_;
-    die "Can only operate on layers\n" unless $drawable->is_layer;
-    $drawable->become('Gimp::Layer');
-    $image->undo_group_start;
-    my @bounds = $image->selection_bounds;
-    $drawable->add_alpha unless $drawable->has_alpha;
-    my $mask;
-    unless ($mask = $drawable->get_mask) {
-      $mask = $drawable->create_mask(ADD_ALPHA_MASK);
-      $drawable->add_mask($mask);
-    }
-    Gimp::Context->push;
-    Gimp::Context->set_background([0.0,0.0,0.0,1.0]);
-    Gimp::Context->set_foreground([1.0,1.0,1.0,1.0]);
-    # Direction Map
-    # 0 3 6
-    # 1 4 7
-    # 2 5 8
-    # Bounds Map
-    # (1,2) (3,2)
-    # (1,4) (3,4)
-    my @blend_args = (
-      FG_BG_RGB_MODE, NORMAL_MODE,
-      ($direction == 4 ? GRADIENT_RADIAL : GRADIENT_LINEAR),
-      100.0,       # opacity
-      0.0,         # offset
-      REPEAT_NONE,
-      0,           # reverse
-      0,           # supersample
-      1,           # recursion levels
-      0.1,         # supersample threshold
-      0,                # dither
-    );
-    my %dir2argfunc = (
-      0 => sub { @_[3, 4, 1, 2] },
-      1 => sub { ($_[3], avg(@_[2,4]), $_[1], avg(@_[2,4])) },
-      2 => sub { @_[3, 2, 1, 4] },
-      3 => sub { (avg(@_[1,3]), $_[4], avg(@_[1,3]), $_[2]) },
-      4 => sub { (avg(@_[1,3]), avg(@_[2,4]), avg(@_[1,3]), $_[4]) }, # radial
-      5 => sub { (avg(@_[1,3]), $_[2], avg(@_[1,3]), $_[4]) },
-      6 => sub { @_[1, 4, 3, 2] },
-      7 => sub { ($_[1], avg(@_[2,4]), $_[3], avg(@_[2,4])) },
-      8 => sub { @_[1, 2, 3, 4] },
-    );
-    $mask->edit_blend(@blend_args, $dir2argfunc{$direction}->(@bounds));
-    $drawable->remove_mask(MASK_APPLY) if $direction >=0 && $direction <9;
-    Gimp::Context->pop;
-    $image->undo_group_end;
-  };
 
-exit main;
+=head1 IMAGE TYPES
+
+*
+
+=head1 HISTORY
+
+  2014/04/20 Ed J: rewrite to use Gimp::Fu and PF_CUSTOM
+  12/5/03: <sjburges gimp org>
+   s/->mask/->get_mask
+  3/21/04: <sjburges gimp org>
+   s/AlphaFade/alpha_fade/ to be compatible with PDB naming conventions
+
+=head1 AUTHOR
+
+Seth Burgess
+
+=head1 DATE
+
+2000
 
 =head1 LICENSE
 
 Copyright Seth Burgess.
+
 Distributed under the same terms as Gimp-Perl.
diff --git a/examples/frame_filter b/examples/frame_filter
index 3509adf..9f62de6 100755
--- a/examples/frame_filter
+++ b/examples/frame_filter
@@ -2,58 +2,43 @@
 
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
-
-register       "layer_apply",
-               "Apply a perl expression to every layer of the image",
-               "See POD documentation for detailed help.",
-               "Marc Lehmann <pcg\ goof com>",
-               "Marc Lehmann <pcg\ goof com>",
-               "19990708",
-               N_"<Image>/Filters/Generic/Apply Perl Expression...",
-               "*",
-               [
-                 [PF_TEXT,     "expr", "the perl expression to run for each layer",
-                                '$d->gauss_rle($P*100+1,1,1)'],
-                 [PF_DRAWABLE, "drawable2", "an optional extra drawable for use by the code"],
-               ],
-                [],
-       sub {
-               my($image,$_drawable,$function,$d2) = @_;
-
-                my($d,$i,$I,$n,$p,$P);
-
-                my @layers = $image->get_layers;
-                $n = @layers;
-                $n or die "at least one layer is required\n";
-
-                my $func = eval "sub{\n#line 0 \"expression\"\n$function\n}";
-                die "syntax error in expression '$function': $ \n" if $@;
-
-                # now apply the function
-                eval { $image->undo_group_start };
-               # 5.004 has problems with overlaying functions
-                Gimp->progress_init("Applying Expression...",-1);
-                for my $index (0..$n-1) {
-                   $i = $index;
-                   $I = $n-$i-1;
-                   $p = @layers > 1 ? $i/$#layers : 0;
-                   $P = 1-$p;
-                   $d = $layers[$i];
-
-                   eval { &$func };
-                   die "evaluation error in frame $i: $ \n" if $@;
-
-                   Gimp->progress_update(($i+1)/$n);
-                }
-                Gimp->displays_flush;
-                eval { $image->undo_group_end };
-       };
+use strict;
+
+podregister {
+  my @layers = $image->get_layers;
+  my $n = @layers or die "At least one layer is required\n";
+  my $func = eval "sub{\n#line 0 \"expression\"\n$expr\n}";
+  die "Syntax error in expression '$expr': $ \n" if $@;
+  # now apply the expr
+  eval { $image->undo_group_start };
+  # 5.004 has problems with overlaying functions
+  Gimp->progress_init("Applying Expression...",-1);
+  for my $i (0..$n-1) {
+    my $I = $n-$i-1;
+    my $p = @layers > 1 ? $i/$#layers : 0;
+    my $P = 1-$p;
+    my $d = $layers[$i];
+    eval { &$func };
+    die "Evaluation error in frame $i: $ \n" if $@;
+    Gimp->progress_update(($i+1)/$n);
+  }
+  eval { $image->undo_group_end };
+};
 
 exit main;
+__END__
+
+=head1 NAME
+
+layer_apply - Apply a perl expression to every layer of the image
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Generic/Apply Perl Expression...
 
 =head1 DESCRIPTION
 
-This function runs a perl expression for each layer of an image. The perl expression
+Runs a perl expression for each layer of an image. The perl expression
 can use the following variables:
 
 =over 4
@@ -85,7 +70,7 @@ The number of layers in the image.
 
 =item $d2 ("drawable")
 
-The drawable2 argument, entirely optional and can be used for anthing you
+The drawable2 argument, entirely optional and can be used for anything you
 like.
 
 =back
@@ -112,9 +97,26 @@ maybe C<$f->set_opacity(50)> for your animation.
  $f->set_mode(DARKEN_ONLY_MODE);
  $f->anchor;
 
+=head1 PARAMETERS
+
+ [PF_TEXT, "expr", "Perl expression to run for each layer",
+         '$d->gauss_rle($P*100+1,1,1)'],
+ [PF_DRAWABLE, "d2", "Optional extra drawable if your code needs it"],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Marc Lehmann <pcg goof com>
+
+=head1 DATE
+
+19990708
+
 =head1 LICENSE
 
-Copyright Marc Lehman
-Distributed under the same terms as Gimp-Perl.
+Marc Lehmann <pcg goof com>
 
-=cut
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/frame_reshuffle b/examples/frame_reshuffle
index 19b175c..dc88b7f 100755
--- a/examples/frame_reshuffle
+++ b/examples/frame_reshuffle
@@ -1,62 +1,44 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
+use Gimp;
+use Gimp::Fu;
+use strict;
+
+podregister {
+  my($image,$drawable,$function,$custom) = @_;
+  $custom = "-i"            if $function == 1;
+  $custom = "(i+$custom)%n" if $function == 2;
+  my @layers = $image->get_layers;
+  $layers[-1]->add_alpha;
+  # replace vars
+  $custom =~ s/\bn\b/scalar layers/ge;
+  $custom =~ s/\bi\b/\$i/g;
+  $function = eval "sub { my \$i = shift;\n#line 0 \"expression\"\n$custom\n}";
+  die "syntax error in expression '$custom': $ \n" if $@;
+  # calculate new order
+  my $index = 0;
+  @layers = map $_->[0],
+              sort { $b->[1] <=> $a->[1] }
+                 map [$_, $function->($index++)],
+                    @layers;
+  # now re-order the layers
+  $image->undo_group_start;
+  for(@layers) {
+    $image->raise_item_to_top($_) unless $$_ == ${($image->get_layers)[0]};
+  }
+  $image->undo_group_end;
+};
 
-# 07/15/03: <sjburges gimp org>
-# s/Layers/Layer
+exit main;
+__END__
 
-use Gimp 1.095;
-use Gimp::Fu;
+=head1 NAME
 
-register       "layer_reorder",
-               "Reshuffle the order of layers in an image according to a function",
-               "=pod",
-               "Marc Lehmann <pcg\ goof com>",
-               "Marc Lehmann <pcg\ goof com>",
-               "19990708",
-               N_"<Image>/Layer/Stack/Reorder Layers...",
-               "*",
-               [
-                 [PF_RADIO,    "function",     "which remapping function to use: CUSTOM (0), REVERSE (1), 
SHIFT (2)", 1,
-                  [Custom => 0, Reverse => 1, Shift => 2] ],
-                 [PF_STRING,   "custom",       "the (optional) custom function to use, e.g. 'n-i' reverses 
the order"],
-               ],
-                [],
-       sub {
-               my($img,$drawable,$function,$custom) = @_;
-
-                $custom = "-i"            if $function == 1;
-                $custom = "(i+$custom)%n" if $function == 2;
-
-                my @layers = $img->get_layers;
-
-                $layers[-1]->add_alpha;
-
-                # replace vars
-                $custom =~ s/\bn\b/scalar layers/ge;
-                $custom =~ s/\bi\b/\$i/g;
-
-                $function = eval "sub { my \$i = shift;\n#line 0 \"expression\"\n$custom\n}";
-                die "syntax error in expression '$custom': $ \n" if $@;
-
-                # calculcate new order
-                my $index = 0;
-                @layers = map $_->[0],
-                             sort { $b->[1] <=> $a->[1] }
-                                map [$_, $function->($index++)],
-                                   @layers;
-
-                # now re-order the layers
-               $img->undo_group_start;
-                for(@layers) {
-                   $img->raise_item_to_top($_) unless $$_ == ${($img->get_layers)[0]};
-                }
-                Gimp->displays_flush;
-               $img->undo_group_end;
-       };
+layer_reorder - Reshuffle the order of layers in an image according to a function
 
-exit main;
+=head1 SYNOPSIS
+
+<Image>/Layer/Stack/Reorder Layers...
 
 =head1 DESCRIPTION
 
@@ -84,9 +66,26 @@ Examples:
  -i        # reverse the order of layers
  (i+5)%n   # shift the order of frames by 5
 
+=head1 PARAMETERS
+
+ [PF_RADIO, "function", "Which remapping function to use", 1,
+  [Custom => 0, Reverse => 1, Shift => 2] ],
+ [PF_STRING, "custom", "The (optional) custom function to use, e.g. 'n-i' reverses the order"],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Marc Lehmann <pcg goof com>
+
+=head1 DATE
+
+19990708
+
 =head1 LICENSE
 
-Copyright Marc Lehman.
-Distributed under the same terms as Gimp-Perl.
+Marc Lehmann <pcg goof com>
 
-=cut
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/glowing_steel b/examples/glowing_steel
index 6f79820..bd0167a 100755
--- a/examples/glowing_steel
+++ b/examples/glowing_steel
@@ -1,33 +1,11 @@
 #!/usr/bin/perl
 
-# A plug-in for GIMP for producing logos and other such nifty things
-# which appear to be made of steel and floating over a glowing cloud.
-# This plug-in also includes several filters and such for performing the
-# various stages of this logo (e.g. brushed steel, add glow, highlight edges).
-#
-# Written in 1999 (c) by Aaron Sherman <ajs ajs com>.
-# This plugin may be distributed under the same terms as Gimp itself.
-# See http://www.gimp.org/ for more information on Gimp.
-
-=head1 LICENSE
-
-Written in 1999 (c) by Aaron Sherman <ajs ajs com>.
-This plugin may be distributed under the same terms as Gimp itself.
-
-=cut
-require 5.004;
-
 use Gimp qw(:auto N_);
 use Gimp::Fu;
 use Gimp::Util;
-
-N_"/Xtns/Render"; N_"/Xtns/Render/Logos"; # i18n workaround
-
 use strict;
-use vars qw($glowing_steel_version $glowing_steel_released);
 
-$glowing_steel_version = "1.0a";
-$glowing_steel_released = "6/14/1999";
+N_"/Xtns/Render"; N_"/Xtns/Render/Logos"; # i18n workaround
 
 sub perl_fu_glowing_steel {
   my $string = shift;
@@ -270,7 +248,7 @@ register
   "Highlight the edges of an alpha layer and make ".
        "it appear to have height. Not quite the same as a beveled edge, ".
        "this is a somewhat more subtle technique.",
-  "Aaron Sherman", "Aaron Sherman (c)", "1999-06-14",
+  '', '', '',
   N_"<Image>/Filters/Render/Highlight Edges...",
   "*",
   [
@@ -283,7 +261,7 @@ register
   "Create a brushed metal surface effect",
   "Make a surface (selected area) look like ".
        "brushed metal (kind of like steel).",
-  "Aaron Sherman", "Aaron Sherman (c)", "1999-06-14",
+  '', '', '',
   N_"<Image>/Filters/Render/Pattern/Brushed Metal...",
   "*",
   [
@@ -300,7 +278,7 @@ register
   "Add a glowing layer behind an existing layer. This ".
        "is very different from drop shadows, as the glow will extend out ".
        "in the given radius from all edges of the layer.",
-  "Aaron Sherman", "Aaron Sherman (c)", "1999-06-14",
+  '', '', '',
   N_"<Image>/Filters/Render/Add Glow",
   "*",
   [
@@ -315,7 +293,7 @@ register
   "Create the effect of a metallic surface over ".
        "a glowing surface. This effect was inspired by a poster for the ".
        "film \"Lost In Space\".",
-  "Aaron Sherman", "Aaron Sherman (c)", "1999-06-14",
+  '', '', '',
   N_"<Image>/File/Create/Logos/Glowing Steel",
   undef,
   [
@@ -332,7 +310,6 @@ register
   \&perl_fu_glowing_steel;
 
 exit main;
-
 __END__
 
 =head1 NAME
@@ -348,6 +325,11 @@ glowing_steel - A logo plugin for GIMP
 
 =head1 DESCRIPTION
 
+Produce logos and other such nifty things which appear to be made of
+steel and floating over a glowing cloud.  This plug-in also includes
+several filters and such for performing the various stages of this logo
+(e.g. brushed steel, add glow, highlight edges).
+
 This plugin renders the given text in the given font and size in a logo
 style that combines the I<Brushed Metal> effect with the I<Highlight Edges>
 and I<Add Glow> effects. The text is surfaced with brushed metal, and
@@ -443,19 +425,19 @@ that you turn off antialiasing).
 
 PDB call:
 
-  perl_fu_glowing_metal( string, font, size, glow_color,
+  my $image = perl_fu_glowing_metal( string, font, size, glow_color,
        back_color, glow_radius, highlight, antialias)
 
 =head1 AUTHOR
 
-Written in 1999 (c) by Aaron Sherman E<lt>ajs ajs comE<gt>
+Aaron Sherman <ajs ajs com>
 
-=head1 BUGS
+=head1 DATE
 
-TBD
+Version 1.0a released 1999-06-14
 
-=head1 SEE ALSO
+=head1 LICENSE
 
-L<gimp>, L<perl>, L<Gimp>: the Gimp module for perl.
+Written in 1999 (c) by Aaron Sherman <ajs ajs com>.
 
-=cut
+This plugin may be distributed under the same terms as Gimp itself.
diff --git a/examples/goldenmean b/examples/goldenmean
index 124ce52..cda88fc 100755
--- a/examples/goldenmean
+++ b/examples/goldenmean
@@ -1,55 +1,66 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 
-sub goldenmean {
-       my ($short, $type) = @_;
-
-       $long = int(($short * 1.618) + 0.5);
-
-       $width = $short;
-       $height = $long;
-
-       if ($type == 1) {
-               $width = $long;
-               $height = $short;
-       }
-
-       $img = gimp_image_new($width, $height, RGB);
-       $layer = gimp_layer_new($img, $width, $height, RGB_IMAGE, "Layer 1", 100, NORMAL_MODE);
-
-       gimp_image_insert_layer($layer, 0, -1);
-       Gimp::Context->push();
-       $layer->gimp_edit_fill(BACKGROUND_FILL);
-       Gimp::Context->pop();
-       Gimp::Display->new($img);
-
-       return $img;
-}
-
-register       "golden_mean",
-               "Creates a new image with a ratio according to the Golden Mean",
-               "Select shortest side and orientation and I will automagically calculate the long side. As a 
plug-in companion, see <Image>/Center Guide.",
-               "Claes G Lindblad <claesg\ algonet se>",
-               "Claes G Lindblad <claesg\ algonet se>",
-               "990328",
-               N_"<Image>/File/Create/Golden Mean...",
-               undef,
-       [
-       [PF_INT32, "short", "Shortest side", 233],
-       [PF_RADIO, "type", "Orientation(0=Portrait,1=Landscape)", 0, [Portrait => 0, Landscape => 1]]
-       ],
-       \&goldenmean;
+podregister {
+  my ($short, $type) = @_;
+
+  $long = int(($short * 1.618) + 0.5);
+
+  $width = $short;
+  $height = $long;
+
+  if ($type == 1) {
+    $width = $long;
+    $height = $short;
+  }
+
+  $img = gimp_image_new($width, $height, RGB);
+  $layer = gimp_layer_new($img, $width, $height, RGB_IMAGE, "Layer 1", 100, NORMAL_MODE);
+
+  gimp_image_insert_layer($layer, 0, -1);
+  Gimp::Context->push();
+  $layer->gimp_edit_fill(BACKGROUND_FILL);
+  Gimp::Context->pop();
+  Gimp::Display->new($img);
+
+  return $img;
+};
 
 exit main;
+__END__
+
+=head1 NAME
+
+golden_mean - Creates a new image with a ratio according to the Golden Mean
+
+=head1 SYNOPSIS
+
+<Image>/File/Create/Golden Mean...
+
+=head1 DESCRIPTION
+
+Select shortest side and orientation and I will automagically calculate
+the long side. As a plug-in companion, see <Image>/Center Guide.
+
+=head1 PARAMETERS
+
+  [PF_INT32, "short", "Shortest side", 233],
+  [PF_RADIO, "type", "Orientation(0=Portrait,1=Landscape)", 0, [Portrait => 0, Landscape => 1]]
+
+=head1 IMAGE TYPES
+
+=head1 AUTHOR
+
+Claes G Lindblad <claesg algonet se>
+
+=head1 DATE
+
+990328
 
 =head1 LICENSE
 
 Copyright Claes G Lindblad.
-Distributed under the terms of the GNU Public Licesne.
 
-=cut
+Distributed under the terms of the GNU Public Licesne.
diff --git a/examples/gouge b/examples/gouge
index 61fff71..ff421e3 100755
--- a/examples/gouge
+++ b/examples/gouge
@@ -1,10 +1,5 @@
 #!/usr/bin/perl
 
-# implements some algorithms described in (the otherwise very bad)
-# http://www.biocomputer.com/Thesis.html
-
-# these are all simple 2x2 kernels, fast but relatively effective
-
 use Gimp;
 use Gimp::Fu;
 use PDL::LiteF;
@@ -44,12 +39,9 @@ sub iterate {
 register "blur_2x2",
          "smooth (low pass filter) an image using a fast 2x2 kernel",
          "Low-pass filtering (smoothing) using a fast 2x2 kernel",
-         "Marc Lehmann",
-         "Marc Lehmann <pcg\ goof com>",
-         "19990725",
+         '', '', '',
        N_"<Image>/Filters/Blur/2x2 Blur",
-         "RGB*, GRAY*",
-         [],
+         '', [],
          sub {
    my($image,$drawable)= _;
 
@@ -66,12 +58,9 @@ register "blur_2x2",
 register "contrast_enhance_2x2",
          "contrast enhance an image using a fast 2x2 kernel",
          "Contrast Enhance an image using a fast 2x2 kernel",
-         "Marc Lehmann",
-         "Marc Lehmann <pcg\ goof com>",
-         "19990725",
+         '', '', '',
          N_"<Image>/Filters/Enhance/2x2 Contrast Enhance",
-         "RGB*, GRAY*",
-         [],
+         '', [],
          sub {
    my($image,$drawable)= _;
 
@@ -88,12 +77,9 @@ register "contrast_enhance_2x2",
 register "edge_detect_2x2",
          "detects edges in an image using a fast 2x2 kernel",
          "Detect edges in the image using a 2x2 kernel. It is similar to Sobel, yet sharper (and lower 
quality).",
-         "Marc Lehmann",
-         "Marc Lehmann <pcg\ goof com>",
-         "19990725",
+         '', '', '',
          N_"<Image>/Filters/Edge-Detect/2x2 Edge Detect",
-         "RGB*, GRAY*",
-         [],
+         '', [],
          sub {
    my($image,$drawable)= _;
 
@@ -112,18 +98,45 @@ register "edge_detect_2x2",
 };
 
 exit main;
+__END__
 
-=head1 LICENSE
+=head1 NAME
 
-Copyright Marc Lehman.
-Distributed under the same terms as Gimp-Perl.
+blur_2x2/contrast_enhance_2x2/edge_detect_2x2 - Use a fast 2x2 kernel
+to detect edges/enhance/smooth image
+
+=head1 SYNOPSIS
+
+  <Image>/Filters/Edge-Detect/2x2 Edge Detect
+  <Image>/Filters/Blur/2x2 Blur
+  <Image>/Filters/Enhance/2x2 Contrast Enhance
+
+=head1 DESCRIPTION
 
-=cut
+Detect edges in the image using a 2x2 kernel. It is similar to Sobel,
+yet sharper (and lower quality).
 
+Implements some algorithms described in (the otherwise very bad)
+L<http://www.biocomputer.com/Thesis.html>
 
+These are all simple 2x2 kernels, fast but relatively effective.
 
+=head1 PARAMETERS
 
+=head1 IMAGE TYPES
 
+RGB*, GRAY*
 
+=head1 AUTHOR
 
+Marc Lehmann
 
+=head1 DATE
+
+19990725
+
+=head1 LICENSE
+
+Marc Lehmann <pcg goof com>
+
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/guidegrid b/examples/guidegrid
index 082b91b..729ea65 100755
--- a/examples/guidegrid
+++ b/examples/guidegrid
@@ -1,97 +1,81 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
-# <sjburges gimp org> (original release)
-#
-# 11/7/99 <brendy swipnet se>
-# Added an option to remove existing guides
-# Added progress bar.
-#
-# 12/7/99 <sjburges gimp org>
-# Changed the display code in C and got rid of ugly hack in perl.
-#
-# 7/15/03 <sjburges gimp org>
-# Changed spot that its registered from <Image>/Guides to <Image>/Image/Guides
-# to reduce horizontal clutter on menubar
-
 use Gimp;
 use Gimp::Fu;
-use Gimp::Util;
 
 # Gimp::set_trace(TRACE_ALL);
 
-register "guide_grid",
-  "GuideGrid - creates a grid of guides\n",
-  "You specify the X spacing, the Y spacing, and initial offsets.  It creates a grid of guides\n",
-  "Seth Burgess",
-  "Seth Burgess <sjburges\ gimp org>",
-  "1999-03-20",
-  N_"<Image>/Image/Guides/Guide Grid...",
-  "*",
-  [
-   [PF_SPINNER, "x_spacing", "How far to space grid horizontally", 24, [1,1000,1]],
-   [PF_SPINNER, "y_spacing", "How far to space grid vertically", 24, [1,1000,1]],
-   [PF_SPINNER, "x_offset", "How much to initially offset it horizontally", 0, [0,1000,1]],
-   [PF_SPINNER, "y_offset", "How much to initially offset it vertically", 0, [0,1000,1]],
-   [PF_TOGGLE, "remove_old_guides", "Remove existing guides?", 0],
-  ],
-  [],
-  sub {
-    my($img,$layer,$xspace, $yspace, $xoffset, $yoffset, $remove_old_guides) = _;
-
-    #
-    # Remove all existing guides (this is optional)
-    #
-    if($remove_old_guides) {
-      $i=$img->find_next_guide(0);
-      while ($i != 0) {
-        $img->delete_guide($i);
-        $i=$img->find_next_guide(0);
-      }
+podregister {
+  # Remove all existing guides (this is optional)
+  if($remove_old_guides) {
+    my $i=$image->find_next_guide(0);
+    while ($i != 0) {
+      $image->delete_guide($i);
+      $i=$image->find_next_guide(0);
     }
+  }
+  for (my $i=$xoffset; $i<$image->width; $i+=$xspace) {
+    $image->add_vguide($i) if $i;
+  }
+  for (my $i=$yoffset; $i<$image->height; $i+=$yspace) {
+    $image->add_hguide($i) if $i;
+  }
+  $drawable->update(0, 0, $image->height, $image->width);
+  return;
+};
+exit main;
+__END__
 
-    #
-    # Add vertical guides to the image
-    #
-    for ($i=$xoffset; $i<$img->width; $i+=$xspace) {
-      if ($i) {
-       $img->add_vguide($i);
-      }
-    }
+=head1 NAME
 
-    #
-    # Add horizontal guides to the image
-    #
-    for ($i=$yoffset; $i<$img->height; $i+=$yspace) {
-      if ($i) {
-       $img->add_hguide($i);
-      }
-    }
+guide_grid - creates a grid of guides
 
-    #
-    # I fixed this in Gimp C code (it wasn't flushing guides properly)
-    # Seth Burgess <sjburges gimp org>
-    #
+=head1 SYNOPSIS
 
-    ##
-    ## Refresh the display (probably not good, works for me!)
-    ##
-    ##
-    #$img->selection_all();
-    #$img->selection_none();
+<Image>/Image/Guides/Guide Grid...
 
-    $layer->update(0, 0, $img->height, $img->width);
+=head1 DESCRIPTION
 
-    return();
-  };
-exit main;
+You specify the X spacing, the Y spacing, and initial offsets.  It creates
+a grid of guides.
 
-=head1 LICENSE
+=head1 PARAMETERS
 
-Copyright Seth Burgess.
-Distributed under the same terms as Gimp-Perl.
+ [PF_SPINNER, "xspace", "How far to space grid horizontally", 24, [1,1000,1]],
+ [PF_SPINNER, "yspace", "How far to space grid vertically", 24, [1,1000,1]],
+ [PF_SPINNER, "xoffset", "How much to initially offset it horizontally", 0, [0,1000,1]],
+ [PF_SPINNER, "yoffset", "How much to initially offset it vertically", 0, [0,1000,1]],
+ [PF_TOGGLE, "remove_old_guides", "Remove existing guides?", 0],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 HISTORY
+
+  <sjburges gimp org> (original release)
 
-=cut
+  11/7/99 <brendy swipnet se>
+  Added an option to remove existing guides
+  Added progress bar.
 
+  12/7/99 <sjburges gimp org>
+  Changed the display code in C and got rid of ugly hack in perl.
+
+  7/15/03 <sjburges gimp org>
+  Changed spot that its registered from <Image>/Guides to <Image>/Image/Guides
+  to reduce horizontal clutter on menubar
+
+=head1 AUTHOR
+
+Seth Burgess
+
+=head1 DATE
+
+1999-03-20
+
+=head1 LICENSE
+
+Seth Burgess <sjburges gimp org>
+
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/guides_to_selection b/examples/guides_to_selection
index 6f3006c..90ebce0 100755
--- a/examples/guides_to_selection
+++ b/examples/guides_to_selection
@@ -1,63 +1,73 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
-# 7/15/03 <sjburges gimp org>
-# Changed spot that its registered from <Image>/Guides to <Image>/Image/Guides
-# to reduce horizontal clutter on menubar
-
 use Gimp;
 use Gimp::Fu;
 use Gimp::Util;
 
-register "guide_to_selection",
-         "Puts a selection mask around the guides",
-         "Selects the area under the guides (1px wide)",
-         "Marc Lehmann",
-         "Marc Lehmann <pcg\ goof com>",
-         "1999-08-01",
-         N_"<Image>/Image/Guides/To Selection...",
-         "*",
-         [
-          [PF_RADIO,   "operation",    "The selection operation (CHANNEL_OP_ADD, CHANNEL_OP_SUBTRACT, 
CHANNEL_OP_REPLACE)",            CHANNEL_OP_REPLACE,
-                     [ADD => CHANNEL_OP_ADD, SUB => CHANNEL_OP_SUBTRACT, REPLACE => CHANNEL_OP_REPLACE]],
-          [PF_TOGGLE,  "feather",      "Feather the selection?",               0],
-          [PF_SPINNER, "feather_radius","Radius for feather operation",        1, [0, 1000, 1e0]],
-         ],
-         [],
-         sub {
-    my($img, $drawable, $operation, $feather, $radius) = @_;
-    my($W,$H) = ($img->width, $img->height);
-    Gimp::Context->push;
-    Gimp::Context->set_feather($feather);
-    Gimp::Context->set_feather_radius($radius, $radius);
-
-    $i = $img->find_next_guide(0);
-    while ($i) {
-      my ($x,$y,$w,$h);
-      $x = $img->get_guide_position($i);
-      if ($img->get_guide_orientation($i) == ORIENTATION_HORIZONTAL) {
-         ($x,$y,$w,$h) = (0,$x-$w,$W,1);
-      } else {
-         ($x,$y,$w,$h) = ($x,0,1,$H);
-      }
-      $img->select_rectangle($operation,$x,$y,$w,$h);
-      $operation = CHANNEL_OP_ADD if $operation == CHANNEL_OP_REPLACE;
-
-      $i = $img->find_next_guide($i);
+podregister {
+  my($W,$H) = ($image->width, $image->height);
+  Gimp::Context->push;
+  Gimp::Context->set_feather($feather);
+  Gimp::Context->set_feather_radius($radius, $radius);
+  $i = $image->find_next_guide(0);
+  while ($i) {
+    my ($x,$y,$w,$h);
+    $x = $image->get_guide_position($i);
+    if ($image->get_guide_orientation($i) == ORIENTATION_HORIZONTAL) {
+      ($x,$y,$w,$h) = (0,$x-$w,$W,1);
+    } else {
+      ($x,$y,$w,$h) = ($x,0,1,$H);
     }
-    Gimp::Context->pop;
-
-    ();
+    $image->select_rectangle($operation,$x,$y,$w,$h);
+    $operation = CHANNEL_OP_ADD if $operation == CHANNEL_OP_REPLACE;
+    $i = $image->find_next_guide($i);
+  }
+  Gimp::Context->pop;
+  ();
 };
 
 exit main;
+__END__
 
-=head1 LICENSE
+=head1 NAME
 
-Copyright Marc Lehman.
-Distributed under the same terms as Gimp-Perl.
+guide_to_selection - Puts a selection mask around the guides
+
+=head1 SYNOPSIS
+
+<Image>/Image/Guides/To Selection...
+
+=head1 DESCRIPTION
+
+Selects the area under the guides (1px wide)
+
+=head1 PARAMETERS
+
+  [PF_RADIO, "operation", "The selection operation", CHANNEL_OP_REPLACE,
+            [ADD => CHANNEL_OP_ADD, SUB => CHANNEL_OP_SUBTRACT, REPLACE => CHANNEL_OP_REPLACE]],
+  [PF_TOGGLE, "feather", "Feather the selection?", 0],
+  [PF_SPINNER, "radius","Radius for feather operation", 1, [0, 1000, 1e0]],
 
-=cut
+=head1 IMAGE TYPES
 
+*
+
+=head1 HISTORY
+
+ 7/15/03 <sjburges gimp org>
+ Changed spot that its registered from <Image>/Guides to <Image>/Image/Guides
+ to reduce horizontal clutter on menubar
+
+=head1 AUTHOR
+
+Marc Lehmann
+
+=head1 DATE
+
+1999-08-01
+
+=head1 LICENSE
+
+Marc Lehmann <pcg goof com>
+
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/innerbevel b/examples/innerbevel
index ad1d1ec..ceca9df 100755
--- a/examples/innerbevel
+++ b/examples/innerbevel
@@ -1,13 +1,5 @@
 #!/usr/bin/perl
 
-# Effect taken from http://tigert.gimp.org/gimp/tutorials/beveled_text/
-# perl-ified by Seth Burgess <sjburges gimp org>
-
-# Programatically, this script is about as dull as they come.  The only
-# exceptions are those of the neat util functions (that aren't all quite
-# working btw).  You can follow step by step with the website at
-# http://tigert.gimp.org/gimp/tutorials/beveled_text/
-
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 use Gimp::Util;
@@ -16,92 +8,100 @@ use Gimp::Util;
 
 N_"/Xtns/Render"; N_"/Xtns/Render/Logos"; # i18n workaround
 
-$defaultcolor1 = [124,10,18];
-$defaultcolor2 = [200,19,27];
-
-$path = N_"<Image>/File/Create/Logos/Inner Bevel...";
-$shortdesc = "Perform an inner bevel on text";
-$longdesc = "This uses tigert's inner bevel method on text, which can be found with his other excellent 
tutorials at http://tigert.gimp.org/";;
-$date = "1999-03-23";
-$imgtypes = "";
-$author = "Seth Burgess <sjburges\ gimp org>";
-
-$regname = "inner_bevel";
-
-$author =~ m/^(.*) </;
-$authorname = $1;
-
-register $regname, $shortdesc, $longdesc, $authorname, $author, $date, $path, $imgtypes,
-  [
-   [PF_FONT, "font", "Font Name","URW Bookman L, Bold"],
-   [PF_FLOAT, "fontsize", "Size of text", 80],
-   [PF_STRING, "text", "Enter your text to be beveled", "INNERBEVEL"],
-   [PF_COLOR, "top_color", "Blend to this color", $defaultcolor2],
-   [PF_COLOR, "bottom_color", "Blend from this color", $defaultcolor1],
-   [PF_SLIDER, "azimuth", "Direction of the shine", 132, [0,255,5]],
-   [PF_SLIDER, "shinyness", "How shiny the final image will be",30, [0,90,5]],
-   [PF_SLIDER, "depth_shape", "Determines the final shape", 7 , [0,64,32]],
-   [PF_RADIO, "map", "The type of Map to use(0=Linear,1=Spherical,2=Sinusoidal)", 2, [Linear => 0, Spherical 
=> 1, Sinusoidal => 2] ],
-  ],
-  sub {
-my ($font, $fontsize, $text, $color1, $color2, $azimuth, $elevation, $depth, $maptype) = @_;
-
-# -- step 1 --
-Gimp::Context->push();
-
-Gimp::Context->set_background($color1);
-Gimp::Context->set_foreground($color2);
-
- dims = Gimp->text_get_extents_fontname($text, $fontsize, PIXELS,$font);
-
-$img = gimp_image_new($dims[0]+30, $dims[1]+10, RGB);
-
-# none of the macro's did quite what I was looking for here.
-# i.e. create a text layer on transparent only...
-
-# -- step 2 --
-$img->add_new_layer(0,TRANSPARENT_FILL);
-$img->text_fontname(-1, 10, 10, $text, 0, 1, $fontsize, PIXELS, $font);
-Gimp::Display->new($img);  # display the image early
-$layer = $img->merge_visible_layers(EXPAND_AS_NECESSARY);
- pt1 = ($layer->width * 0.5 -1, 0);
- pt2 = ($layer->width * 0.5 +1, $layer->height);
-# -- step 3 --
-$layer->set_lock_alpha(1);
-$layer->edit_blend(FG_BG_RGB_MODE, NORMAL_MODE, GRADIENT_LINEAR, 100, 0, REPEAT_NONE, 0, 0, 0, 3, 0.20, 
@pt1, @pt2);
-# -- step 4 --
-$layer2 = $layer->copy(0);     # Can you override these to have a default? (would be nice)
-$img->insert_layer($layer2, 0, 0);
-# -- step 5 --
-$layer2->set_lock_alpha(1);
-$img->selection_all;
-Gimp::Context->set_background([1.0,1.0,1.0]);
-$layer2->edit_fill(BACKGROUND_FILL);
-# -- step 6 --
-$layer2->set_lock_alpha(0);
-$layer2->gauss_rle(6,1,1);
-# -- step 7 --
-$layer->plug_in_bump_map($layer2, $azimuth, $elevation, $depth, 0,0,0,0,1,0,$maptype);
-# -- step 8 --
-$layer2->invert;
-$img->lower_item($layer2);
-# -- step 9 --
-$layer2->translate(2, 3);
-
-# extra stuff
-$img->add_new_layer(2);
-$img->gimp_selection_none();
-
-Gimp::Context->pop();
-return($img);
+podregister {
+  # -- step 1 --
+  Gimp::Context->push();
+  Gimp::Context->set_background($color1);
+  Gimp::Context->set_foreground($color2);
+  @dims = Gimp->text_get_extents_fontname($text, $fontsize, PIXELS,$font);
+  $img = gimp_image_new($dims[0]+30, $dims[1]+10, RGB);
+
+  # none of the macro's did quite what I was looking for here.
+  # i.e. create a text layer on transparent only...
+
+  # -- step 2 --
+  $img->add_new_layer(0,TRANSPARENT_FILL);
+  $img->text_fontname(-1, 10, 10, $text, 0, 1, $fontsize, PIXELS, $font);
+  Gimp::Display->new($img);  # display the image early
+  $layer = $img->merge_visible_layers(EXPAND_AS_NECESSARY);
+  @pt1 = ($layer->width * 0.5 -1, 0);
+  @pt2 = ($layer->width * 0.5 +1, $layer->height);
+  # -- step 3 --
+  $layer->set_lock_alpha(1);
+  $layer->edit_blend(FG_BG_RGB_MODE, NORMAL_MODE, GRADIENT_LINEAR, 100, 0, REPEAT_NONE, 0, 0, 0, 3, 0.20, 
@pt1, @pt2);
+  # -- step 4 --
+  $layer2 = $layer->copy(0);     # Can you override these to have a default? (would be nice)
+  $img->insert_layer($layer2, 0, 0);
+  # -- step 5 --
+  $layer2->set_lock_alpha(1);
+  $img->selection_all;
+  Gimp::Context->set_background([1.0,1.0,1.0]);
+  $layer2->edit_fill(BACKGROUND_FILL);
+  # -- step 6 --
+  $layer2->set_lock_alpha(0);
+  $layer2->gauss_rle(6,1,1);
+  # -- step 7 --
+  $layer->plug_in_bump_map($layer2, $azimuth, $elevation, $depth, 0,0,0,0,1,0,$maptype);
+  # -- step 8 --
+  $layer2->invert;
+  $img->lower_item($layer2);
+  # -- step 9 --
+  $layer2->translate(2, 3);
+  # extra stuff
+  $img->add_new_layer(2);
+  $img->gimp_selection_none();
+  Gimp::Context->pop();
+  return($img);
 };
 
-exit main;  # <-- This lil' bugger caused me much grief.
+exit main;
+__END__
 
-=head1 LICENSE
+=head1 NAME
 
-Copyright Seth Burgess.
-Distributed under the same terms as Gimp-Perl.
+inner_bevel - Perform an inner bevel on text
+
+=head1 SYNOPSIS
+
+<Image>/File/Create/Logos/Inner Bevel...
+
+=head1 DESCRIPTION
+
+This uses tigert's inner bevel method on text, which can be found with
+his other excellent tutorials at http://tigert.gimp.org/
+
+Effect taken from L<http://tigert.gimp.org/gimp/tutorials/beveled_text/>, 
+perl-ified by Seth Burgess <sjburges gimp org>
+
+Programatically, this script is about as dull as they come.  The only
+exceptions are those of the neat util functions (that aren't all quite
+working btw).  You can follow step by step with the website at
+L<http://tigert.gimp.org/gimp/tutorials/beveled_text/>
 
-=cut
+=head1 PARAMETERS
 
+ [PF_FONT, "font", "Font Name","URW Bookman L, Bold"],
+ [PF_FLOAT, "fontsize", "Size of text", 80],
+ [PF_STRING, "text", "Enter your text to be beveled", "INNERBEVEL"],
+ [PF_COLOR, "color1", "Blend to this color", [200,19,27]],
+ [PF_COLOR, "color2", "Blend from this color", [124,10,18]],
+ [PF_SLIDER, "azimuth", "Direction of the shine", 132, [0,255,5]],
+ [PF_SLIDER, "elevation", "How shiny the final image will be",30, [0,90,5]],
+ [PF_SLIDER, "depth", "Determines the final shape", 7 , [0,64,32]],
+ [PF_RADIO, "maptype", "The type of Map to use(0=Linear,1=Spherical,2=Sinusoidal)", 2, [Linear => 0, 
Spherical => 1, Sinusoidal => 2] ],
+
+=head1 IMAGE TYPES
+
+=head1 AUTHOR
+
+Seth Burgess
+
+=head1 DATE
+
+1999-03-23
+
+=head1 LICENSE
+
+Seth Burgess <sjburges gimp org>
+
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/layerfuncs b/examples/layerfuncs
index dfe834d..f1ea856 100755
--- a/examples/layerfuncs
+++ b/examples/layerfuncs
@@ -4,30 +4,45 @@ use Gimp;
 use Gimp::Fu;
 # Gimp::set_trace(TRACE_ALL);
 
-# 7/15/03: <sjburges gimp org>
-# * s/Layers/Layer/ in registration
-# * remove layer_to_image_size, since its in core now
-#
-# These are a couple of one-liners that you might find handy.  Both should
-# be undoable w/o any special magick, and work with any gimp.
-
-register "center_layer", "Center Layer",
-         "Centers the current layer on the image",
-         "Seth Burgess", "Seth Burgess <sjburges\ gimp org>",
-         "1.0", N_"<Image>/Layer/Center Layer", "*", [], sub {
-       ($img, $layer) = @_;
-       die "Must have layer selected\n" unless $layer->is_layer;
-       $layer->become('Gimp::Layer');
-       $layer->set_offsets(($img->width  - $layer->width )/2,
-                        ($img->height - $layer->height)/2);
-       return();
+podregister {
+  die "Must have layer selected\n" unless $drawable->is_layer;
+  $drawable->become('Gimp::Layer');
+  $drawable->set_offsets(
+    ($image->width - $drawable->width )/2,
+    ($image->height - $drawable->height)/2
+  );
+  return;
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+center_layer - Center Layer
+
+=head1 SYNOPSIS
+
+<Image>/Layer/Center Layer
+
+=head1 DESCRIPTION
+
+Centers the current layer on the image
+
+=head1 PARAMETERS
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Seth Burgess <sjburges gimp org>
+
+=head1 DATE
+
+1.0
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/map_to_gradient b/examples/map_to_gradient
index 2d396ed..a99714f 100755
--- a/examples/map_to_gradient
+++ b/examples/map_to_gradient
@@ -13,21 +13,7 @@ sub togrey {
    $pdl;
 }
 
-register "map_to_gradient",
-         "map grayscale values to gradient",
-         "Map all the pixels to the colours of a gradient according to their greyscale value.",
-         "Marc Lehmann",
-         "Marc Lehmann <pcg\ goof com>",
-         "19990802",
-         N_"<Image>/Filters/Colors/Map/Map To Gradient...",
-         "RGB*, GRAY",
-         [
-          [PF_GRADIENT,        "gradient",     "The gradient to map to"],
-         ],
-         sub {
-   my($image,$drawable,$gradient)= _;
-
-   # 5.004 has problems with overlaying functions
+podregister {
    Gimp->progress_init ("Mapping to '$gradient'", -1);
 
    my $grad = pdl byte, map $_*255, Gimp->gradient_get_uniform_samples($gradient,256,0);
@@ -63,19 +49,43 @@ register "map_to_gradient",
       } while (Gimp->pixel_rgns_process ($iter));
    }
    Gimp->progress_update (1);
-
    $drawable->merge_shadow (1);
    $drawable->update (@bounds);
-
    ();
 };
 
 exit main;
+__END__
 
-=head1 LICENSE
+=head1 NAME
 
-Copyright Marc Lehman.
-Distributed under the same terms as Gimp-Perl.
+map_to_gradient - map grayscale values to gradient
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Colors/Map/Map To Gradient...
+
+=head1 DESCRIPTION
+
+Map all the pixels to the colours of a gradient according to their
+greyscale value.
+
+=head1 PARAMETERS
 
-=cut
+  [PF_GRADIENT, "gradient", "The gradient to map to"],
 
+=head1 IMAGE TYPES
+
+RGB*, GRAY
+
+=head1 AUTHOR
+
+Marc Lehmann <pcg goof com>
+
+=head1 DATE
+
+19990802
+
+=head1 LICENSE
+
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/mirrorsplit b/examples/mirrorsplit
index 37c70da..c7919cf 100755
--- a/examples/mirrorsplit
+++ b/examples/mirrorsplit
@@ -5,38 +5,17 @@ use Gimp::Fu;
 use Gimp::Util;
 use strict;
 #Gimp::set_trace(TRACE_ALL);
-#
-# <sjburges gimp org> 2/25/04: changed specifiers to explictly reference
-# the GIMP namespace, s/undo_push/undo/, now have to add layer to image in
-# order to flip it, or you get a PDB error.  So added, flipped, used, then
-# removed.
-
-register
-  "mirror_split",
-  "Splits and mirrors half of the image, according to settings.",
-  "Just tick appropriate radio button.",
-  "Claes G Lindblad <claesg\ algonet se>",
-  "Claes G Lindblad <claesg\ algonet se>",
-  "990530",
-  N_"<Image>/Filters/Distorts/MirrorSplit...",
-  "*",
-  [
-  [PF_RADIO, "mirror", "Which half to mirror (0=U,1=D,2=L,3=R)", 0,
-    [Upper => 0, Lower => 1, Left => 2, Right => 3]
-  ]
-  ],
-sub {
-  my ($img, $layer, $mirror) = @_;
 
-  my $w = $layer->width();
-  my $h = $layer->height();
+podregister {
+  my $w = $drawable->width();
+  my $h = $drawable->height();
   my $wspan = int ($w / 2 + 0.5);
   my $hspan = int ($h / 2 + 0.5);
 
-  eval { $img->undo_group_start };
+  eval { $image->undo_group_start };
 
-  my $temp1 = gimp_layer_copy($layer, 1);
-  $img->insert_layer($temp1,0,-1);
+  my $temp1 = gimp_layer_copy($drawable, 1);
+  $image->insert_layer($temp1,0,-1);
   my $orientation = ($mirror < 2)
     ? &Gimp::ORIENTATION_VERTICAL
     : &Gimp::ORIENTATION_HORIZONTAL;
@@ -55,23 +34,59 @@ sub {
     # right half
     @xywh = (0, 0, $wspan, $h);
   };
-  $img->select_rectangle(&Gimp::CHANNEL_OP_REPLACE, @xywh);
+  $image->select_rectangle(&Gimp::CHANNEL_OP_REPLACE, @xywh);
 
   gimp_edit_copy($temp1);
-  my $temp2 = gimp_edit_paste($layer, 1);
+  my $temp2 = gimp_edit_paste($drawable, 1);
   gimp_floating_sel_anchor($temp2);
-  $img->remove_layer($temp1);
-  gimp_selection_none($img);
+  $image->remove_layer($temp1);
+  gimp_selection_none($image);
 
-  eval { $img->undo_group_end };
+  eval { $image->undo_group_end };
   return;
 };
 exit main;
+__END__
 
-=head1 LICENSE
+=head1 NAME
 
-Copyright Claes G. Lindbad.
-Distributed under terms of the GNU Public License.
+mirror_split - Splits and mirrors half of the image, according to settings
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Distorts/MirrorSplit...
 
-=cut
+=head1 DESCRIPTION
+
+Just tick appropriate radio button.
+
+=head1 PARAMETERS
+
+  [PF_RADIO, "mirror", "Which half to mirror (0=U,1=D,2=L,3=R)", 0,
+    [Upper => 0, Lower => 1, Left => 2, Right => 3]
+  ]
 
+=head1 IMAGE TYPES
+
+*
+
+=head1 HISTORY
+
+<sjburges gimp org> 2/25/04: changed specifiers to explictly reference
+the GIMP namespace, s/undo_push/undo/, now have to add layer to image in
+order to flip it, or you get a PDB error.  So added, flipped, used, then
+removed.
+
+=head1 AUTHOR
+
+Claes G Lindblad <claesg algonet se>
+
+=head1 DATE
+
+990530
+
+=head1 LICENSE
+
+Claes G Lindblad <claesg algonet se>
+
+Distributed under terms of the GNU Public License.
diff --git a/examples/perlotine b/examples/perlotine
index dfc1bc5..9f7b5ac 100755
--- a/examples/perlotine
+++ b/examples/perlotine
@@ -1,35 +1,6 @@
 #!/usr/bin/perl
 
-# <sjburges gimp org>
-# This is tigert's request.  I suppose it'll be useful to those that do
-# this sort of thing.  Personally I'll probably only run it to test and
-# put up a demo image.
-
-# Since updated a couple times by others, and intgrated by me:
-#
-# Bruce Miller                              (fixed to accomdate 1.1.x changes)
-# Brendon and Wendy Humphrey <brendy swipnet se> (progress bar, nice comments)
-#
-# Tuomas Kuosmanen <tigert gimp org>
-# Fixed some things to make this work with cvs gimp. Fixed calls to
-# gimp_get_guide_orientation() (guide types that changed from
-# GUIDE_VERTICAL to VERTICAL and horizontal, respectively.  Should
-# work now). Also convert to indexed parameters changed, fixed them too.
-#
-# <sjburges gimp org>
-# Added changes to make progess bar work for images with only horizontal
-# or vertical guides.  This was fixed at one time, I forget who did that.
-# Somehow it got broke again ;(
-#
-# Added File::Path; for making the directory if it doesn't already exist.
-#
-# 12/13/03: fixed tigert's fix to use ORIENTATION_VERTICAL rather
-#           than VERTICAL
-#
-# If you have more additions, etc please don't hesitate to send them in!
-
 use File::Path;
-
 use Gimp;
 use Gimp::Fu;
 use Gimp::Util;
@@ -37,224 +8,194 @@ use Gimp::Util;
 #$Gimp::verbose = 1;
 # Gimp::set_trace(TRACE_ALL);
 
-# Generates an ordered list of all existing vertical guides.
-
-sub get_vguides {
-    my ($img)= _;
-    $i=0;
-    my @vguides;
-    while ($i=$img->find_next_guide($i)) {
-        if ($img->get_guide_orientation($i) == &Gimp::ORIENTATION_VERTICAL){
-           $keyval = sprintf("%4d", $img->get_guide_position($i));
-            $vkeys{$keyval} = $i;
-            }
-        }
-    foreach $key(sort (keys %vkeys)) {
-        # print "Unshifting ",  $key, "\n";
-        push @vguides, $vkeys{$key};
-        }
-    return @vguides;
-    }
-
-#
-# Generates an ordered list of all existing horizontal guides.
-#
-
-sub get_hguides {
-    my ($img)= _;
-    $i=0;
-    my @hguides;
-    while ($i=$img->find_next_guide($i)) {
-        if ($img->get_guide_orientation($i) == &Gimp::ORIENTATION_HORIZONTAL){
-            $keyval = sprintf("%4d", $img->get_guide_position($i));
-            $hkeys{$keyval} = $i;
-            }
-        }
-    # need to sort them in order of their occurance in the image
-    foreach $key(sort keys %hkeys) {
-        push @hguides, $hkeys{$key};
-        }
-    return @hguides;
-    }
+sub get_guides {
+  my $image = shift;
+  my %orientation2guidepos2guide;
+  for (my $i = 0; $i = $image->find_next_guide($i); ) {
+    $orientation2guidepos2guide{
+      $image->get_guide_orientation($i)
+    }->{
+      sprintf "%5d", $image->get_guide_position($i)
+    } = $i;
+  }
+  \%orientation2guidepos2guide;
+}
+
+# Generates an ordered list of all existing (x) guides.
+sub get_orientguides {
+  my ($orientation2guidepos2guide, $orient) = @_;
+  my $gp2g = $orientation2guidepos2guide->{$orient};
+  map { $gp2g->{$_} } sort keys %$gp2g;
+}
 
-#
 # Duplicate, crop and save the image fragment.
-#
-
 sub dosel {
-    ($img, $savepath, $imgpath, $imgbasename, $extension, $l,$r,$t,$b, $i,$j) = @_;
+  my ($image, $savepath, $imgpath, $imgbasename, $extension, $l,$r,$t,$b, $i,$j) = @_;
 #    $filename =~ m/^(.*)\.[^\.]*$/ ;
-    $imgname = "$imgbasename-$i-$j.$extension";
-    $tmpimg = $img->duplicate;
-    # print "Cropping from $l to $r, $t to $b\n";
-    $tmpimg->crop($r-$l, $b-$t, $l, $t);
-    # Make sure that gif and jpg are of proper type before proceeding.
-    # I could move this outside the dosel for performance improvement,
-    # but then it would end up changing the user's image, which may
-    # not be desired/expected.
-    if ($extension eq "gif")
-      {
-        if (!(($tmpimg->get_layers())[0]->is_indexed()))
-       {
-          $tmpimg->image_convert_indexed(0,0,255,0,0,"NULL");
-       }
-      }
-    if ($extension eq "jpg")
-      {
-        if (!(($tmpimg->get_layers())[0]->is_rgb()))
-       {
-          $tmpimg->image_convert_rgb();
-       }
-      }
+  $imgname = "$imgbasename-$i-$j.$extension";
+  $tmpimage = $image->duplicate;
+  # print "Cropping from $l to $r, $t to $b\n";
+  $tmpimage->crop($r-$l, $b-$t, $l, $t);
+  # Make sure that gif and jpg are of proper type before proceeding.
+  # I could move this outside the dosel for performance improvement,
+  # but then it would end up changing the user's image, which may
+  # not be desired/expected.
+  $tmpimage->image_convert_indexed(0,0,255,0,0,"NULL")
+    if $extension eq "gif" and !($tmpimage->get_layers)[0]->is_indexed;
+  $tmpimage->image_convert_rgb
+    if $extension eq "jpg" and !($tmpimage->get_layers)[0]->is_rgb;
+  $tmpimage->Gimp::Fu::save_image("$savepath$imgpath$imgname","$savepath$imgpath$imgname");
+  $tmpimage->delete;
+  return "$imgpath$imgname"; # what I want printed in html
+}
 
-
-    $tmpimg->Gimp::Fu::save_image("$savepath$imgpath$imgname","$savepath$imgpath$imgname");
-    $tmpimg->delete;
-    return "$imgpath$imgname"; # what I want printed in html
-    }
-
-#
 # HTML Table Generation Functions
-#
-
 sub html_table_start {
-    ($fn,$cellpadding,$cellspacing,$border,$capatalize) = @_;
-    $str = $capatalize ?
+  my ($fn,$cellpadding,$cellspacing,$border,$capitalize_tags) = @_;
+  $str = $capitalize_tags ?
 "<TABLE CELLSPACING=$cellspacing CELLPADDING=$cellpadding BORDER=$border>\n" :
 "<table cellspacing=$cellspacing cellpadding=$cellpadding border=$border>\n" ;
-    print $fn $str;
-    }
+  print $fn $str;
+}
 
 sub html_table_row_start {
-    ($fn, $capatalize) = @_;
-    $str = $capatalize ? "\t<TR>\n" : "\t<tr>\n";
-    print $fn $str;
-    }
+  my ($fn, $capitalize_tags) = @_;
+  $str = $capitalize_tags ? "\t<TR>\n" : "\t<tr>\n";
+  print $fn $str;
+}
 
 sub html_table_entry {
-    ($fn, $imgname, $width, $height, $capatalize) = @_;
-    $str = $capatalize ?
+  my ($fn, $imgname, $width, $height, $capitalize_tags) = @_;
+  $str = $capitalize_tags ?
 "\t\t<TD><IMG ALT=\" \" SRC=\"$imgname\" WIDTH=\"$width\" HEIGHT=\"$height\"></TD>\n" :
 "\t\t<td><img alt=\" \" src=\"$imgname\" width=\"$width\" height=\"$height\"></td>\n";
-    print $fn $str;
-    }
+  print $fn $str;
+}
 
 sub html_table_row_end {
-    ($fn, $capatalize) = @_;
-    $str = $capatalize ? "\t</TR>\n" : "\t</tr>\n";
-    print $fn $str;
-    }
+  my ($fn, $capitalize_tags) = @_;
+  $str = $capitalize_tags ? "\t</TR>\n" : "\t</tr>\n";
+  print $fn $str;
+}
 
 sub html_table_end {
-    ($fn, $capatalize) = @_;
-    $str = $capatalize ? "</TABLE>\n":"</table>\n";
-    print $fn $str;
+  my ($fn, $capitalize_tags) = @_;
+  $str = $capitalize_tags ? "</TABLE>\n":"</table>\n";
+  print $fn $str;
+}
+
+podregister {
+  my $o2gp2g = get_guides($image);
+  my @vert = get_orientguides($o2gp2g, &Gimp::ORIENTATION_VERTICAL);
+  my @horz = get_orientguides($o2gp2g, &Gimp::ORIENTATION_HORIZONTAL);
+  die __"Abort: no horizontal or vertical guides found.\n" unless @vert + @horz;
+  Gimp->progress_init("Perl-o-Tine");
+  $progress_increment = 1/( (scalar(@horz)+1) * (scalar(@vert)+1) );
+  $progress = 0.0;
+  # (Debugging info for the guide functions)
+  # print @vert, " LEN = ", scalar(@vert), "\n";
+  # print @horz, " LEN = ", scalar(@horz), "\n";
+  # foreach $guide (@vert) {
+  #   print $image->get_guide_position($guide), "\n";
+  # }
+  # Correctly format paths and filenames
+  map { $_ .= "/" unless m/\/$/; } ($savepath, $imgpath);
+  $imgpath = "" unless $separate;
+  mkpath($savepath . $imgpath);
+  open FILE, ">$savepath$htmlname" or die "Couldn't open $savepath$htmlname: $!\n";
+  $top=0;
+  html_table_start(\*FILE,0,$cellspacing,0,$capitalize_tags);
+  for ($i=0; $i<=scalar(@horz); $i++) {
+    $bot = ($i>$#horz) ? $image->height : $image->get_guide_position($horz[$i]);
+    html_table_row_start(\*FILE, $capitalize_tags);
+    $left=0;
+    for ($j=0; $j<=scalar(@vert); $j++) {
+      $right = ($j>$#vert) ? $image->width : $image->get_guide_position($vert[$j]);
+      # protect against 0 width/height guide selections
+      if ($left!=$right && $top!=$bot) {
+        # perform cropping, table entry
+        $imgname = dosel($image, $savepath, $imgpath, $imgbasename, $extension, $left, $right, $top, $bot, 
$i, $j);
+        html_table_entry(\*FILE, $imgname, $right-$left, $bot-$top, $capitalize_tags);
+      }
+      $left = $right + $cellspacing;
+      $progress += $progress_increment;
+      Gimp->progress_update ($progress);
     }
+    html_table_row_end(\*FILE, $capitalize_tags);
+    $top = $bot + $cellspacing;
+  }
+  html_table_end(\*FILE, $capitalize_tags);
+  return;
+};
+exit main;
+__END__
+
+=head1 NAME
+
+perlotine - Guillotine implemented in perl, with html output
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Web/Perl-o-tine...
 
-# <tigert> Save-path: [_____________________][browse]
-# <tigert> html-file name: [_________________]
-# <tigert> image-basename [__________________]
-# <tigert> [x] use separate dir for images
-# <tigert> image directory: [___________________]
-
-# later, decided to have UPPER/lower case HTML toggle
-# cellspacing: ___^
-
-register "perlotine",
- "Guilotine implemented ala perl, with html output",
- "Add guides to an image.  Then run this.  It will cut along the guides, and give you the html to reassemble 
the resulting images.",
- "Seth Burgess",
- "Seth Burgess <sjburges\ gimp org>",
- "1999-03-19",
- N_"<Image>/Filters/Web/Perl-o-tine...",
- "*",
- [
-  [PF_STRING, "save_path", "The path to export the HTML to",$ENV{HOME}],
-  [PF_STRING, "html_file_name", "Filename to export","perlotine.html"],
-  [PF_STRING, "image_basename", "What to call the images","perlotine"],
-  [PF_RADIO,  "image_extension", "The format of the images: (gif, jpg, png)", "gif", [gif => "gif", jpg => 
"jpg", png => "png"]],
-  [PF_TOGGLE, "separate_image_dir", "Use a separate directory for images?",0],
-  [PF_STRING, "relative_image_path", "The path to export the images to, relative to the Save Path", 
"images/"],
+=head1 DESCRIPTION
+
+Add guides to an image.  Then run this.  It will cut along the guides,
+and give you the html to reassemble the resulting images.
+
+=head1 PARAMETERS
+
+  [PF_STRING, "savepath", "The path to export the HTML to",$ENV{HOME}],
+  [PF_STRING, "htmlname", "Filename to export","perlotine.html"],
+  [PF_STRING, "imgbasename", "What to call the images","perlotine"],
+  [PF_RADIO,  "extension", "The format of the images: (gif, jpg, png)", "gif", [gif => "gif", jpg => "jpg", 
png => "png"]],
+  [PF_TOGGLE, "separate", "Use a separate directory for images?",0],
+  [PF_STRING, "imgpath", "The path to export the images to, relative to the Save Path", "images/"],
   [PF_TOGGLE, "capitalize_tags", "Capatalize HTML tags?", 0],
   [PF_SPINNER, "cellspacing", "Add space between the table elements", 0, [0,15,1]],
-  ], sub {
 
-    my($img,$layer,$savepath, $htmlname, $imgbasename, $extension, $separate, $imgpath, $capatalize, 
$cellspacing) = _;
+=head1 IMAGE TYPES
 
-    @vert = get_vguides($img);
-    @horz = get_hguides($img);
+*
 
-    if (!(scalar(@vert) || scalar(@horz))) {
-        die __"No horizontal or vertical guides found. Aborted.";
-        }
+=head1 HISTORY
 
-   #
-   # Progress Bar
-   #
+  <sjburges gimp org>
+  This is tigert's request.  I suppose it'll be useful to those that do
+  this sort of thing.  Personally I'll probably only run it to test and
+  put up a demo image.
 
-   Gimp->progress_init("Perl-o-Tine");
-   $progress_increment = 1/( (scalar(@horz)+1) * (scalar(@vert)+1) );
-   $progress = 0.0;
+  Since updated a couple times by others, and intgrated by me:
 
-   # (Debugging info for the guide functions)
+  Bruce Miller                              (fixed to accomdate 1.1.x changes)
+  Brendon and Wendy Humphrey <brendy swipnet se> (progress bar, nice comments)
 
-   # print @vert, " LEN = ", scalar(@vert), "\n";
-   # print @horz, " LEN = ", scalar(@horz), "\n";
-   # foreach $guide (@vert) {
-   #        print $img->get_guide_position($guide), "\n";
-   #        }
+  Tuomas Kuosmanen <tigert gimp org>
+  Fixed some things to make this work with cvs gimp. Fixed calls to
+  gimp_get_guide_orientation() (guide types that changed from
+  GUIDE_VERTICAL to VERTICAL and horizontal, respectively.  Should
+  work now). Also convert to indexed parameters changed, fixed them too.
 
-  #
-  # Correctly format paths and filenames
-  #
-  if (!($savepath=~ m,/$,)) {  # add a trailing slash if its not on there
-      $savepath = $savepath . "/";
-   }
-
-   if (!($imgpath=~ m,/$,)) {  # add a trailing slash if its not on there
-    $imgpath= $imgpath . "/";
-   }
-   if (!$separate) { $imgpath = ""; }
-
-    # create paths if they don't already exist
-    mkpath($savepath);
-    mkpath($savepath . $imgpath);
-
-    # open HTML file for writing
-    open FILE, ">$savepath$htmlname" or die "Couldn't open $savepath$htmlname: $!\n";
-
-    $top=0;
-    html_table_start(\*FILE,0,$cellspacing,0,$capatalize);
-    for ($i=0; $i<=scalar(@horz); $i++) {
-        $bot = ($i>$#horz) ? $img->height : $img->get_guide_position($horz[$i]);
-        html_table_row_start(\*FILE, $capatalize);
-        $left=0;
-        for ($j=0; $j<=scalar(@vert); $j++) {
-            $right = ($j>$#vert) ? $img->width : $img->get_guide_position($vert[$j]);
-           # protect against 0 width/height guide selections
-           if ($left!=$right && $top!=$bot)
-             {
-               # perform cropping, table entry
-               $imgname = dosel($img, $savepath, $imgpath, $imgbasename, $extension, $left, $right, $top, 
$bot, $i, $j);
-                html_table_entry(\*FILE, $imgname, $right-$left, $bot-$top, $capatalize);
-             }
-            $left = $right + $cellspacing;
-
-            # Increment the progress bar
-            $progress += $progress_increment;
-            Gimp->progress_update ($progress);
-            }
-        html_table_row_end(\*FILE, $capatalize);
-        $top = $bot + $cellspacing;
-        }
-    html_table_end(\*FILE, $capatalize);
-    return();
-};
-exit main;
+  <sjburges gimp org>
+  Added changes to make progess bar work for images with only horizontal
+  or vertical guides.  This was fixed at one time, I forget who did that.
+  Somehow it got broke again ;(
+
+  Added File::Path; for making the directory if it doesn't already exist.
+
+  12/13/03: fixed tigert's fix to use ORIENTATION_VERTICAL rather
+           than VERTICAL
+
+  If you have more additions, etc please don't hesitate to send them in!
+
+=head1 AUTHOR
+
+Seth Burgess <sjburges gimp org>
+
+=head1 DATE
+
+1999-03-19
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/pixelmap b/examples/pixelmap
index 0d7f2f2..2a54c9e 100755
--- a/examples/pixelmap
+++ b/examples/pixelmap
@@ -7,7 +7,8 @@ use PDL;
 
 use constant PI => 4 * atan2 1,1;
 
-sub pixelmap {                                 # es folgt das eigentliche Skript...
+# es folgt das eigentliche Skript...
+sub pixelmap {
    my($image,$drawable,$_expr)= _;
 
    Gimp->progress_init ("Mapping pixels...");
@@ -52,23 +53,17 @@ sub pixelmap {                                      # es folgt das eigentliche Skript...
 
 register "pixelmap",
         "Maps Pixel values and coordinates through general Perl expressions",
-        undef,
-        "Marc Lehmann",
-        "Marc Lehmann <pcg\ goof com>",
-        "19991115",
+        '', '', '', '',
         N_"<Image>/Filters/Generic/Pixelmap...",
         "*",
         [
-          [PF_TEXT,            "expression"    , "The perl expression to use", 
'($x*$y*0.01)'."\n".'->slice("*$bpp")']
+          [PF_TEXT, "expression", "The perl expression to use", '($x*$y*0.01)'."\n".'->slice("*$bpp")']
         ],
         \&pixelmap;
 
 register "pixelgen",
         "Generate the pixels of an image by expressions (in PDL)",
-        undef,
-        "Marc Lehmann",
-        "Marc Lehmann <pcg\ goof com>",
-        "19991115",
+        '', '', '', '',
         N_"<Image>/File/Create/Logos/Pixelgenerator...",
         undef,
         [
@@ -97,6 +92,16 @@ register "pixelgen",
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+pixelgen/pixelmap - Generate the pixels of an image by expressions (in PDL)
+
+=head1 SYNOPSIS
+
+<Image>/File/Create/Logos/Pixelgenerator...
+<Image>/Filters/Generic/Pixelmap...
 
 =head1 DESCRIPTION
 
@@ -134,9 +139,14 @@ The bytes per pixel value of the destination area.
 
 =back
 
+=head1 AUTHOR
+
+Marc Lehmann <pcg goof com>
+
+=head1 DATE
+
+19991115
+
 =head1 LICENSE
 
-Copyright Marc Lehman.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/prep4gif b/examples/prep4gif
index 55f83b7..e01cf6c 100755
--- a/examples/prep4gif
+++ b/examples/prep4gif
@@ -3,119 +3,103 @@
 use Gimp qw(:auto N_ __);
 use Gimp::Fu;
 
-# This script requires a Gimp version >= 0.96 (I haven't checked - ymmv)
-# small changes by Marc Lehmann <pcg goof com>
-
-# prep4gif.pl
-# by Seth Burgess <sjburges gimp org>
-# June 29, 1998
-#
-# This perl plug-in prepares a multilayer RGB image for use as a
-# transparent gif.  To use this prpoerly, you want to have something
-# close to the intended background as the bottom layer.  If convert
-# to indexed is not selected, the bottom two options are unused.
-#
-# TODO: Write a nicer GUI than Gimp::Fu provides (learn some gtk)
-#       Anything else that seems useful
-#
-# 12/5/03: <sjburges gimp org>
-#  s/gimp_convert/gimp_image_convert
-#
-# 2/25/04: <sjburges gimp org>
-#  s/gimp_layer_set_visible/gimp_drawable_set_visible/
-#
 # Gimp::set_trace(TRACE_ALL);
 
-sub prep {
-       my ($img, $drawable, $threshold, $growth, $index, $dither, $colors) = @_;
+podregister {
+  my $out = $image->duplicate; # only work on duplicate
+  my @layers = gimp_image_get_layers($out);
+  die __"You need at least 2 layers to perform prep4gif\n" if @layers < 2;
 
-# Duplicate this image, and work on the duplicate for the rest of the
-# procedure.
-       my $out = $img->duplicate;
+# Show the image early - this makes debugging a breeze
+  my $newdisplay = Gimp::Display->new($out);
+# Hide the bottom layer, so it doesn't get into the merge visible later.
+  my $bottomlayer = $layers[$#layers];
+  gimp_item_set_visible($bottomlayer, 0);
+  gimp_layer_add_alpha($bottomlayer);
+  my $foreground;
+  if ($#layers > 1) {
+    $foreground = gimp_image_merge_visible_layers($out, 0);
+  } else {
+    $foreground = $layers[0];
+  }
+
+  my $layer_mask = gimp_layer_create_mask($foreground,2);
+  gimp_layer_add_mask ($foreground, $layer_mask);
+  gimp_threshold($layer_mask,$threshold,255);
 
-# @layers is the ordered list, from top to bottom, of all layers in the
-# duplicated image.  To find length of the list, use $#layers
-       my @layers = gimp_image_get_layers($out);
+# Transfer layer mask to selection, and grow the selection
+  gimp_image_select_item($out, CHANNEL_OP_REPLACE, $foreground);
+  gimp_selection_grow($out,$growth);
 
-# if there's not enough layers, abort.
-       if ($#layers <= 0) {
-               gimp_message(__"You need at least 2 layers to perform prep4gif");
-               return;
-               }
+# Apply this selection to the background
+  gimp_item_set_visible($bottomlayer, 1);
+  gimp_image_set_active_layer($out, $bottomlayer);
+  gimp_selection_invert($out);
+  gimp_edit_cut($bottomlayer);
 
-# Show the image early - this makes debugging a breeze
-       my $newdisplay = Gimp::Display->new($out);
+# Clean up after yourself
+  gimp_layer_remove_mask($foreground, 1);
+  my $outlayer = gimp_image_merge_visible_layers($out,0);
 
-# Hide the bottom layer, so it doesn't get into the merge visible later.
+# Convert to indexed
+  gimp_image_convert_indexed($out,1, MAKE_PALETTE, $colors, $dither, 1, "")
+    if $index;
+  ();
+};
 
-       my $bottomlayer = $layers[$#layers];
-       gimp_item_set_visible($bottomlayer, 0);
-       gimp_layer_add_alpha($bottomlayer);
+exit main;
+__END__
 
-# NOTE TO PERL NEWBIES - 'my' variables should be declared in their outermost
-# scope - if defined inside the if statement, will disappear to program.
+=head1 NAME
 
-       my $foreground;
+prep4gif - Prep for gif
 
-       if ($#layers > 1) {
-               $foreground = gimp_image_merge_visible_layers($out, 0);
-       }
-       else {
-               $foreground = $layers[0];
-       };
+=head1 SYNOPSIS
 
-       my $layer_mask = gimp_layer_create_mask($foreground,2);
-       gimp_layer_add_mask ($foreground, $layer_mask);
-       gimp_threshold($layer_mask,$threshold,255);
+<Image>/Filters/Web/Prepare for GIF...
 
-# Transfer layer mask to selection, and grow the selection
-       gimp_image_select_item($out, CHANNEL_OP_REPLACE, $foreground);
-       gimp_selection_grow($out,$growth);
+=head1 DESCRIPTION
 
-# Apply this selection to the background
-       gimp_item_set_visible($bottomlayer, 1);
-       gimp_image_set_active_layer($out, $bottomlayer);
-       gimp_selection_invert($out);
-       gimp_edit_cut($bottomlayer);
+Make the image a small-cut-out of the intended background, so your
+transparent text doesn't look blocky.
 
-# Clean up after yourself
-       gimp_layer_remove_mask($foreground, 1);
-       my $outlayer = gimp_image_merge_visible_layers($out,0);
+=head1 PARAMETERS
 
-# Convert to indexed
-       if ($index) {
-               gimp_image_convert_indexed($out,1, MAKE_PALETTE, $colors, $dither, 1, "");
-               }
-
-# Show all the changes.
-       Gimp->displays_flush();
-
-       ();
-       }
-
-register
-       "prep4gif",
-       "Prep for gif",
-       "Make the image a small-cut-out of the intended background, so your transparent text doesn't look 
blocky.",
-       "Seth Burgess",
-       "Seth Burgess <sjburges\ gimp org>",
-       "2-15-98",
-       N_"<Image>/Filters/Web/Prepare for GIF...",
-       "RGB*",
-       [
-        [PF_INT32, "lower_threshold", "Lower Alpha Threshold", 64],
-        [PF_INT32, "growth", "How Much growth for safety ",1],
-        [PF_TOGGLE, "convert_to_indexed", "Convert Image to indexed", 0],
-        [PF_TOGGLE, "dither", "Floyd-Steinberg Dithering?", 1],
-        [PF_INT32, "colors", "Colors to quantize to", "255"],
-       ],
-       \&prep;
+ [PF_INT32, "threshold", "Lower Alpha Threshold", 64],
+ [PF_INT32, "growth", "How Much growth for safety ",1],
+ [PF_TOGGLE, "index", "Convert Image to indexed", 0],
+ [PF_TOGGLE, "dither", "Floyd-Steinberg Dithering?", 1],
+ [PF_INT32, "colors", "Colors to quantize to", "255"],
 
-exit main;
+=head1 IMAGE TYPES
+
+RGB*
+
+=head1 HISTORY
+
+ prep4gif.pl
+ by Seth Burgess <sjburges gimp org>
+ June 29, 1998
+
+ This perl plug-in prepares a multilayer RGB image for use as a
+ transparent gif.  To use this prpoerly, you want to have something
+ close to the intended background as the bottom layer.  If convert
+ to indexed is not selected, the bottom two options are unused.
+
+ 12/5/03: <sjburges gimp org>
+  s/gimp_convert/gimp_image_convert
+
+ 2/25/04: <sjburges gimp org>
+  s/gimp_layer_set_visible/gimp_drawable_set_visible/
+
+=head1 AUTHOR
+
+Seth Burgess <sjburges gimp org>
+
+=head1 DATE
+
+2-15-98
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/randomart1 b/examples/randomart1
index 3621ce9..719c712 100755
--- a/examples/randomart1
+++ b/examples/randomart1
@@ -1,49 +1,22 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
-# <sjburges gimp org> 12/13/03: adjusted number of blend arguments to
-#                               be 1.3.23 compatible
-#                               Removed channel_ops_ from channel_ops_offset    #                            
   Adjusted colors to be 1.3.x compatible
-
 use Gimp;
 use Gimp::Fu;
 
 # Definiere die Konstante "pi mal zwei"
 use constant PIx2 => 8 * atan2 1,1;
 
-register "random_art_1",                       # Funktionsname
-        "Create a Random Tile",                # Kurzhilfe
-        "Create a tileable image by repeatedly drawing colourful polygons",
-                                               # Hilfetext
-        "Marc Lehmann",                        # Autor
-        "Marc Lehmann <pcg\ goof com",         # Copyright
-        "0.4",                                 # Version/Datum
-        N_"<Image>/File/Create/Logos/Random Art #1...",        # Men�pfad
-        "",                                    # Bildtypen
-        # Eingabeparameter
-        # Typ          Name            Beschreibung            Wert
-        [
-         [PF_INT32,    'width',        'Image Width',          300],
-         [PF_INT32,    'height',       'Image Height',         300],
-         [PF_SLIDER,   'num_poly',     'Number of Polygons',   20, [5,100,1]],
-         [PF_SLIDER,   'edges',        'Number of Edges',      10, [3, 30, 1]],
-         [PF_SLIDER,   'revolutions',  'Number of Revolutions',1, [1, 3, 1]],
-         [PF_SLIDER,   'feather',      'Feather Radius',       30, [1, 100]],
-         [PF_BOOL,     'supersample',  'Adaptive Supersampling?', 0],
-        ],
-        sub {                                  # Perl-Code
+podregister {
    # Die Parameter werden ganz "normal" �bergeben:
-   my ($w,$h,$num_poly,$edges,$revolutions,$feather,$super)= _;
+   my ($width,$height,$num_poly,$edges,$revolutions,$feather,$super)= _;
    Gimp::Context->push();
 
    # Erzeuge ein neues Bild
-   my $image = new Gimp::Image($w,$h,RGB);
+   my $image = new Gimp::Image($width,$height,RGB);
    $image->undo_disable;
 
    # Erzeuge die erste Ebene f�r das Bild
-   my $layer = $image->layer_new($w,$h,RGB_IMAGE,
+   my $layer = $image->layer_new($width,$height,RGB_IMAGE,
                   "Random Art #1",100,NORMAL_MODE);
 
    # F�ge sie in das Bild ein
@@ -65,8 +38,8 @@ register "random_art_1",                      # Funktionsname
       my @ecken;
       for (1..$edges*$revolutions) {
         my $r = rand(0.4)+0.1;
-        push(@ecken, $w/2+sin($_*PIx2/$edges)*$r*$w,
-                     $h/2+cos($_*PIx2/$edges)*$r*$h);
+        push(@ecken, $width/2+sin($_*PIx2/$edges)*$r*$width,
+                     $height/2+cos($_*PIx2/$edges)*$r*$height);
       }
 
       # Selektiere die Region
@@ -89,13 +62,13 @@ register "random_art_1",                    # Funktionsname
                     2,
                     3,
                     0,                       # no dithering
-                    $w/2,                    # x1
-                    $h/2,                    # y1
-                    rand($w),                # x2
-                    rand($h));               # y2
+                    $width/2,                    # x1
+                    $height/2,                    # y1
+                    rand($width),                # x2
+                    rand($height));               # y2
 
       # Und dann verschiebe das Bild etwas
-      $layer->offset (1,0,(rand(0.8)+0.1)*$w,(rand(0.8)+0.1)*$h);
+      $layer->offset (1,0,(rand(0.8)+0.1)*$width,(rand(0.8)+0.1)*$height);
    }
 
    Gimp::Context->pop();
@@ -109,10 +82,38 @@ register "random_art_1",                   # Funktionsname
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+random_art_1 - Create a Random Tile
+
+=head1 SYNOPSIS
+
+<Image>/File/Create/Logos/Random Art #1...
+
+=head1 DESCRIPTION
+
+Create a tileable image by repeatedly drawing colourful polygons
+
+=head1 PARAMETERS
+
+  [PF_INT32,   'width',        'Image Width',          300],
+  [PF_INT32,   'height',       'Image Height',         300],
+  [PF_SLIDER,  'num_poly',     'Number of Polygons',   20, [5,100,1]],
+  [PF_SLIDER,  'edges',        'Number of Edges',      10, [3, 30, 1]],
+  [PF_SLIDER,  'revolutions',  'Number of Revolutions',1, [1, 3, 1]],
+  [PF_SLIDER,  'feather',      'Feather Radius',       30, [1, 100]],
+  [PF_BOOL,    'super',        'Adaptive Supersampling?', 0],
+
+=head1 AUTHOR
+
+Marc Lehmann <pcg goof com>
+
+=head1 DATE
+
+0.4
 
 =head1 LICENSE
 
-Copyright Marc Lehman.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/randomblends b/examples/randomblends
index 887430c..4f76b40 100755
--- a/examples/randomblends
+++ b/examples/randomblends
@@ -1,9 +1,5 @@
 #!/usr/bin/perl
 
-# <sjburges gimp org>
-# This is adrian's idea - take random blends and difference them.  You're
-# bound to come up w/ something cool eventually.
-
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 use Gimp::Util;
@@ -13,34 +9,19 @@ use Gimp::Util;
 sub randint {
     my ($int) = @_;
     return int(rand()*$int +0.5);
-    }
+}
 
-register "random_blends",
-         "Random Blends - Perform N random blends",
-         "A random approach to art, using the blend tool with DIFFERENCE_MODE.  Alpha is not affected; best 
used on opaque background.  Just try it. It might be good.",
-         "Seth Burgess",
-         "Seth Burgess <sjburges\ gimp org>",
-         "1999-03-18",
-         N_"<Image>/Filters/Render/Random Blends...",
-         "RGB*, GRAY*",
-         [
-           [PF_SPINNER, "number", "How many gradients to apply", 7, [1,255,1]],
-            ],
-         [],
-         sub {
-    my($img,$layer,$numgradients) = _;
-    eval { $img->undo_group_start };
+podregister {
+    eval { $image->undo_group_start };
     Gimp::Context->push();
     my $sel;
-    ($sel,$x1,$y1,$x2,$y2) = $img->gimp_selection_bounds;
+    ($sel,$x1,$y1,$x2,$y2) = $image->gimp_selection_bounds;
     srand();
-
     @gradientlist = gimp_gradients_get_list("");
-
     Gimp->progress_init("Random blends...");
     for ($i=0; $i<$numgradients; $i++) {
         Gimp::Context->set_gradient(@gradientlist[randint($#gradientlist)]);
-       $layer->edit_blend(CUSTOM_MODE,
+       $drawable->edit_blend(CUSTOM_MODE,
                        DIFFERENCE_MODE,
                        randint(10),      # gradient type
                        randint(100),     # opacity
@@ -57,16 +38,48 @@ register "random_blends",
                        randint($y2-$y1)+$y1, # y2
                        );
         Gimp->progress_update($i/(1.0*$numgradients));
-        }
-    eval { $img->undo_group_end };
+    }
+    eval { $image->undo_group_end };
     Gimp::Context->pop();
     return();
 };
 exit main;
+__END__
+
+=head1 NAME
+
+random_blends - Random Blends - Perform N random blends
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Render/Random Blends...
+
+=head1 DESCRIPTION
+
+A random approach to art, using the blend tool with DIFFERENCE_MODE.  Alpha is not affected; best used on 
opaque background.  Just try it. It might be good.
+
+=head1 PARAMETERS
+
+ [PF_SPINNER, "numgradients", "How many gradients to apply", 7, [1,255,1]],
+
+=head1 IMAGE TYPES
+
+RGB*, GRAY*
+
+=head1 HISTORY
+
+ <sjburges gimp org>
+ This is adrian's idea - take random blends and difference them.  You're
+ bound to come up w/ something cool eventually.
+
+=head1 AUTHOR
+
+Seth Burgess <sjburges gimp org>
+
+=head1 DATE
+
+1999-03-18
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/redeye b/examples/redeye
index b9ce98f..6094769 100755
--- a/examples/redeye
+++ b/examples/redeye
@@ -4,100 +4,90 @@ use Gimp;
 use Gimp::Fu;
 use PDL::LiteF;
 
-sub static_redeye
-    {
-    my($image, $drawable) = @_;
-    dynamic_redeye($image, $drawable, 0);
+sub static_redeye {
+  my($image, $drawable) = @_;
+  dynamic_redeye($image, $drawable, 0);
+}
+
+sub dynamic_redeye {
+  my($image, $drawable, $threshold) = @_;
+
+  # Stuff we might need in the future.
+  # $image->undo_group_start;
+  # $image->undo_group_end;
+  Gimp->progress_init("Clearing red-eye", -1);
+
+  my $a = pdl [1..10];
+
+  my @bounds = $drawable->bounds;
+
+  my $src = new Gimp::PixelRgn($drawable, @bounds, 0, 0);
+  my $dst = new Gimp::PixelRgn($drawable, @bounds, 1, 1);
+
+  my $iter = Gimp->pixel_rgns_register($src, $dst);
+  my $area = $bounds[2] * $bounds[3];
+  my $progress = 0;
+
+  do {
+    my $data = $src->data;
+    my($depth, $w, $h) = $data->dims;
+    # There's gotta be a better way...
+    my($x, $y);
+    my($r, $g, $b);
+    my($rbrite, $gbrite, $bbrite);
+    for ($y = 0;  $y < $h;  $y++) {
+       for ($x = 0;  $x < $w;  $x++) {
+         $r = $data->at(0, $x, $y);
+         $g = $data->at(1, $x, $y);
+         $b = $data->at(2, $x, $y);
+         # Useful constants:
+         #   Contribution of colors to perceived brightness:
+         #     Red   0.30078125
+         #     Green 0.58593750
+         #     Blue  0.11328125
+         #     (Sums to 1)
+         #     Red    77
+         #     Green 150
+         #     Blue   29
+         #     (Sums to 256)
+         #   Brightnesses relative to green:
+         #     Red   0.51333333
+         #     Green 1.00000000
+         #     Blue  0.19333333
+         #$rbrite = 77 * $r / 256;
+         #$gbrite = 150 * $g / 256;
+         #$bbrite = 29 * $b / 256;
+         $rbrite = $r * 0.5133333;
+         $gbrite = $g;
+         $bbrite = $b * 0.1933333;
+         if ($rbrite >= $gbrite - $threshold
+           &&  $rbrite >= $bbrite - $threshold) {
+           $rbrite = ($gbrite + $bbrite) / 2;
+           $r = int($rbrite / 0.51333333);
+           $data->set(0, $x, $y, $r);
+         }
+       }
     }
+    $dst->data($data);
 
-sub dynamic_redeye
-    {
-    my($image, $drawable, $threshold) = @_;
-
-    # Stuff we might need in the future.
-    # $image->undo_group_start;
-    # $image->undo_group_end;
-    Gimp->progress_init("Clearing red-eye", -1);
-
-    my $a = pdl [1..10];
-
-    my @bounds = $drawable->bounds;
-
-    my $src = new Gimp::PixelRgn($drawable, @bounds, 0, 0);
-    my $dst = new Gimp::PixelRgn($drawable, @bounds, 1, 1);
-
-    my $iter = Gimp->pixel_rgns_register($src, $dst);
-    my $area = $bounds[2] * $bounds[3];
-    my $progress = 0;
-
-    do
-       {
-       my $data = $src->data;
-       my($depth, $w, $h) = $data->dims;
-       # There's gotta be a better way...
-       my($x, $y);
-       my($r, $g, $b);
-       my($rbrite, $gbrite, $bbrite);
-       for ($y = 0;  $y < $h;  $y++)
-           {
-           for ($x = 0;  $x < $w;  $x++)
-               {
-               $r = $data->at(0, $x, $y);
-               $g = $data->at(1, $x, $y);
-               $b = $data->at(2, $x, $y);
-               # Useful constants:
-               #   Contribution of colors to perceived brightness:
-               #       Red   0.30078125
-               #       Green 0.58593750
-               #       Blue  0.11328125
-               #       (Sums to 1)
-               #       Red    77
-               #       Green 150
-               #       Blue   29
-               #       (Sums to 256)
-               #   Brightnesses relative to green:
-               #       Red   0.51333333
-               #       Green 1.00000000
-               #       Blue  0.19333333
-               #$rbrite = 77 * $r / 256;
-               #$gbrite = 150 * $g / 256;
-               #$bbrite = 29 * $b / 256;
-               $rbrite = $r * 0.5133333;
-               $gbrite = $g;
-               $bbrite = $b * 0.1933333;
-               if ($rbrite >= $gbrite - $threshold
-                 &&  $rbrite >= $bbrite - $threshold)
-                   {
-                   $rbrite = ($gbrite + $bbrite) / 2;
-                   $r = int($rbrite / 0.51333333);
-                   $data->set(0, $x, $y, $r);
-                   }
-               }
-           }
-       $dst->data($data);
-
-       $progress += ($src->w * $src->h) / $area;
-       #Gimp->progress_update($progress);
-       }
-       while (Gimp->pixel_rgns_process($iter));
+    $progress += ($src->w * $src->h) / $area;
+    #Gimp->progress_update($progress);
+  } while (Gimp->pixel_rgns_process($iter));
 
-    #Gimp->progress_update (1);
+  #Gimp->progress_update (1);
 
-    $drawable->merge_shadow (1);
-    $drawable->update (@bounds);
+  $drawable->merge_shadow (1);
+  $drawable->update (@bounds);
 
-    ();                                # We didn't create a new image
-    }
+  ();                          # We didn't create a new image
+}
 
 register
     "auto_red_eye",            # fill in name
     "Remove red-eye from selection", # a small description
-    '',                                # a help text (see below)
-    "Geoff Kuenning",
-    "Copyright 2003, Geoff Kuenning",
-    "2003-04-06",              # Last-mod date
+    '', '', '', '',
     "<Image>/Filters/Colors/Auto/Auto Red-Eye",        # menu path
-    "RGB*",                    # Image types
+    '',
     [
     ],
     \&static_redeye;
@@ -105,41 +95,57 @@ register
 register
     "red_eye",                 # fill in name
     "Remove red-eye from selection", # a small description
-    '',                                # a help text (see below)
-    "Geoff Kuenning",
-    "Copyright 2003, Geoff Kuenning",
-    "2003-04-06",              # Last-mod date
+    '', '', '', '',
     "<Image>/Filters/Colors/Red-Eye",  # menu path
-    "RGB*",                    # Image types
+    '',
     [
      [PF_SLIDER, "sensitivity", "Sensitivity of detection", 0, [-255, 255, 1]],
     ],
     \&dynamic_redeye;
 
 exit main();
-
 __END__
 
-=pod
+=head1 NAME
+
+red_eye - Remove red-eye from selection
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Colors/Red-Eye
 
 =head1 DESCRIPTION
 
-Searches the selection for pixels in which the red component
-dominates, and removes the red from those components.  The sensitivity
-slider selects the sensitivity of the red detection.  A value of +255
-will cause all pixels to be detected as red, while -255 will prevent
-red-eye detection.  The default of 0 is usually the best choice.
+Searches the selection for pixels in which the red component dominates,
+and removes the red from those components. The sensitivity slider
+selects the sensitivity of the red detection. A value of +255 will cause
+all pixels to be detected as red, while -255 will prevent red-eye
+detection. The default of 0 is usually the best choice.
 
 To speed red-eye correction, the "Auto Red-Eye" menu item will
 automatically choose the default sensitivity of zero.
 
-To use, select the red eyes in the image.  It is OK to include bits of
+To use, select the red eyes in the image. It is OK to include bits of
 the iris, highlights in the pupil, and even skin; these will not be
-affected.  If you don't like the results, undo and try again with a
+affected. If you don't like the results, undo and try again with a
 different sensitivity.
 
-=head2 LICENSE
+=head1 PARAMETERS
+
+=head1 IMAGE TYPES
+
+RGB*
+
+=head1 AUTHOR
+
+Geoff Kuenning
+
+=head1 DATE
+
+2003-04-06
+
+=head1 LICENSE
 
-Copyright Geoff Kuenning
+Copyright 2003, Geoff Kuenning
 
 Distributed under the Gnu Public License v2 or higher.
diff --git a/examples/repdup b/examples/repdup
index 418946c..059843d 100755
--- a/examples/repdup
+++ b/examples/repdup
@@ -1,54 +1,61 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 
 #Gimp::set_trace(TRACE_ALL);
 
-register       "repdup",
-               "Repeats and duplicates a selection.",
-               "Hopefully self-explanatory...",
-               "Claes G Lindblad <claesg\ algonet se>",
-               "Claes G Lindblad <claesg\ algonet se>",
-               "990328",
-               N_"<Image>/Edit/Repeat & Duplicate...",
-               "*",
-               [
-               [PF_SPINNER, "repeats", "Number of repeats",
-                       3, [1, 1000, 1] ],
-               [PF_SPINNER, "xoffset", "X-offset",
-                       50, [-1000, 1000, 1] ],
-               [PF_SPINNER, "yoffset", "Y-offset",
-                       50, [-1000, 1000, 1] ],
-               ],
-       sub {
-               my ($img, $layer, $repeats, $xoffset, $yoffset) = @_;
-
-               eval { $img->undo_group_start };
-               @b  = gimp_selection_bounds($img);
-               my $w = $b[3] - $b[1];
-               my $h = $b[4] - $b[2];
-               gimp_edit_copy($layer);
-               gimp_selection_none($img);
-               for ($i = 0; $i < $repeats; $i++) {
-                       $b[1] = $b[1] + $xoffset;
-                       $b[2] = $b[2] + $yoffset;
-                       $img->select_rectangle(CHANNEL_OP_REPLACE, $b[1], $b[2], $w, $h);
-                       $bit_bucket = gimp_edit_paste($layer, 0);
-                       gimp_floating_sel_anchor($bit_bucket);
-                       gimp_selection_none($img);
-               }
-               eval { $img->undo_group_end };
-               return;
-       };
+podregister {
+  $image->undo_group_start;
+  my @b = gimp_selection_bounds($image);
+  my $w = $b[3] - $b[1];
+  my $h = $b[4] - $b[2];
+  gimp_edit_copy($drawable);
+  gimp_selection_none($image);
+  for ($i = 0; $i < $repeats; $i++) {
+    $b[1] = $b[1] + $xoffset;
+    $b[2] = $b[2] + $yoffset;
+    $image->select_rectangle(CHANNEL_OP_REPLACE, @b[1,2], $w, $h);
+    $bit_bucket = gimp_edit_paste($drawable, 0);
+    gimp_floating_sel_anchor($bit_bucket);
+    gimp_selection_none($image);
+  }
+  $image->undo_group_end;
+  return;
+};
 exit main;
+__END__
+
+=head1 NAME
+
+repdup - Repeats and duplicates a selection.
+
+=head1 SYNOPSIS
+
+<Image>/Edit/Repeat & Duplicate...
+
+=head1 DESCRIPTION
+
+Hopefully self-explanatory...
+
+=head1 PARAMETERS
+
+  [PF_SPINNER, "repeats", "Number of repeats", 3, [1, 1000, 1] ],
+  [PF_SPINNER, "xoffset", "X-offset", 50, [-1000, 1000, 1] ],
+  [PF_SPINNER, "yoffset", "Y-offset", 50, [-1000, 1000, 1] ],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Claes G Lindblad <claesg algonet se>
+
+=head1 DATE
+
+990328
 
 =head1 LICENSE
 
-Copyright Claes G. Lindblad.
 Distributed under the terms of the GNU Public License, v2 or higher.
-
-=cut
diff --git a/examples/roundsel b/examples/roundsel
index 278a0a8..b52e29f 100755
--- a/examples/roundsel
+++ b/examples/roundsel
@@ -8,33 +8,51 @@ use Gimp::Util;
 
 # Gimp::set_trace(TRACE_ALL);
 
-register "round_sel",
-         "Rounds a selection.",
-         "Rounds a selection.",
-         "Uri Zarfaty",
-         "Uri Zarfaty <udz20\ cam ac uk>",
-         "1999-03-25",
-         N_"<Image>/Select/Round...",
-         "*",
-         [
-           [PF_SPINNER, "roundness", "How much to round, in pixels", 16, [1,1000,1]],
-         ], sub {
-    my($img,$drawable,$round) = @_;
-
-    eval { $img->undo_group_start };
-
-    my $channel = gimp_selection_save($img);
-    gimp_selection_none($img);
-    plug_in_gauss_iir($img, $channel, $round, 1, 1);
-    gimp_levels($channel, 0, 123, 133, 1.0, 0, 255);
-    gimp_selection_load($channel);
-    gimp_image_remove_channel($img, $channel);
-    # gimp_item_delete($channel);
-
-    eval { $img->undo_group_end };
-
-    ();
+podregister {
+  my($image,$drawable,$round) = @_;
+  $image->undo_group_start;
+  my $channel = gimp_selection_save($image);
+  gimp_selection_none($image);
+  plug_in_gauss_iir($image, $channel, $round, 1, 1);
+  gimp_levels($channel, 0, 123, 133, 1.0, 0, 255);
+  gimp_selection_load($channel);
+  gimp_image_remove_channel($image, $channel);
+  # gimp_item_delete($channel);
+  $image->undo_group_end;
+  ();
 };
 
 exit main;
+__END__
 
+=head1 NAME
+
+round_sel - Rounds a selection.
+
+=head1 SYNOPSIS
+
+<Image>/Select/Round...
+
+=head1 DESCRIPTION
+
+Rounds a selection.
+
+=head1 PARAMETERS
+
+ [PF_SPINNER, "round", "How much to round, in pixels", 16, [1,1000,1]],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Uri Zarfaty <udz20 cam ac uk>
+
+=head1 DATE
+
+1999-03-25
+
+=head1 LICENSE
+
+Copyright.
diff --git a/examples/scratches b/examples/scratches
index 6677cb4..0de674e 100755
--- a/examples/scratches
+++ b/examples/scratches
@@ -18,52 +18,58 @@ sub new_scratchlayer {
     $layer->noisify (0, 1, 1, 1, 0);
     $layer->mblur (0, $length, $angle, 0, 0);
     $layer->levels (HISTOGRAM_VALUE, 120, 255, 0.3, 0, 255);
-
     $layer;
 }
 
-register "scratches",
-         "Create a scratch effect",
-         "Add scratches to an existing image. Works best on a metallic-like background.",
-         "Marc Lehmann",
-         "Marc Lehmann <pcg\ goof com>",
-         "19990223",
-         N_"<Image>/Filters/Distorts/Scratches...",
-         "*",
-         [
-          [PF_SLIDER   , "angle_x"     , "The horizontal angle"        ,  30, [  0, 360]],
-          [PF_SLIDER   , "angle_y"     , "The vertical angle"          ,  70, [  0, 360]],
-          [PF_SLIDER   , "gamma"       , "Scratch map gamma"           , 0.3, [0.1,  10, 0.05]],
-          [PF_SPINNER  , "smoothness"  , "The scratch smoothness"      ,  15, [  0, 400]],
-          [PF_SPINNER  , "length"      , "The scratch length"          ,  10, [  0, 400]],
-         ],
-         sub {
-   my ($image,$drawable,$anglex,$angley,$gamma,$length,$width) = @_;
-
-   $image->undo_group_start;
-
-   # Erzeuge zwei "scratchlayer", die die Verschiebung in X und Y
-   # angeben.
-   my $layer1 = new_scratchlayer ($image, $drawable, $length, $gamma, $anglex);
-   my $layer2 = new_scratchlayer ($image, $drawable, $length, $gamma, $angley);
-
-   # Verschmiere das Bild.
-   $drawable->displace ($width, $width, 1, 1, $layer1, $layer2, 1);
-
-   # die beiden Ebenen werden nicht länger benötigt.
-   $layer1->remove_layer;
-   $layer2->remove_layer;
-
-   $image->undo_group_end;
-
-   ();
+podregister {
+  $image->undo_group_start;
+  # Erzeuge zwei "scratchlayer", die die Verschiebung in X und Y angeben.
+  my $layer1 = new_scratchlayer($image, $drawable, $smoothness, $gamma, $anglex);
+  my $layer2 = new_scratchlayer($image, $drawable, $smoothness, $gamma, $angley);
+  # Verschmiere das Bild.
+  $drawable->displace ($length, $length, 1, 1, $layer1, $layer2, 1);
+  # die beiden Ebenen werden nicht länger benötigt.
+  $layer1->remove_layer;
+  $layer2->remove_layer;
+  $image->undo_group_end;
+  ();
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+scratches - Create a scratch effect
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Distorts/Scratches...
+
+=head1 DESCRIPTION
+
+Add scratches to an existing image. Works best on a metallic-like background.
+
+=head1 PARAMETERS
+
+  [PF_SLIDER, "anglex", "The horizontal angle",  30, [ 0, 360]],
+  [PF_SLIDER, "angley", "The vertical angle",  70, [ 0, 360]],
+  [PF_SLIDER, "gamma", "Scratch map gamma", 0.3, [ 0.1, 10, 0.05]],
+  [PF_SPINNER, "smoothness", "The scratch smoothness", 15, [ 0, 400]],
+  [PF_SPINNER, "length", "The scratch length",  10, [ 0, 400]],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 AUTHOR
+
+Marc Lehmann <pcg goof com>
+
+=head1 DATE
+
+19990223
 
 =head1 LICENSE
 
-Copyright Marc Lehman.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/selective_sharpen b/examples/selective_sharpen
index c87a7b8..2228c00 100755
--- a/examples/selective_sharpen
+++ b/examples/selective_sharpen
@@ -1,28 +1,27 @@
 #!/usr/bin/perl
 
-use Gimp ":auto";
+use Gimp;
 use Gimp::Fu;
+use strict;
 
 # Gimp::set_trace(TRACE_ALL);
 
 podregister {
-    my ($img,$original_layer,$sharpen_radius,$sharpen_amt,$sharpen_threshold) = @_;
-
     # sanity stuff
-    die "Can only operate on layers" unless $original_layer->is_layer;
-    $original_layer->become('Gimp::Layer');
+    die "Can only operate on layers" unless $drawable->is_layer;
+    $drawable->become('Gimp::Layer');
 
-    $img->undo_group_start;
+    $image->undo_group_start;
 
-    my @selbounds = $img->selection_bounds;
-    $img->selection_all if $selbounds[0] == 0;
+    my @selbounds = $image->selection_bounds;
+    $image->selection_all if $selbounds[0] == 0;
 
-    my $saved_selection = $img->selection_save;
-    $img->selection_none;
+    my $saved_selection = $image->selection_save;
+    $image->selection_none;
 
     # 1) take the original photo, duplicate the layer
-    my $edge_layer = $original_layer->Gimp::Layer::copy(1);
-    $img->insert_layer($edge_layer,0,-1);
+    my $edge_layer = $drawable->Gimp::Layer::copy(1);
+    $image->insert_layer($edge_layer,0,-1);
 
     # 2) convert the copy to grayscale
     $edge_layer->desaturate;
@@ -42,26 +41,26 @@ podregister {
                              );
 
     # 6) then make the boosted, gray edge-detection into a selection mask
-    my $selchan = $img->channel_new($img->width, $img->height, "sharpen_mask",
+    my $selchan = $image->channel_new($image->width, $image->height, "sharpen_mask",
                      100.0, [1.0,0,0]);
 
-    $img->insert_channel($selchan, 0, -1);
+    $image->insert_channel($selchan, 0, -1);
     $edge_layer->edit_copy;
     $selchan->edit_paste(1);
-    $img->get_floating_sel->anchor;
+    $image->get_floating_sel->anchor;
     $selchan->combine_masks($saved_selection, CHANNEL_OP_INTERSECT, 0, 0);
     $selchan->selection_load;
 
     # 7) then use unsharp mask to that selection (scratch the gray layer)
-    $original_layer->unsharp_mask($sharpen_radius, $sharpen_amt, $sharpen_threshold);
+    $drawable->unsharp_mask($sharpen_radius, $sharpen_amt, $threshold);
 
     # cleanup
-    selection_load($saved_selection);
-    $img->remove_channel($saved_selection);
-    $img->remove_channel($selchan);
-    $img->remove_layer($edge_layer);
+    $saved_selection->selection_load;
+    $image->remove_channel($saved_selection);
+    $image->remove_channel($selchan);
+    $image->remove_layer($edge_layer);
 
-    $img->undo_group_end;
+    $image->undo_group_end;
     ();
 };
 
diff --git a/examples/sethspin b/examples/sethspin
index 3906b49..c00a430 100755
--- a/examples/sethspin
+++ b/examples/sethspin
@@ -1,215 +1,197 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
 use constant { PI => 3.14159 };
-
-# Note: Seth has transferred the maintainer `position' to me, so bother me
-# instead of him now :-)
-#       - Steinar H. Gunderson <sgunderson bigfoot com>
-
-# This one's all mine.  Well, its GPL/Artistic but I'm the author and creator.
-# You need gimp 1.1 or better for this; too much has changed, and I don't think
-# 1.0.x had a perspective PDB function anyway
-
-# Here's the working theory on this:
-#  There's a function called spinlayer which will spin from a spinlayer to a
-#  destlayer.  It won't touch those 2 layers at all, and will leave its results
-#  on the top of the layer stack.
-#
-#  If the user wants to spin back, it will take 1/2 the layers otherwise required
-#  per call to the spin_layer, so that the number of total layers comes out the
-#  same.
-#
-#  The main function makes a new image, copies the source and destination onto it
-#  with appropriate offsets, and passes this image with the bottom 2 layers to
-#  spin_layer.  At the end, remove the original 2 layers, since they won't be
-#  needed, and add in some Layer comments for timing your gif.
-#
-################################################################################
-#  Many thanks to Steinar and Marc, for expressing an intrest in the script that
-#  kept me going, and to Steinar in particular for helping me track down why the
-#  script was crashing gimp (hint - don't make layers of height=0, and if you do
-#  make sure you're logging to console since the Gtk messagebox will never show
-#  up due to a rapid segfault).
-#
-#  Just a comment on that: We fixed the bug, so height=0 no longer segfaults, but
-#  gives the error message it should. However, if GIMP segfaults, you should try
-#  logging to console to make sure you get all applicable error messages. This
-#  will make it _much_ easier to find the bug. - Steinar
-#
-# Revision History:
-# 1.0 - Initial (too early) release
-# 1.1 - Second (still ugly) release: Made the perspective setting actually do
-#       something
-# 1.2 - Used some of the convienence functions, and made things a little eaiser
-#       from the user's standpoint too.  Also moved it from the
-#       Filters->Animations-> menu to Xtns->Animations.  I think its
-#       clearer whats going on this way.  It also works w/ any 2 layers now.
-# 1.5 - Some debugging by Steinar and myself to make it work again.
-# 1.6 - Moved some renaming into the main loop, more cleanups.
-# 1.7 - Fixed up set_name to drawable_set_name
-#
-# TODO: Clean it up; allow for other effects (skewing, ripples?) while spinning;
-
-# Seth Burgess
-# <sjburges gimp org>
-
-use Gimp;  # No qw(:auto) - Trying to use all OO-styling
+use Gimp;
 use Gimp::Fu;
 use Gimp::Util;
 
 #Gimp::set_trace(TRACE_ALL);
 
 sub saw {  # a sawtooth function on PI
-    ($val) = @_;
-    if ($val < PI/2.0) {
-        return ($val/PI);
-    } elsif ($val < PI) {
-        return (-1+$val/PI);
-    } elsif ($val < PI*1.5) {
-        return ($val/PI);
-    } else {
-        return (-1+$val/PI);
-    }
+  ($val) = @_;
+  if ($val < PI/2.0) {
+    return ($val/PI);
+  } elsif ($val < PI) {
+    return (-1+$val/PI);
+  } elsif ($val < PI*1.5) {
+    return ($val/PI);
+  } else {
+    return (-1+$val/PI);
+  }
 }
 
 sub spin_layer { # the function for actually spinning the layer
-    my ($img, $spin, $dest, $numframes, $prp) = @_;
-
-    my ($floater,  # The transformed image
-       $framelay, # The background color
-       $frameno);  # The current frame
-
-    # Now let's spin it!
-    $stepsize = PI/$numframes; # in radians
-    $frameno = 0;
-    for ($i=0; $i<=PI; $i+=$stepsize) {
-        Gimp->progress_update ($i/PI);
-
-        # create a new layer for spinning
-        $framelay = ($i < PI/2.0) ? $spin->copy(1) : $dest->copy(1);
-        $img->insert_layer($framelay, 0, 0);
-        $floater = $framelay->copy(1);
-        $img->insert_layer($floater, 0, 0);
-
-        # spin it a step
-        $img->selection_all();
-        @x = $img->selection_bounds();
-        $img->selection_none();
-
-        # x[1],x[2]                  x[3],x[2]
-        # x[1],x[4]                  x[3],x[4]
-        my($y1, $y3);
-        $y1 = int($x[2]+$spin->height *sin($i)/2);
-        $y3 = int($x[4]-$spin->height *sin($i)/2);
-
-       # height must be != 0
-        $y3++ if ($y1 == $y3);
-
-       # the drawable version (deprecated) has different params
-        $floater = $floater->Gimp::Item::transform_perspective(
-                       $x[1]+saw($i)*$prp*$framelay->width,$y1,
-                       $x[3]-saw($i)*$prp*$framelay->width,$y1,
-                       $x[1]-saw($i)*$prp*$framelay->width,$y3,
-                       $x[3]+saw($i)*$prp*$framelay->width,$y3,
-                       );
-        $framelay->fill(1); # BG-IMAGE-FILL
-
-       # merge the two layers together before we continue
-        $img->set_visible($floater, $framelay);
-        $framelay = $img->merge_visible_layers(0);
-
-       $frameno++;
-       $framelay->set_name("Spin Layer $frameno (50ms)");
-    }
+  my ($img, $spin, $destination, $numframes, $prp) = @_;
+  my ($floater,  # The transformed image
+     $framelay, # The background color
+     $frameno);  # The current frame
+  # Now let's spin it!
+  $stepsize = PI/$numframes; # in radians
+  $frameno = 0;
+  for ($i=0; $i<=PI; $i+=$stepsize) {
+    Gimp->progress_update ($i/PI);
+    # create a new layer for spinning
+    $framelay = ($i < PI/2.0) ? $spin->copy(1) : $destination->copy(1);
+    $img->insert_layer($framelay, 0, 0);
+    $floater = $framelay->copy(1);
+    $img->insert_layer($floater, 0, 0);
+    # spin it a step
+    $img->selection_all();
+    @x = $img->selection_bounds();
+    $img->selection_none();
+    # x[1],x[2]                  x[3],x[2]
+    # x[1],x[4]                  x[3],x[4]
+    my($y1, $y3);
+    $y1 = int($x[2]+$spin->height *sin($i)/2);
+    $y3 = int($x[4]-$spin->height *sin($i)/2);
+    # height must be != 0
+    $y3++ if ($y1 == $y3);
+    # the drawable version (deprecated) has different params
+    $floater = $floater->Gimp::Item::transform_perspective(
+      $x[1]+saw($i)*$prp*$framelay->width,$y1,
+      $x[3]-saw($i)*$prp*$framelay->width,$y1,
+      $x[1]-saw($i)*$prp*$framelay->width,$y3,
+      $x[3]+saw($i)*$prp*$framelay->width,$y3,
+    );
+    $framelay->fill(1); # BG-IMAGE-FILL
+    # merge the two layers together before we continue
+    $img->set_visible($floater, $framelay);
+    $framelay = $img->merge_visible_layers(0);
+    $frameno++;
+    $framelay->set_name("Spin Layer $frameno (50ms)");
+  }
 }
 
-register "seth_spin",
-         "Seth Spin",
-         "Take one image.  Spin it about the horizontal axis, and end up with another image.  I made it for 
easy web buttons.",
-         "Seth Burgess",
-         "Seth Burgess <sjburges\ gimp org>",
-         "1.7",
-         N_"<Image>/Filters/Animation/Seth Spin...",
-         "*",
-         [
-          [PF_DRAWABLE, "destination","What drawable to spin to?"],
-          [PF_INT8, "frames", "How many frames to use?", 16],
-          [PF_COLOR, "background", "What color to use for background if not transparent", [0,0,0]],
-          [PF_SLIDER, "perspective", "How much perspective effect to get", 40, [0,255,5]],
-          [PF_TOGGLE, "spin_back", "Also spin back?" , 1],
-          [PF_TOGGLE, "convert_indexed", "Convert to indexed?", 1],
-         ],
-         [],
-         sub {
-    my($startimage,$src,$dest,$frames,$color,$perspective,$spinback,$indexed) = @_;
+podregister {
+  Gimp::Context->push;
+  Gimp::Context->set_background($color);
+  $perspective /= 255.0; # PF_SLIDER doesn't work right for < 1
+  Gimp->progress_init(__"Seth Spin...");
+  # Copy souce and destination to new image
+  $maxwide = ($drawable->width > $destination->width) ? $drawable->width : $destination->width;
+  $maxhigh = ($drawable->height > $destination->height) ? $drawable->height: $destination->height;
+  $img = Gimp->image_new($maxwide, $maxhigh, RGB);
+  $tmpimglayer = $img->add_new_layer(0,3,1); # have to have a layer before displaying
+  $img->display_new;
+  $drawable->edit_copy();
+  $spinlayer = $tmpimglayer->edit_paste(1);
+  $spinlayer->floating_sel_to_layer();
+  $destination->edit_copy();
+  $destlayer = $tmpimglayer->edit_paste(1);
+  $destlayer->floating_sel_to_layer();
+  $tmpimglayer->remove_layer;                # remove temporary layer.
+  # set the layer size to be the full layer for each copied layer
+  $spinlayer->resize($maxwide, $maxhigh, $spinlayer->offsets);
+  $destlayer->resize($maxwide, $maxhigh, $destlayer->offsets);
+  # need an even number of frames for spinback
+  if ($frames%2 && $spinback) {
+    $frames++;
+    Gimp->message(__"An even number of frames is needed for spin back.\nAdjusted frames up to $frames");
+  }
+  spin_layer($img, $spinlayer, $destlayer, $spinback ? $frames/2 : $frames, $perspective);
+  # go back from destination to spinlayer if spinning back
+  spin_layer($img, $destlayer, $spinlayer, $frames/2, $perspective) if $spinback;
+  # remove the original 2 pasted layers
+  $img->remove_layer($destlayer);
+  $img->remove_layer($spinlayer);
+  # unhide and name layers (Give timings)
+  # (note that image_set_visible used here is a Gimp::Util function)
+  @all_layers = $img->get_layers;
+  $img->set_visible(@all_layers);
+  $all_layers[$frames/2-1]->set_name(__"Spin Layer DEST (250ms)") if $spinback;
+  $all_layers[$frames-1]->set_name(__"Spin Layer SRC (250ms)");
+  $img->convert_indexed(1,MAKE_PALETTE,255,0,1,"buffy") if $indexed;
+  Gimp::Context->pop;
+  return();
+};
 
-    Gimp::Context->push;
-    Gimp::Context->set_background($color);
+exit main;
+__END__
 
-    $perspective /= 255.0; # PF_SLIDER doesn't work right for < 1
+=head1 NAME
 
-    Gimp->progress_init(__"Seth Spin...");
+seth_spin - Seth Spin
 
-    # Copy souce and destination to new image
+=head1 SYNOPSIS
 
-    $maxwide = ($src->width > $dest->width) ? $src->width : $dest->width;
-    $maxhigh = ($src->height > $dest->height) ? $src->height: $dest->height;
+<Image>/Filters/Animation/Seth Spin...
 
-    $img = Gimp->image_new($maxwide, $maxhigh, RGB);
-    $tmpimglayer = $img->add_new_layer(0,3,1); # have to have a layer before displaying
-    $img->display_new;
+=head1 DESCRIPTION
 
-    $src->edit_copy();
-    $spinlayer = $tmpimglayer->edit_paste(1);
-    $spinlayer->floating_sel_to_layer();
+Take one image.  Spin it about the horizontal axis, and end up with
+another image.  I made it for easy web buttons.
 
-    $dest->edit_copy();
-    $destlayer = $tmpimglayer->edit_paste(1);
-    $destlayer->floating_sel_to_layer();
+=head1 PARAMETERS
 
-    $tmpimglayer->remove_layer;                # remove temporary layer.
+  [PF_DRAWABLE, "destination","What drawable to spin to?"],
+  [PF_INT8, "frames", "How many frames to use?", 16],
+  [PF_COLOR, "color", "What color to use for background if not transparent", [0,0,0]],
+  [PF_SLIDER, "perspective", "How much perspective effect to get", 40, [0,255,5]],
+  [PF_TOGGLE, "spinback", "Also spin back?" , 1],
+  [PF_TOGGLE, "indexed", "Convert to indexed?", 1],
 
-    # set the layer size to be the full layer for each copied layer
-    $spinlayer->resize($maxwide, $maxhigh, $spinlayer->offsets);
-    $destlayer->resize($maxwide, $maxhigh, $destlayer->offsets);
+=head1 IMAGE TYPES
 
-    # need an even number of frames for spinback
-    if ($frames%2 && $spinback) {
-        $frames++;
-        Gimp->message(__"An even number of frames is needed for spin back.\nAdjusted frames up to $frames");
-    }
+*
 
-    spin_layer($img, $spinlayer, $destlayer, $spinback ? $frames/2 : $frames, $perspective);
+=head1 HISTORY
 
-    # go back from destination to spinlayer if spinning back
-    spin_layer($img, $destlayer, $spinlayer, $frames/2, $perspective) if $spinback;
+ Note: Seth has transferred the maintainer `position' to me, so bother me
+ instead of him now :-)
+       - Steinar H. Gunderson <sgunderson bigfoot com>
 
-    # remove the original 2 pasted layers
-    $img->remove_layer($destlayer);
-    $img->remove_layer($spinlayer);
+ This one's all mine.  Well, its GPL/Artistic but I'm the author and creator.
+ You need gimp 1.1 or better for this; too much has changed, and I don't think
+ 1.0.x had a perspective PDB function anyway
 
-    # unhide and name layers (Give timings)
-    # (note that image_set_visible used here is a Gimp::Util function)
-    @all_layers = $img->get_layers;
-    $img->set_visible(@all_layers);
+ Here's the working theory on this:
+  There's a function called spinlayer which will spin from a spinlayer to a
+  destlayer.  It won't touch those 2 layers at all, and will leave its results
+  on the top of the layer stack.
 
-    $all_layers[$frames/2-1]->set_name(__"Spin Layer DEST (250ms)") if $spinback;
-    $all_layers[$frames-1]->set_name(__"Spin Layer SRC (250ms)");
+  If the user wants to spin back, it will take 1/2 the layers otherwise required
+  per call to the spin_layer, so that the number of total layers comes out the
+  same.
 
-    $img->convert_indexed(1,MAKE_PALETTE,255,0,1,"buffy" ) if $indexed;
+  The main function makes a new image, copies the source and destination onto it
+  with appropriate offsets, and passes this image with the bottom 2 layers to
+  spin_layer.  At the end, remove the original 2 layers, since they won't be
+  needed, and add in some Layer comments for timing your gif.
 
-    Gimp::Context->pop;
-    return();
-};
+  Many thanks to Steinar and Marc, for expressing an interest in the
+  script that kept me going, and to Steinar in particular for helping me
+  track down why the script was crashing gimp (hint - don't make layers
+  of height=0, and if you do make sure you're logging to console since
+  the Gtk messagebox will never show up due to a rapid segfault).
 
-exit main;
+  Just a comment on that: We fixed the bug, so height=0 no longer segfaults, but
+  gives the error message it should. However, if GIMP segfaults, you should try
+  logging to console to make sure you get all applicable error messages. This
+  will make it _much_ easier to find the bug. - Steinar
+
+ Revision History:
+ 1.0 - Initial (too early) release
+ 1.1 - Second (still ugly) release: Made the perspective setting actually do
+       something
+ 1.2 - Used some of the convienence functions, and made things a little eaiser
+       from the user's standpoint too.  Also moved it from the
+       Filters->Animations-> menu to Xtns->Animations.  I think its
+       clearer whats going on this way.  It also works w/ any 2 layers now.
+ 1.5 - Some debugging by Steinar and myself to make it work again.
+ 1.6 - Moved some renaming into the main loop, more cleanups.
+ 1.7 - Fixed up set_name to drawable_set_name
+
+ Seth Burgess
+ <sjburges gimp org>
+
+=head1 AUTHOR
+
+Seth Burgess <sjburges gimp org>
+
+=head1 DATE
+
+1.7
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/stamps b/examples/stamps
index f4214dc..5d0254e 100755
--- a/examples/stamps
+++ b/examples/stamps
@@ -1,69 +1,67 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 
 N_"/Xtns/Render"; # dummy translation for i18n bugs
 
-sub stamps {
-       my ($size, $hole, $paper, $diameter, $gap) = @_;
-
-       gimp_context_set_background($paper);
-       $img = gimp_image_new($size, $size, RGB);
-       $layer = gimp_layer_new($img, $size, $size, RGB_IMAGE, "Layer 1", 100, NORMAL_MODE);
-       gimp_image_insert_layer($layer, 0, -1);
-       gimp_context_set_background($hole);
-       $layer->gimp_edit_fill(BACKGROUND_FILL);
-       gimp_selection_none($img);
-
-       my $ncircles = int(($size + $gap) / ($diameter + $gap));
-       $x = 0;
-       for ($i=0; $i<$ncircles; $i++) {
-                       gimp_image_select_ellipse($img,
-                                       CHANNEL_OP_ADD, $x, 0,
-                                       $diameter, $diameter,
-                                       );
-                       gimp_image_select_ellipse($img,
-                                       CHANNEL_OP_ADD, 0, $x,
-                                       $diameter, $diameter,
-                                       );
-                       $x = $x + $diameter + $gap;
-       }
-       gimp_context_set_background($paper);
-       gimp_edit_fill($layer, BACKGROUND_FILL);
-       gimp_selection_none($img);
-
+podregister {
+  gimp_context_set_background($paper);
+  my $img = gimp_image_new($size, $size, RGB);
+  my $layer = gimp_layer_new($img, $size, $size, RGB_IMAGE, "Layer 1", 100, NORMAL_MODE);
+  gimp_image_insert_layer($layer, 0, -1);
+  gimp_context_set_background($hole);
+  $layer->gimp_edit_fill(BACKGROUND_FILL);
+  gimp_selection_none($img);
+  my $ncircles = int(($size + $gap) / ($diameter + $gap));
+  my $x = 0;
+  for ($i=0; $i<$ncircles; $i++) {
+    $img->select_ellipse( CHANNEL_OP_ADD, $x, 0, $diameter, $diameter);
+    $img->select_ellipse( CHANNEL_OP_ADD, 0, $x, $diameter, $diameter);
+    $x += $diameter + $gap;
+  }
+  gimp_context_set_background($paper);
+  gimp_edit_fill($layer, BACKGROUND_FILL);
+  gimp_selection_none($img);
 # here, at last, comes the clever part! :-)
-       $layer->offset(1, 0, -($diameter / 2), -($diameter / 2));
-       gimp_display_new($img);
-       return $img;
-}
-
-register       "stamps",
-               "Creates a rectangular image with stamp-like perforations.",
-               "Default values are not bad!",
-               "Claes G Lindblad <claesg\ algonet se>",
-               "Claes G Lindblad <claesg\ algonet se>",
-               "990314",
-               N_"<Image>/File/Create/Logos/Stamps...",
-               undef,
-       [
-       [PF_INT32, "size", "img size", 90],
-       [PF_COLOR, "paper", "paper color", [255, 255, 255]],
-       [PF_COLOR, "hole", "hole color", [0, 0, 0]],
-       [PF_INT32, "diameter", "diameter", 10],
-       [PF_INT32, "gap", "gap", 5]
-       ],
-       \&stamps;
+  $layer->offset(1, 0, -($diameter / 2), -($diameter / 2));
+  gimp_display_new($img);
+  return $img;
+};
 
 exit main;
+__END__
+
+=head1 NAME
+
+stamps - Creates a rectangular image with stamp-like perforations
+
+=head1 SYNOPSIS
+
+<Image>/File/Create/Logos/Stamps...
+
+=head1 DESCRIPTION
+
+Default values are not bad!
+
+=head1 PARAMETERS
+
+  [PF_INT32, "size", "img size", 90],
+  [PF_COLOR, "paper", "paper color", [255, 255, 255]],
+  [PF_COLOR, "hole", "hole color", [0, 0, 0]],
+  [PF_INT32, "diameter", "diameter", 10],
+  [PF_INT32, "gap", "gap", 5]
+
+=head1 AUTHOR
+
+Claes G Lindblad <claesg algonet se>
+
+=head1 DATE
+
+990314
 
 =head1 LICENSE
 
-Copyright Claes G. Lindblad.
-Distributed under the terms of the GNU public license, v2 or higher.
+Claes G Lindblad <claesg algonet se>
 
-=cut
+Distributed under the terms of the GNU public license, v2 or higher.
diff --git a/examples/translogo b/examples/translogo
index 16895c7..d884539 100755
--- a/examples/translogo
+++ b/examples/translogo
@@ -5,68 +5,74 @@ use Gimp::Fu;
 use Gimp::Util;
 #Gimp::set_trace(TRACE_CALL);
 
-#12/5/03: <sjburges gimp org>
-# s/gimp_convert/gimp_image_convert/
-
-sub my_code {
-       my ($image, $drawable, $rad_tog, $pattern, $txt_col) = @_;
-       Gimp::Context->push();
-       $drawable->has_alpha or die __"You can't run this script without an ALPHA CHANNEL!!";
-       my $test = 0;
-       $test = $drawable->type_with_alpha;
-       if ($test == 5) {
-               die __"You can't run this script with an INDEXED image!!";
-       } elsif ($test == 3) {
-               gimp_image_convert_rgb ($image);
-       }
-       my $img = gimp_image_new (100, 100, RGB_IMAGE);
-       $drawable->get_image->selection_all;
-       $drawable->edit_copy;
-       gimp_selection_none ($image);
-       my $layer;
-       $layer=$img->layer_new($drawable->width,$drawable->height,$image->layertype(1), __"Text", 100, 
NORMAL_MODE);
-       $layer->drawable_fill(TRANSPARENT_FILL);
-       $img->insert_layer($layer,0,0);
-       $layer->edit_paste(0)->floating_sel_anchor;
-       $img->resize($drawable->width,$drawable->height, 0, 0);
-       gimp_image_select_item($img, CHANNEL_OP_REPLACE, $layer);
-       gimp_selection_invert ($img);
-       Gimp::Context->set_background ([255, 255, 255]);
-       gimp_edit_fill ($layer, BACKGROUND_FILL);
-       gimp_selection_none ($img);
-       gimp_invert ($layer);
-       plug_in_gauss_rle ($layer, 2.0, 1, 1);
-       my $bump_lay;
-       $bump_lay = $img->layer_new($img->width,$img->height, RGBA_IMAGE, __"Bumpmap", 100, NORMAL_MODE);
-       $bump_lay->drawable_fill(BACKGROUND_FILL);
-       $img->insert_layer($bump_lay,0,0);
-       if ($rad_tog == 1) {
-               Gimp::Context->set_pattern ($pattern);
-               gimp_edit_bucket_fill ($bump_lay, PATTERN_BUCKET_FILL, NORMAL_MODE, 100, 0, 0, 0, 0);
-       } else {
-               Gimp::Context->set_background ($txt_col);
-               gimp_edit_fill ($bump_lay, BACKGROUND_FILL);
-       }
-       plug_in_bump_map ($img, $bump_lay, $layer, 110.0, 45.0, 4, 0, 0, 0, 0, 1, 0, 0);
-       $pattern_mask = gimp_layer_create_mask ($bump_lay, ADD_ALPHA_MASK);
-       $bump_lay->add_mask($pattern_mask);
-       gimp_selection_all ($img);
-       gimp_edit_copy ($layer);
-       $float = gimp_edit_paste ($pattern_mask, 0);
-       gimp_floating_sel_anchor ($float);
-       gimp_levels ($pattern_mask, 0, 0, 77, 0.91, 0, 255);
-       $bump_lay->remove_mask (MASK_APPLY);
-       gimp_invert ($layer);
-       gimp_image_flatten ($img);
-       gimp_image_convert_indexed ($img, 0, MAKE_PALETTE, 256, 0, 0, "");
-       my $new = gimp_image_get_active_drawable ($img);
-       gimp_layer_add_alpha ($new);
-       gimp_image_select_color ($img, CHANNEL_OP_ADD, $new, [255, 255, 255]);
-       gimp_edit_clear ($new);
-       gimp_selection_none ($img);
-       return;
-}
-$help=<<EOF.$help;
+podregister {
+  Gimp::Context->push();
+  $drawable->has_alpha or die __"You can't run this script without an ALPHA CHANNEL!!";
+  my $test = 0;
+  $test = $drawable->type_with_alpha;
+  if ($test == 5) {
+    die __"You can't run this script with an INDEXED image!!";
+  } elsif ($test == 3) {
+    gimp_image_convert_rgb ($image);
+  }
+  my $img = gimp_image_new (100, 100, RGB_IMAGE);
+  $drawable->get_image->selection_all;
+  $drawable->edit_copy;
+  gimp_selection_none ($image);
+  my $layer=$img->layer_new($drawable->width,$drawable->height,$image->layertype(1), __"Text", 100, 
NORMAL_MODE);
+  $layer->drawable_fill(TRANSPARENT_FILL);
+  $img->insert_layer($layer,0,0);
+  $layer->edit_paste(0)->floating_sel_anchor;
+  $img->resize($drawable->width,$drawable->height, 0, 0);
+  $img->select_item(CHANNEL_OP_REPLACE, $layer);
+  $img->selection_invert;
+  Gimp::Context->set_background ([255, 255, 255]);
+  gimp_edit_fill ($layer, BACKGROUND_FILL);
+  gimp_selection_none ($img);
+  gimp_invert ($layer);
+  plug_in_gauss_rle ($layer, 2.0, 1, 1);
+  my $bump_lay = $img->layer_new($img->width,$img->height, RGBA_IMAGE, __"Bumpmap", 100, NORMAL_MODE);
+  $bump_lay->drawable_fill(BACKGROUND_FILL);
+  $img->insert_layer($bump_lay,0,0);
+  if ($rad_tog == 1) {
+    Gimp::Context->set_pattern ($pattern);
+    gimp_edit_bucket_fill ($bump_lay, PATTERN_BUCKET_FILL, NORMAL_MODE, 100, 0, 0, 0, 0);
+  } else {
+    Gimp::Context->set_background ($txt_col);
+    gimp_edit_fill ($bump_lay, BACKGROUND_FILL);
+  }
+  $bump_lay->bump_map($layer, 110.0, 45.0, 4, 0, 0, 0, 0, 1, 0, 0);
+  $pattern_mask = $bump_lay->create_mask(ADD_ALPHA_MASK);
+  $bump_lay->add_mask($pattern_mask);
+  gimp_selection_all ($img);
+  gimp_edit_copy ($layer);
+  $float = gimp_edit_paste ($pattern_mask, 0);
+  gimp_floating_sel_anchor ($float);
+  $pattern_mask->levels(0, 0, 77, 0.91, 0, 255);
+  $bump_lay->remove_mask(MASK_APPLY);
+  gimp_invert ($layer);
+  gimp_image_flatten ($img);
+  gimp_image_convert_indexed ($img, 0, MAKE_PALETTE, 256, 0, 0, "");
+  my $new = gimp_image_get_active_drawable ($img);
+  gimp_layer_add_alpha ($new);
+  gimp_image_select_color ($img, CHANNEL_OP_ADD, $new, [255, 255, 255]);
+  gimp_edit_clear ($new);
+  gimp_selection_none ($img);
+  return;
+};
+exit main;
+__END__
+
+=head1 NAME
+
+make_trans_logos - A script to get transparent beveled logos
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Web/Transparent Logo...
+
+=head1 DESCRIPTION
+
 This script aims to produce a transparent logo in an indexed image
 which is ready to be saved in .gif format. If you need a transparent
 image containing a logo for your web page, just apply this script over
@@ -74,29 +80,37 @@ a drawable with an alpha channel in RGB or GRAY mode.
 
 You can choose between colour and pattern fill of your text.
 
-As an input, you need to have an image that has an alpha channel, and isn't 100% opaque - its really 
designed to work with a text layer.  It will then make a "logo" out of your non-white sections of the image 
and index it.  The original image is untouched.
-
-EOF
-
-register "make_trans_logos",
-        "A script to get transparent beveled logos",
-        "$help",
-        "Michele Gherlone <mikem\ enet it>",
-        "(c) 2000 M. Gherlone",
-        "20000123",
-        N_"<Image>/Filters/Web/Transparent Logo...",
-        "*",
-        [
-          [PF_RADIO    , 'use_a_colour_or_a_pattern_for_text', "The user's choice", 0, [Colour => 0, Pattern 
=> 1]],
-          [PF_PATTERN  , 'choose_a_pattern', "Choose the text Pattern", "Wood #1"],
-          [PF_COLOUR   , 'choose_a_colour',  "Choose the text Color", [69, 88, 211]],
-        ],
-        \&my_code;
-exit main;
+As an input, you need to have an image that has an alpha channel,
+and isn't 100% opaque - it's really designed to work with a text layer.
+It will then make a "logo" out of your non-white sections of the image
+and index it.  The original image is untouched.
+
+=head1 PARAMETERS
+
+ [PF_RADIO, 'rad_tog', 'Use a colour or a pattern for text', 0,
+    [Colour => 0, Pattern => 1]],
+ [PF_PATTERN, 'pattern', "Choose the text pattern", "Wood #1"],
+ [PF_COLOUR, 'txt_col', "Choose the text color", [69, 88, 211]],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 HISTORY
+
+  12/5/03: <sjburges gimp org>
+   s/gimp_convert/gimp_image_convert/
+
+=head1 AUTHOR
+
+Michele Gherlone <mikem enet it>
+
+=head1 DATE
+
+20000123
 
 =head1 LICENSE
 
-Copyright Michele Gherlone.
-Distributed under unknown licensing terms.
+(c) 2000 M. Gherlone
 
-=cut
+Distributed under unknown licensing terms.
diff --git a/examples/warp-sharp b/examples/warp-sharp
index 1c6ae80..1a3b832 100755
--- a/examples/warp-sharp
+++ b/examples/warp-sharp
@@ -1,102 +1,105 @@
 #!/usr/bin/perl
 
-# slightly edited by pcg goof com
-
 use Gimp qw(:auto);
 use Gimp::Fu;
 
-sub warp_sharp  {
-    my ($img, $drw, $edge_strength, $blur_strength,
-       $bump_depth, $displace_amount)= _;
-    my $drawable_width=$drw->width;
-    my $drawable_height=$drw->height;
-    my $drawable_type=($drw->type);
-    my $edge_layer=gimp_layer_copy($drw,0);
-    my $x_displace_layer=
-      $img->layer_new($drawable_width, $drawable_height,
-                     $drawable_type, "Displace X", 100, 0);
-    my $y_displace_layer=
-      $img->layer_new($drawable_width, $drawable_height,
-                     $drawable_type, "Displace Y", 100, 0);
-    my @selection_info=$img->selection_bounds;
-    my $has_selection=$selection_info[0];
-    my $old_selection;
-    my $bump_xoff;
-    my $bump_yoff;
-    my $version=1;
+podregister {
+  my $drawable_width=$drawable->width;
+  my $drawable_height=$drawable->height;
+  my $drawable_type=($drawable->type);
+  my $edge_layer=gimp_layer_copy($drawable,0);
+  my $x_displace_layer=
+    $image->layer_new($drawable_width, $drawable_height,
+                   $drawable_type, "Displace X", 100, 0);
+  my $y_displace_layer=
+    $image->layer_new($drawable_width, $drawable_height,
+                   $drawable_type, "Displace Y", 100, 0);
+  my @selection_info=$image->selection_bounds;
+  my $has_selection=$selection_info[0];
+  my $old_selection;
+  my $bump_xoff;
+  my $bump_yoff;
+  my $version=1;
 
 #    Gimp::set_trace(TRACE_ALL);
-    $img->undo_group_start;
-    if ($has_selection) {
-        $old_selection=$img->gimp_selection_save;
-        $img->selection_grow($blur_strength + $bump_depth + $displace_amount);
-       $bump_xoff=$selection_info[1];
-       $bump_yoff=$selection_info[2];
-    }
-    $x_displace_layer->fill(1 + $version);
-    $y_displace_layer->fill(1 + $version);
-    $img->insert_layer($edge_layer,0,-1);
-    $img->insert_layer($x_displace_layer,0,-1);
-    $img->insert_layer($y_displace_layer,0,-1);
+  $image->undo_group_start;
+  if ($has_selection) {
+      $old_selection=$image->gimp_selection_save;
+      $image->selection_grow($blur_strength + $bump_depth + $displace_amount);
+      $bump_xoff=$selection_info[1];
+      $bump_yoff=$selection_info[2];
+  }
+  $x_displace_layer->fill(1 + $version);
+  $y_displace_layer->fill(1 + $version);
+  $image->insert_layer($edge_layer,0,-1);
+  $image->insert_layer($x_displace_layer,0,-1);
+  $image->insert_layer($y_displace_layer,0,-1);
 
 # added another parameter in edge detect plugin... I'm assuming it was
 # previously differential?
 # TODO: add warp type enums
 
-    plug_in_edge($img,$edge_layer,$edge_strength,1,4);
-
-    plug_in_gauss_iir($img, $edge_layer, $blur_strength, 1, 1)
-      if ($blur_strength >= 1);
-
-    plug_in_bump_map($img,$x_displace_layer,$edge_layer, 0, 30,
-                    $bump_depth, $bump_xoff,$bump_yoff, 0,0,0,0,0);
-
-    plug_in_bump_map($img,$y_displace_layer,$edge_layer, 270, 30,
-                    $bump_depth, $bump_xoff,$bump_yoff, 0,0,0,0,0);
-
-    if ($has_selection) {
-       $old_selection->gimp_selection_load;
-       $old_selection->remove_channel;
-       # will cause a crash:
-       # $old_selection->gimp_item_delete;
-    }
-
-    plug_in_displace($img,$drw, $displace_amount, $displace_amount, 1,1,
-                    $x_displace_layer, $y_displace_layer, 1);
-
-    $img->remove_layer($edge_layer);
-    $img->remove_layer($x_displace_layer);
-    $img->remove_layer($y_displace_layer);
-    $img->undo_group_end;
-    gimp_displays_flush();
-    return undef;
-}
-
-
-register
-  "warp_sharp",
-  "Sharpen the current drawable",
-  "Sharpen the current drawable by squeezing unsharp edges. Algorithm described by Joern Loviscach in c't 
22/1999, p 236.",
-  "Simon Budig <simon\ gimp org>, Peter Daum <gator\ cs tu-berlin de>",
-  "Simon Budig, Peter Daum",
-  "2000-05-11",
-  N_"<Image>/Filters/Enhance/Warp Sharp...",
-  "RGB*, GRAY*",
-  [
-   [PF_SLIDER, "edge_detection", "Edge detection", 7, [1, 10, 0.1]],
-   [PF_SLIDER, "blur_radius", "Blur radius", 3, [0, 10, 0.1]],
-   [PF_SLIDER, "bump_depth", "Bump depth", 2, [1, 10, 1]],
-   [PF_SLIDER, "intensity", "Displace Intensity", 2.5, [0.1, 10, 0.1]]
-  ],
-  [],
-  \&warp_sharp;
-
+  $image->edge($edge_layer,$edge_strength,1,4);
+  $image->gauss_iir($edge_layer, $blur_strength, 1, 1) if $blur_strength >= 1;
+  $image->bump_map($x_displace_layer,$edge_layer, 0, 30,
+                  $bump_depth, $bump_xoff, $bump_yoff, 0,0,0,0,0);
+  $image->bump_map($y_displace_layer,$edge_layer, 270, 30,
+                  $bump_depth, $bump_xoff, $bump_yoff, 0,0,0,0,0);
+
+  if ($has_selection) {
+    $old_selection->gimp_selection_load;
+    $old_selection->remove_channel;
+    # will cause a crash:
+    # $old_selection->delete;
+  }
+
+  plug_in_displace($image,$drawable, $displace_amount, $displace_amount, 1,1,
+                  $x_displace_layer, $y_displace_layer, 1);
+
+  $image->remove_layer($edge_layer);
+  $image->remove_layer($x_displace_layer);
+  $image->remove_layer($y_displace_layer);
+  $image->undo_group_end;
+  return;
+};
 
 exit main;
+__END__
+
+=head1 NAME
+
+warp_sharp - Sharpen the current drawable
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Enhance/Warp Sharp...
+
+=head1 DESCRIPTION
+
+Sharpen the current drawable by squeezing unsharp edges. Algorithm
+described by Joern Loviscach in c't 22/1999, p 236.
+
+=head1 PARAMETERS
+
+ [PF_SLIDER, "edge_strength", "Edge detection", 7, [1, 10, 0.1]],
+ [PF_SLIDER, "blur_strength", "Blur radius", 3, [0, 10, 0.1]],
+ [PF_SLIDER, "bump_depth", "Bump depth", 2, [1, 10, 1]],
+ [PF_SLIDER, "displace_amount", "Displace Intensity", 2.5, [0.1, 10, 0.1]]
+
+=head1 IMAGE TYPES
+
+RGB*, GRAY*
+
+=head1 AUTHOR
+
+Simon Budig <simon gimp org>, Peter Daum <gator cs tu-berlin de>
+
+=head1 DATE
+
+2000-05-11
 
 =head1 LICENSE
 
 Copyright Simon Budig, Peter Daum. (original scheme by Simon Budig).
-Distributed under the terms of the GNU Publice License, v2 or higher.
 
-=cut
+Distributed under the terms of the GNU Publice License, v2 or higher.
diff --git a/examples/webify b/examples/webify
index f8b1506..c36b8a6 100755
--- a/examples/webify
+++ b/examples/webify
@@ -1,59 +1,69 @@
 #!/usr/bin/perl
 
-eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
-    if 0; # not running under some shell
-
 use Gimp;
 use Gimp::Fu;
 
 #Gimp::set_trace(TRACE_ALL);
 
-register "webify",
-         "Make an image suitable for the web",
-         "This plug-in converts the image to indexed, with some extra options",
-         "Marc Lehmann",
-         "Marc Lehmann",
-         "1.0",
-         N_"<Image>/Filters/Web/Webify...",
-         "RGB*, GRAY*",
-         [
-          [PF_BOOL,    "new",          "create a new image?", 1],
-          [PF_BOOL,    "transparent",  "make transparent?", 1],
-          [PF_COLOUR,  "bg_color",     "the background colour to use for transparency", "white"],
-          [PF_SLIDER,  "threshold",    "the threshold to use for background detection", 3, [0, 255, 1]],
-          [PF_INT32,   "colors",       "how many colours to use (0 = don't convert to indexed)", 32],
-          [PF_BOOL,    "autocrop",     "autocrop at end?", 1],
-         ],
-        [ [PF_IMAGE, 'image', 'Output image', 0] ],
-         sub {
-   my($img,$drawable,$new,$alpha,$bg,$thresh,$colours,$autocrop)= _;
-   $thresh /= 255;
-
-   $img = $img->duplicate if $new;
-
-   eval { $img->undo_group_start };
-
-   $drawable = $img->flatten;
-
-   if ($alpha) {
-      $drawable->add_alpha;
-      Gimp::Context->set_sample_threshold($thresh);
-      $img->select_color(CHANNEL_OP_REPLACE,$drawable,$bg);
-      $drawable->edit_cut if $img->selection_bounds;
-   }
-   Gimp::Plugin->autocrop($drawable) if $autocrop;
-   $img->convert_indexed (2, 0, $colours, 0, 0, '') if $colours;
-
-   eval { $img->undo_group_end };
-
-   $new ? ($img->clean_all, $img) : ($img);
+podregister {
+  $thresh /= 255;
+  $image = $image->duplicate if $new;
+  $image->undo_group_start;
+  $drawable = $image->flatten;
+  if ($alpha) {
+    $drawable->add_alpha;
+    Gimp::Context->set_sample_threshold($thresh);
+    $image->select_color(CHANNEL_OP_REPLACE,$drawable,$bg);
+    $drawable->edit_cut if $image->selection_bounds;
+  }
+  $drawable->autocrop if $autocrop;
+  $image->convert_indexed (2, 0, $colours, 0, 0, '') if $colours;
+  $image->undo_group_end;
+  $new ? ($image->clean_all, $image) : ($image);
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+webify - Make an image suitable for the web
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Web/Webify...
+
+=head1 DESCRIPTION
+
+This plug-in converts the image to indexed, with some extra options.
+
+=head1 PARAMETERS
+
+  [PF_BOOL, "new", "Create a new image?", 1],
+  [PF_BOOL, "alpha", "Make transparent?", 1],
+  [PF_COLOUR, "bg", "Background colour to use for transparency", "white"],
+  [PF_SLIDER, "thresh", "Threshold to use for background detection", 3, [0, 255, 1]],
+  [PF_INT32, "colours", "How many colours to use (0 = don't convert to indexed)", 32],
+  [PF_BOOL, "autocrop", "Autocrop at end?", 1],
+
+=head1 RETURN VALUES
+
+  [PF_IMAGE, 'image', 'Output image']
+
+=head1 IMAGE TYPES
+
+RGB*, GRAY*
+
+=head1 AUTHOR
+
+Marc Lehmann
+
+=head1 DATE
+
+1.0
 
 =head1 LICENSE
 
-Copyright Marc Lehman.
-Distributed under the same terms as Gimp-Perl.
+Marc Lehmann
 
-=cut
+Distributed under the same terms as Gimp-Perl.
diff --git a/examples/windify b/examples/windify
index dd5c23d..e7e1ddc 100755
--- a/examples/windify
+++ b/examples/windify
@@ -1,86 +1,87 @@
 #!/usr/bin/perl
 
-# sent to me by Seth Burgess <sjburges gimp org>
-# small changes my Marc Lehmann <pcg goof com>
-# 2014/03/17 ported to GIMP 2.8.10 by Ed J:
-#   - I think the fill with the foreground colour should be background
-#     since that's the colour expressly set, but didn't touch
-#   - adjusted the maths so inputs are in degrees
-
-# There's corruption on the edges of this in smear mode.  Yuck.
-
-use Gimp qw(:auto N_ __);
+use Gimp;
 use Gimp::Fu;
 
 #Gimp::set_trace(TRACE_CALL);
 
-sub windify {
-       my ($img, $drawable, $angle, $density, $distance, $wrap) = @_;
-       gimp_context_push();
-       my $xsize = gimp_drawable_width($drawable);
-       my $ysize = gimp_drawable_height($drawable);
-
-       my $out = gimp_image_new($xsize,$ysize,0);
-       gimp_context_set_background([128,128,128]);
-       my $windlayer = gimp_layer_new($out,$xsize,$ysize,RGB_IMAGE,"Windlayer",100,NORMAL_MODE);
-       gimp_drawable_fill($windlayer, 0);
-       gimp_image_insert_layer($out,$windlayer,0,0);
-       my $windlayercopy = gimp_layer_copy($windlayer, 1);
-       gimp_image_insert_layer($out,$windlayercopy,0,0);
-       plug_in_noisify($out,$windlayercopy,0,$density/255,
-                                                $density/255,
-                                                $density/255,1);
-
-       plug_in_mblur($out,$windlayercopy,
-                     0,  #0=linear
-                     15, #length
-                     $angle,
-                     gimp_drawable_width($windlayercopy)/2,
-                     gimp_drawable_height($windlayercopy)/2
-                     );
-       gimp_layer_set_mode($windlayercopy, 10); # Lighten Only
-       gimp_image_merge_visible_layers($out,0);
+podregister {
+  Gimp::Context->push();
+  my $xsize = $drawable->width;
+  my $ysize = $drawable->height;
+  my $out = Gimp::Image->new($xsize,$ysize,0);
+  Gimp::Context->set_background([128,128,128]);
+  my $windlayer = $out->new($xsize,$ysize,RGB_IMAGE,"Windlayer",100,NORMAL_MODE);
+  $windlayer->fill(0);
+  $out->insert_layer($windlayer,0,0);
+  my $windlayercopy = $windlayer->copy(1);
+  $out->insert_layer($windlayercopy,0,0);
+  $windlayercopy->noisify(0,$density/255, $density/255, $density/255, 1);
+  $windlayercopy->mblur(
+    0, 15, $angle, $windlayercopy->width/2, $windlayercopy->height/2
+  );
+  $windlayercopy->set_mode(10); # Lighten Only
+  $out->merge_visible_layers(0);
 
 # many thanks to Dov for this suggestion as a workaround to the
 # gimp_image_merge_visible_layers bug
-
-       my $newlay = gimp_image_get_active_layer ($out);
-        my $xmult = cos(3.14159*$angle/180);
-        my $ymult = sin(3.14159*$angle/180);
-
-       plug_in_displace($img,$drawable,-$distance*$xmult,
-                                          $distance*$ymult,
-                                         1,1, $newlay,$newlay, $wrap);
-        gimp_drawable_offset($drawable,1,0,$distance*$xmult,-$distance*$ymult);
-       gimp_image_delete ($out);
-       gimp_displays_flush();
-        gimp_context_pop();
-
-       ();
-       }
-
-register
-       "windify",
-       "Add wind to an image",
-       "Blow your image all over :)",
-       "Seth Burgess",
-       "Seth Burgess <sjburges\ gimp org>",
-       "1998-09-14",
-       N_"<Image>/Filters/Distorts/Windify...",
-       "*",
-       [
-        [PF_INT32, "angle", "Wind Angle in degrees, 0 is right, increases anticlockwise", 120],
-        [PF_INT32, "density", "How Much Is Blown",80],
-        [PF_VALUE, "distance", "How Far It's Blown",30],
-        [PF_TOGGLE, "wrap", "Smear on Edges (or Wrap)",1]
-       ],
-       \&windify;
+  my $newlay = $out->get_active_layer;
+  my $xmult = cos(3.14159*$angle/180);
+  my $ymult = sin(3.14159*$angle/180);
+  $drawable->displace(
+    -$distance*$xmult, $distance*$ymult, 1, 1, $newlay, $newlay, $wrap
+  );
+  $drawable->offset(1,0,$distance*$xmult,-$distance*$ymult);
+  $out->delete;
+  Gimp::Context->pop();
+  ();
+};
 
 exit main;
+__END__
+
+=head1 NAME
+
+windify - Add wind to an image
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Distorts/Windify...
+
+=head1 DESCRIPTION
+
+Blow your image all over!
+
+=head1 PARAMETERS
+
+ [PF_INT32, "angle", "Wind Angle in degrees, 0 is right, increases anticlockwise", 120],
+ [PF_INT32, "density", "How Much Is Blown",80],
+ [PF_VALUE, "distance", "How Far It's Blown",30],
+ [PF_TOGGLE, "wrap", "Smear on Edges (or Wrap)",1]
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 HISTORY
+
+ sent to me by Seth Burgess <sjburges gimp org>
+ small changes my Marc Lehmann <pcg goof com>
+ 2014/03/17 ported to GIMP 2.8.10 by Ed J:
+   - I think the fill with the foreground colour should be background
+     since that's the colour expressly set, but didn't touch
+   - adjusted the maths so inputs are in degrees
+
+ There's corruption on the edges of this in smear mode.  Yuck.
+
+=head1 AUTHOR
+
+Seth Burgess <sjburges gimp org>
+
+=head1 DATE
+
+1998-09-14
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/xachlego b/examples/xachlego
index 4a67843..15029e1 100755
--- a/examples/xachlego
+++ b/examples/xachlego
@@ -1,123 +1,135 @@
 #!/usr/bin/perl
 
-# This is (hopefully) a demonstration of how pathetically easy it is to script
-# a neato effect you've come up with.  This lil' effect was created by xach,
-# and translated by sjburges (me).  You can consider it released under the GPL
-# or Artistic liscence, whichever makes you happier.
-#
-# <Xach> sjburges: 1. pixelize the photo  2. in a new white layer, render a grid
-#           at the same resolution as the pixelize, then blur it. threshold the
-#           grid until you get a roundish blob in the center of each square (you
-#           may need to repeat a few times).
-# <Xach> sjburges: meanwhile, back at the pixelized image, bumpmap it with
-#           itself and a depth of about 5. do this twice. then bumpmap it with
-#           the round blobby layer.
-# <Xach> then create a new, clean grid, and bumpmap the pixelized layer with it
-#
-
-# (To get a decent blobby grid)
-# <Xach> <Xach> render a grid at 10x10, gaussian blur at 7, then set levels to
-#           196 1.00 234
-
-# Revision - 1.1:      added a gimp_displays_flush() for 1.0.x users
-#                      stopped deleting the layers after removal - it was
-#                   causing bad things to happen with refcounts.  I hope
-#                   gimp is cleaning up this memory on its own...
-#            1.2:   Fixed buggy selection handling - oops ;)
-#            1.3:   Added undo capability by Marc Lehman <pcg goof com>
-#            1.4:   Marc Lehman <pcg goof com>, changed function name
-#            1.5:   Seth Burgess <sjburges gimp org> added my email, put it
-#                   in a directory more suitable than the lame "Misc"
-#            1.6:   Seth Burgess <sjburges gimp org> use Context
-# Here's the boring start of every script...
-
 use Gimp qw(:auto __ N_);
 use Gimp::Fu;
 
-register "xach_blocks",
-         "Xach's Blocks o' Fun",
-         "Turn your picture into something that resembles a certain trademarked
-          building block creation",
-         "Seth Burgess",
-         "Seth Burgess <sjburges\ gimp org>",
-         "2-15-98",
-         N_"<Image>/Filters/Map/Xach Blocks...",
-         "*",
-         [
-          [PF_SLIDER,  "block_size",   "The size of the blocks", 10, [2, 255, 1]],
-          [PF_SLIDER,  "knob_factor",  "The size of your knob", 40, [10, 100, 5]],
-         ],
-         sub {
-   my($img,$drawable,$blocksize, $knobfactor)= _;
-       $selection_flag = 0;
-        eval { $img->undo_group_start };
-       if (!$drawable->has_alpha) {
-               $drawable->add_alpha;
-               };
-       if ($img->selection_is_empty) {
-               $img->selection_all;
-               $selection_flag = 1;
-               }
-        Gimp::Context->push();
+podregister {
+  my $selection_flag = 0;
+  $image->undo_group_start;
+  $drawable->add_alpha unless $drawable->has_alpha;
+  if ($image->selection_is_empty) {
+    $image->selection_all;
+    $selection_flag = 1;
+  }
+  Gimp::Context->push();
 # Now the fun begins :)
 
-       $selection = $img->selection_save;
+  $selection = $image->selection_save;
 
 #1. Pixelize the photo
-       $drawable->plug_in_pixelize($blocksize);
+  $drawable->pixelize($blocksize);
 # 2. in a new white layer, render a grid
 #           at the same resolution as the pixelize, then blur it.
-       $gridlayer = $img->layer_new($img->width, $img->height, RGBA_IMAGE, "Grid 1", 100, 0);
-       $img->insert_layer($gridlayer,0,0);
-       $img->selection_all;
-       gimp_edit_clear($gridlayer);
-       gimp_context_set_background([255,255,255]);
-       gimp_edit_fill($gridlayer, BACKGROUND_FILL);
-       $gridlayer->plug_in_grid(1, $blocksize, 0, [0,0,0], 255, 1, $blocksize, 0, [0,0,0], 255, 0, 0, 0, 
[0,0,0], 0);
-       $gridlayer->plug_in_gauss_iir(0.7*$blocksize, 1, 1);
+  $gridlayer = $image->layer_new($image->width, $image->height, RGBA_IMAGE, "Grid 1", 100, 0);
+  $image->insert_layer($gridlayer,0,0);
+  $image->selection_all;
+  gimp_edit_clear($gridlayer);
+  Gimp::Context->set_background([255,255,255]);
+  gimp_edit_fill($gridlayer, BACKGROUND_FILL);
+  $gridlayer->grid(1, $blocksize, 0, [0,0,0], 255, 1, $blocksize, 0, [0,0,0], 255, 0, 0, 0, [0,0,0], 0);
+  $gridlayer->gauss_iir(0.7*$blocksize, 1, 1);
 
 #      threshold the
 #   grid until you get a roundish blob in the center of each square (you
 #   may need to repeat a few times).
 
-       $gridlayer->levels(0, 196, 234, $knobfactor/100.0 , 0, 255);
+  $gridlayer->levels(0, 196, 234, $knobfactor/100.0 , 0, 255);
 
 # <Xach> sjburges: meanwhile, back at the pixelized image, bumpmap it with
 #           itself and a depth of about 5. do this twice.
-       gimp_selection_load($selection);
-       $drawable->plug_in_bump_map($drawable, 135, 45, 5, 0, 0, 0, 0, 1, 0, 0);
-       $drawable->plug_in_bump_map($drawable, 135, 45, 5, 0, 0, 0, 0, 1, 0, 0);
-       $drawable->plug_in_bump_map($gridlayer, 135, 45, 5, 0, 0, 0, 0, 1, 0, 0);
+  gimp_selection_load($selection);
+  $drawable->bump_map($drawable, 135, 45, 5, 0, 0, 0, 0, 1, 0, 0);
+  $drawable->bump_map($drawable, 135, 45, 5, 0, 0, 0, 0, 1, 0, 0);
+  $drawable->bump_map($gridlayer, 135, 45, 5, 0, 0, 0, 0, 1, 0, 0);
 
 # <Xach> then create a new, clean grid, and bumpmap the pixelized layer with it
-       $img->selection_all;
-       $cleangrid = $img->layer_new($img->width, $img->height,
-                                 RGBA_IMAGE, "Grid 2", 100, 0);
-       $img->insert_layer($cleangrid,0,0);
-       gimp_edit_fill($cleangrid, BACKGROUND_FILL);
-       $cleangrid->plug_in_grid(1, $blocksize, 0, [0,0,0], 255, 1, $blocksize, 0, [0,0,0], 255, 0, 0, 0, 
[0,0,0], 0);
-       gimp_selection_load($selection);
-       $drawable->plug_in_bump_map($cleangrid, 135, 45, 3, 0, 0, 0, 0, 1, 0, 0);
-       $img->selection_all;
+  $image->selection_all;
+  $cleangrid = $image->layer_new($image->width, $image->height,
+                          RGBA_IMAGE, "Grid 2", 100, 0);
+  $image->insert_layer($cleangrid,0,0);
+  gimp_edit_fill($cleangrid, BACKGROUND_FILL);
+  $cleangrid->grid(1, $blocksize, 0, [0,0,0], 255, 1, $blocksize, 0, [0,0,0], 255, 0, 0, 0, [0,0,0], 0);
+  gimp_selection_load($selection);
+  $drawable->bump_map($cleangrid, 135, 45, 3, 0, 0, 0, 0, 1, 0, 0);
+  $image->selection_all;
 
 # Clean up stuff
 
-       $img->remove_layer($cleangrid);
-       $img->remove_layer($gridlayer);
-       gimp_selection_load($selection);
-       if ($selection_flag ==1) {
-               $img->selection_none;
-               }
-        Gimp::Context->pop();
-        eval { $img->undo_group_end };
-       return ();
+  $image->remove_layer($cleangrid);
+  $image->remove_layer($gridlayer);
+  gimp_selection_load($selection);
+  if ($selection_flag ==1) {
+    $image->selection_none;
+  }
+  Gimp::Context->pop();
+  $image->undo_group_end;
+  return;
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+xach_blocks - Xach's Blocks o' Fun
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Map/Xach Blocks...
+
+=head1 DESCRIPTION
+
+Turn your picture into something that resembles a certain trademarked
+building block creation.
+
+=head1 PARAMETERS
+
+  [PF_SLIDER, "blocksize", "The size of the blocks", 10, [2, 255, 1]],
+  [PF_SLIDER, "knobfactor", "The size of your knob", 40, [10, 100, 5]],
+
+=head1 IMAGE TYPES
+
+*
+
+=head1 HISTORY
+
+This is (hopefully) a demonstration of how pathetically easy it is to script
+a neato effect you've come up with.  This lil' effect was created by xach,
+and translated by sjburges (me).  You can consider it released under the GPL
+or Artistic liscence, whichever makes you happier.
+
+ <Xach> sjburges: 1. pixelize the photo  2. in a new white layer, render a grid
+           at the same resolution as the pixelize, then blur it. threshold the
+           grid until you get a roundish blob in the center of each square (you
+           may need to repeat a few times).
+ <Xach> sjburges: meanwhile, back at the pixelized image, bumpmap it with
+           itself and a depth of about 5. do this twice. then bumpmap it with
+           the round blobby layer.
+ <Xach> then create a new, clean grid, and bumpmap the pixelized layer with it
+
+ (To get a decent blobby grid)
+ <Xach> <Xach> render a grid at 10x10, gaussian blur at 7, then set levels to
+           196 1.00 234
+
+ Revision - 1.1:       added a gimp_displays_flush() for 1.0.x users
+                       stopped deleting the layers after removal - it was
+                   causing bad things to happen with refcounts.  I hope
+                   gimp is cleaning up this memory on its own...
+            1.2:   Fixed buggy selection handling - oops ;)
+            1.3:   Added undo capability by Marc Lehman <pcg goof com>
+            1.4:   Marc Lehman <pcg goof com>, changed function name
+            1.5:   Seth Burgess <sjburges gimp org> added my email, put it
+                   in a directory more suitable than the lame "Misc"
+            1.6:   Seth Burgess <sjburges gimp org> use Context
+
+=head1 AUTHOR
+
+Seth Burgess <sjburges gimp org>
+
+=head1 DATE
+
+2-15-98
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/xachshadow b/examples/xachshadow
index 0aed93b..b37fbb2 100755
--- a/examples/xachshadow
+++ b/examples/xachshadow
@@ -1,89 +1,106 @@
 #!/usr/bin/perl
 
-# by Seth Burgess <sjburges gimp org>
-
-#[Xach] start off with an image, then pixelize it
-#[Xach] then add alpha->add layer mask                                   [20:21]
-#[Xach] render a checkerboard into the layer mask
-#[Xach] duplicate the image. fill the original with black, then blur the layer
-#           mask (i used 30% of pixelize size) and offset it by some value (i
-#           chose 20% of the pixelize size)
-#[Xach] duplicate the duplicate, remove the layer mask, move it below everything
-#[Xach] then add a new white layer on top, set the mode to multiply, and render
-#           a grid into it at pixelize size
-#[Xach] that's a bit roundabout, but it's also in the xcf
-#
-# Because the way xach does it is a bit awkward, I'm switching it around a bit
-# and working from the bottom up..
-
-# Revision 1.1: Marc Lehman <pcg goof com> added undo capability
-# Revision 1.2: Marc Lehman <pcg goof com>, changed function name
-# Revision 1.3: Seth Burgess <sjburges gimp org>, changed location and
-#                 added my email address
-# Revision 1.4: Seth Burgess <sjburges gimp org> removed deprecated stuff
-#
-
 use Gimp;
 use Gimp::Fu;
 
-register "xach_shadows",
-         "Xach's Shadows o' Fun",
-         "Screen of 50% of your drawing into a dropshadowed layer.",
-         "Seth Burgess",
-         "Seth Burgess <sjburges\ gimp org>",
-         "2-15-98",
-         N_"<Image>/Filters/Map/Xach Shadows...",
-         "RGB*, GRAY*",
-         [
-          [PF_SLIDER,  "block_size",   "The size of the blocks...", 10, [4, 255, 1]],
-         ],
-         sub {
-        my($img,$drawable,$blocksize) = _;
-        die "Must have layer selected\n" unless $drawable->is_layer;
-        $drawable->become('Gimp::Layer');
-        $img->undo_group_start;
-        Gimp::Context->push();
+podregister {
+  die "Must have layer selected\n" unless $drawable->is_layer;
+  $drawable->become('Gimp::Layer');
+  $image->undo_group_start;
+  Gimp::Context->push();
 #      $selection_flag = 0;
-       $drawable->add_alpha unless $drawable->has_alpha;
-        Gimp::Context->set_foreground('white');
-        Gimp::Context->set_background('black');
+  $drawable->add_alpha unless $drawable->has_alpha;
+  Gimp::Context->set_foreground('white');
+  Gimp::Context->set_background('black');
 # This only can be applied to an entire image right now..
-#      $selection = $img->selection_save;
-    $img->selection_all;
+#      $selection = $image->selection_save;
+$image->selection_all;
 # Now the fun begins :)
-       $drawable->pixelize($blocksize);
-       $shadowlayer = $drawable->layer_copy(0);
-       $img->insert_layer($shadowlayer,0,0);
-       $checkmask = $shadowlayer->create_mask(ADD_WHITE_MASK);
-       $shadowlayer->add_mask($checkmask);
-       $img->checkerboard($checkmask, 0, $blocksize);
-
-       $frontlayer = $shadowlayer->layer_copy(0);
-       $img->insert_layer($frontlayer,0,0);
-       Gimp::Context->set_background([0,0,0]);
-       $shadowlayer->fill(BACKGROUND_FILL);
-       $checkmask->gauss_iir(0.3*$blocksize, 1, 1);
-       $checkmask->offset (1, 0, 0.2*$blocksize, 0.2*$blocksize);
-
-       $gridlayer = $img->layer_new($img->width, $img->height, RGBA_IMAGE, "Grid 1", 100, 0);
-       $img->insert_layer($gridlayer,0,0);
-       $img->selection_all;
-       $gridlayer->edit_clear;
-       Gimp::Context->set_background([255,255,255]);
-       $gridlayer->edit_fill(BACKGROUND_FILL);
-       $gridlayer->grid((1, $blocksize, 0, [0,0,0], 255) x 3);
-
-       $gridlayer->set_mode(3);
+  $drawable->pixelize($blocksize);
+  $shadowlayer = $drawable->layer_copy(0);
+  $image->insert_layer($shadowlayer,0,0);
+  $checkmask = $shadowlayer->create_mask(ADD_WHITE_MASK);
+  $shadowlayer->add_mask($checkmask);
+  $image->checkerboard($checkmask, 0, $blocksize);
+
+  $frontlayer = $shadowlayer->layer_copy(0);
+  $image->insert_layer($frontlayer,0,0);
+  Gimp::Context->set_background([0,0,0]);
+  $shadowlayer->fill(BACKGROUND_FILL);
+  $checkmask->gauss_iir(0.3*$blocksize, 1, 1);
+  $checkmask->offset (1, 0, 0.2*$blocksize, 0.2*$blocksize);
+
+  $gridlayer = $image->layer_new($image->width, $image->height, RGBA_IMAGE, "Grid 1", 100, 0);
+  $image->insert_layer($gridlayer,0,0);
+  $image->selection_all;
+  $gridlayer->edit_clear;
+  Gimp::Context->set_background([255,255,255]);
+  $gridlayer->edit_fill(BACKGROUND_FILL);
+  $gridlayer->grid((1, $blocksize, 0, [0,0,0], 255) x 3);
+
+  $gridlayer->set_mode(3);
 # Clean up stuff
-        Gimp::Context->pop;
-        $img->selection_none;
-        $img->undo_group_end;
-       return;
+  Gimp::Context->pop;
+  $image->selection_none;
+  $image->undo_group_end;
+  return;
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+xach_shadows - Xach's Shadows o' Fun
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Map/Xach Shadows...
+
+=head1 DESCRIPTION
+
+Screen of 50% of your drawing into a dropshadowed layer.
+
+=head1 PARAMETERS
+
+  [PF_SLIDER,  "blocksize",    "The size of the blocks...", 10, [4, 255, 1]],
+
+=head1 IMAGE TYPES
+
+RGB*, GRAY*
+
+=head1 HISTORY
+
+  [Xach] start off with an image, then pixelize it
+  [Xach] then add alpha->add layer mask                                   [20:21]
+  [Xach] render a checkerboard into the layer mask
+  [Xach] duplicate the image. fill the original with black, then blur the layer
+             mask (i used 30% of pixelize size) and offset it by some value (i
+             chose 20% of the pixelize size)
+  [Xach] duplicate the duplicate, remove the layer mask, move it below everything
+  [Xach] then add a new white layer on top, set the mode to multiply, and render
+             a grid into it at pixelize size
+  [Xach] that's a bit roundabout, but it's also in the xcf
+
+Because the way xach does it is a bit awkward, I'm switching it around a bit
+and working from the bottom up..
+
+  Revision 1.1: Marc Lehman <pcg goof com> added undo capability
+  Revision 1.2: Marc Lehman <pcg goof com>, changed function name
+  Revision 1.3: Seth Burgess <sjburges gimp org>, changed location and
+                  added my email address
+  Revision 1.4: Seth Burgess <sjburges gimp org> removed deprecated stuff
+
+=head1 AUTHOR
+
+Seth Burgess
+
+=head1 DATE
+
+2-15-98
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
+Seth Burgess <sjburges gimp org>
+
 Distributed under the same terms as Gimp-Perl.
diff --git a/examples/xachvision b/examples/xachvision
index 1fdb7fb..e4a4a39 100755
--- a/examples/xachvision
+++ b/examples/xachvision
@@ -1,62 +1,67 @@
 #!/usr/bin/perl
 
-# Once again, an effect of Xach's
-# Created by Seth Burgess <sjburges gimp org>
-
-use Gimp qw(:auto __ N_);
+use Gimp;
 use Gimp::Fu;
 
-register "xachvision",
-         "Xach Surveillance Camera/XachVision",
-         "This makes an interlaced-looking machine vision type thing.",
-         "Seth Burgess",
-         "Seth Burgess <sjburges\ gimp org>",
-         "2000-11-25",
-         N_"<Image>/Filters/Noise/Xach Vision...",
-         "RGB*, GRAY*",
-         [
-          [PF_COLOR,   "color",        "What Color to see the world in", [0, 255, 0]],
-         [PF_SLIDER,   "added_noise", "How much noise to add", 25, [0,255,5]]
-         ],
-         sub {
-   my($img,$drawable,$color,$amt) = _;
-
-  eval { $img->undo_group_start };
-        Gimp::Context->push();
-
-       $midlayer = $drawable->gimp_layer_copy(1);
-       $img->insert_layer($midlayer, 0, 0);
-
-       $toplayer = $drawable->gimp_layer_copy(1);
-       $img->insert_layer($toplayer, 0, 0);
-
-       Gimp::Context->set_background($color);
-       $toplayer->edit_fill(BACKGROUND_FILL);
-       $toplayer->set_mode(COLOR_MODE);
-
-       Gimp::Context->set_background([0,0,0]);
-       $drawable->edit_fill(BACKGROUND_FILL);
-
-       $amt = $amt/255;
-       $midlayer->plug_in_noisify(1,$amt, $amt, $amt, $amt);
-       $midmask = $midlayer->create_mask(0);
-       $midlayer->add_mask($midmask);
-       $midmask->plug_in_grid(1,3,0,[0,0,0],255,
-                              1,$img->height * 3,0,[0,0,0],255,
-                              0,0,0,[0,0,0],255 );
-       $midmask->plug_in_gauss_iir(1.01, 1, 1);
-
-       Gimp::Context->pop();
-  eval { $img->undo_group_end };
-       gimp_displays_flush();
-       return();
+podregister {
+  $image->undo_group_start;
+  Gimp::Context->push();
+  $midlayer = $drawable->gimp_layer_copy(1);
+  $image->insert_layer($midlayer, 0, 0);
+  $toplayer = $drawable->gimp_layer_copy(1);
+  $image->insert_layer($toplayer, 0, 0);
+  Gimp::Context->set_background($color);
+  $toplayer->edit_fill(BACKGROUND_FILL);
+  $toplayer->set_mode(COLOR_MODE);
+  Gimp::Context->set_background([0,0,0]);
+  $drawable->edit_fill(BACKGROUND_FILL);
+  $amt = $amt/255;
+  $midlayer->noisify(1,$amt, $amt, $amt, $amt);
+  $midmask = $midlayer->create_mask(0);
+  $midlayer->add_mask($midmask);
+  $midmask->grid(
+    1,3,0,[0,0,0],255, 1,$image->height * 3,0,[0,0,0],255, 0,0,0,[0,0,0],255
+  );
+  $midmask->gauss_iir(1.01, 1, 1);
+  Gimp::Context->pop();
+  $image->undo_group_end;
+  return;
 };
 
 exit main;
+__END__
+
+=head1 NAME
+
+xachvision - Xach Surveillance Camera/XachVision
+
+=head1 SYNOPSIS
+
+<Image>/Filters/Noise/Xach Vision...
+
+=head1 DESCRIPTION
+
+This makes an interlaced-looking machine vision type thing.
+
+Once again, an effect of Xach's.
+
+=head1 PARAMETERS
+
+  [PF_COLOR,   "color",        "What Color to see the world in", [0, 255, 0]],
+  [PF_SLIDER,   "amt", "How much noise to add", 25, [0,255,5]]
+
+=head1 IMAGE TYPES
+
+RGB*, GRAY*
+
+=head1 AUTHOR
+
+Seth Burgess <sjburges gimp org>
+
+=head1 DATE
+
+2000-11-25
 
 =head1 LICENSE
 
-Copyright Seth Burgess.
 Distributed under the same terms as Gimp-Perl.
-
-=cut
diff --git a/examples/yinyang b/examples/yinyang
index 293d2af..6d46cb6 100755
--- a/examples/yinyang
+++ b/examples/yinyang
@@ -1,158 +1,107 @@
 #!/usr/bin/perl
 
-# Gimp yin/yang symbol plugin for The Gimp. Extract documentation by running
-# "perldoc" on this plugin, or by using the pod utilities (pod2man, pod2html,
-# etc.)
-#
-# Written by Aaron Sherman, (c) 1998
-#   04-22-2001, peter kirchgessner net: fix problems with functions
-#               that changed number of arguments
-#   2004-03-29, dov imagic weizmann ac il: fixed for Gimp-2.0
-
-use Gimp qw(:auto __ N_);
+use Gimp;
 use Gimp::Fu;
 #$Gimp::verbose = 1;
 #Gimp::set_trace(TRACE_ALL);
 
-# Main function. Takes width, height, do_eyes (toggle), eye_images (toggle),
-# white_eye_image (filename) and black_eye_image (filename).
-# Creates a stand-alone image with a yin-yang symbol in black and white.
-sub yinyang {
-    my $width = shift;
-    my $height = shift;
-    my $do_eyes = shift;
-    my $eye_images = shift;
-    my $white_eye_image = shift;
-    my $black_eye_image = shift;
-    my $aa = shift;
-
-    # Create new image
-    my $img = gimp_image_new($width,$height,0);
-    my $layer = gimp_layer_new($img,$width,$height,1,"Yin/Yang",100,0);
-    gimp_image_insert_layer($img,$layer,0,0);
-    gimp_image_set_active_layer($img,$layer);
-    my $draw = gimp_image_get_active_drawable($img);
-    gimp_context_push();
-    gimp_context_set_foreground([0,0,0]);
-    gimp_selection_all($img);
-    gimp_edit_bucket_fill($draw,0,0,100,0,0,0,0);
-
-    # Create the yin-yang shape
-    #gimp_selection_invert($img);
-    gimp_selection_none($img);
-    gimp_image_select_rectangle($img,0,0,0,$width/2,$height);
-    gimp_context_set_antialias($aa);
-    gimp_image_select_ellipse($img,0,$width/2-$width/4,0,$width/2,
-                       int($height/2));
-    gimp_image_select_ellipse($img,0,$width/2-$width/4,$height/2,
-                       $width/2, $height/2);
-    gimp_context_set_foreground([255,255,255]);
-    gimp_edit_bucket_fill($draw,0,0,100,0,0,0,0);
-
-    # Cut away all but the central circle
-    gimp_image_select_ellipse($img,2,0,0,$width,$height);
-    gimp_selection_invert($img);
-    gimp_edit_clear($draw);
-
-    # Create the "eyes"
-    if ($do_eyes) {
-       my $x1 = $width/2-$width/16;
-       my $y1 = $height/2-$height/4-$height/16;
-       my $x2 = $x1;
-       my $y2 = $height/2+$height/4-$height/16;
-       my $eyewidth = $width/8;
-       my $eyeheight = $height/8;
-       insert_eye($img,$eye_images,$white_eye_image,[0,0,0],$x1,$y1,$eyewidth,
-                  $eyeheight,$draw,$aa);
-       insert_eye($img,$eye_images,$black_eye_image,[255,255,255],$x2,$y2,
-                  $eyewidth,$eyeheight,$draw,$aa);
-    }
-
-    # Finish up
-    gimp_context_pop();
-    gimp_selection_none($img);
-    gimp_display_new($img);
-
-    $img;
-}
+my @BUCKET_ARGS = (FG_BUCKET_FILL,NORMAL_MODE,100,0,0,0,0);
+
+podregister {
+  # Create new image
+  my $img = Gimp::Image->new($width,$height,0);
+  Gimp::Display->new($img);
+  my $layer = $img->layer_new($width,$height,1,"Yin/Yang",100,0);
+  $img->insert_layer($layer,0,0);
+  $img->set_active_layer($layer);
+  my $draw = $img->get_active_drawable;
+  Gimp::Context->push();
+  Gimp::Context->set_foreground([0,0,0]);
+  $img->selection_all;
+  $draw->edit_bucket_fill(@BUCKET_ARGS);
+  # Create the yin-yang shape
+  $img->select_rectangle(CHANNEL_OP_REPLACE,0,0,$width/2,$height);
+  Gimp::Context->set_antialias($aa);
+  $img->select_ellipse(
+    CHANNEL_OP_ADD,     $width/4,0,        $width/2,$height/2
+  );
+  $img->select_ellipse(
+    CHANNEL_OP_SUBTRACT,$width/4,$height/2,$width/2,$height/2
+  );
+  Gimp::Context->set_foreground([255,255,255]);
+  $draw->edit_bucket_fill(@BUCKET_ARGS);
+  # Cut away all but the central circle
+  $img->image_select_ellipse(CHANNEL_OP_REPLACE,0,0,$width,$height);
+  $img->selection_invert;
+  $draw->edit_clear;
+
+  # Create the "eyes"
+  if ($do_eyes) {
+    my $x1 = $width/2-$width/16;
+    my $y1 = $height/2-$height/4-$height/16;
+    my $x2 = $x1;
+    my $y2 = $height/2+$height/4-$height/16;
+    my $eyewidth = $width/8;
+    my $eyeheight = $height/8;
+    insert_eye($img,$eye_images,$white_eye_image,[0,0,0],$x1,$y1,$eyewidth,
+              $eyeheight,$draw,$aa);
+    insert_eye($img,$eye_images,$black_eye_image,[255,255,255],$x2,$y2,
+              $eyewidth,$eyeheight,$draw,$aa);
+  }
+
+  # Finish up
+  Gimp::Context->pop();
+  $img->selection_none;
+
+  $img;
+};
 
 # This subroutine inserts an "eye" (a dot in the center of the cicular
 # part of each of the halves of the yin-yang). The eye is either
 # a solid dot of the opposite color from that half of the yin-yang or
 # an image, which is loaded and scaled to fit.
 sub insert_eye {
-    my $img = shift;
-    my $do_image = shift;
-    my $file = shift;
-    my $color = shift;
-    my $x = shift;
-    my $y = shift;
-    my $width = shift;
-    my $height = shift;
-    my $draw = shift;
-    my $aa = shift;
-
-    gimp_image_select_ellipse($img,2,$x,$y,$width,$height);
-    gimp_context_set_foreground($color);
-    if ($do_image) {
-       my $eye = gimp_file_load($file,$file);
-       gimp_image_scale($eye,$width,$height);
-       gimp_selection_all($eye);
-       my $eyedraw = gimp_image_get_active_drawable($eye);
-       gimp_edit_copy($eyedraw);
-       my $float = gimp_edit_paste($draw,1);
-       gimp_floating_sel_anchor($float);
-       gimp_image_delete($eye);
-    } else {
-       gimp_edit_bucket_fill($draw,0,0,100,0,0,0,0);
-    }
-}
-
-# Register with The Gimp
-register("yinyang",
-         "Render a stand-alone Yin/Yang image",
-       "Renders a black-and-white Yin/Yang symbol optionally
-       with \"eyes\" that may optionally be images.",
-       "Aaron Sherman",
-       "(c) 1998, Aaron Sherman",
-       "1999b",
-       N_"<Image>/File/Create/Logos/Yin-Yang...",
-       undef,
-       [
-               [PF_INT32, "width", "Width", 256],
-               [PF_INT32, "height", "Height", 256],
-               [PF_TOGGLE, "insert_eyes", "", 1],
-               [PF_TOGGLE, "eyes_are_images", "", 0],
-               [PF_STRING, "top_eye_filename", "eye 1", ""],
-               [PF_STRING, "bottom_eye_filename", "eye 2", ""],
-               [PF_TOGGLE, "anti_aliasing", "", 1]
-       ],
-       \&yinyang);
+  my ($img, $do_image, $file, $color, $x, $y, $width, $height, $draw, $aa) = @_;
+  $img->select_ellipse(CHANNEL_OP_REPLACE,$x,$y,$width,$height);
+  Gimp::Context->set_foreground($color);
+  if ($do_image) {
+    my $eye = Gimp->file_load($file,$file);
+    $eye->scale($width,$height);
+    $eye->selection_all;
+    my $eyedraw = $eye->get_active_drawable;
+    $eyedraw->edit_copy;
+    my $float = $draw->edit_paste(1);
+    $float->floating_sel_anchor();
+    $eye->delete;
+  } else {
+    $draw->edit_bucket_fill(@BUCKET_ARGS);
+  }
+};
 
 exit main;
-
 __END__
 
 =head1 NAME
 
-yinyang
+yinyang - Render a stand-alone Yin/Yang image
 
 =head1 SYNOPSIS
 
-yinyang
+<Image>/File/Create/Logos/Yin-Yang...
 
 =head1 DESCRIPTION
 
-B<yinyang> is a B<Gimp> plugin. It generates a Yin/Yang symbol, which
+Renders a black-and-white Yin/Yang symbol optionally with "eyes" that
+may optionally be images.
+
+B<yinyang> is a L<Gimp> plugin. It generates a Yin/Yang symbol, which
 is a Chinese symbol of duality. It takes as parameters (provided by the
 Gimp user interface) the width and height of the resulting image;
-a toggle to indicate if "eyes" should be inserted (see I<EYES>);
+a toggle to indicate if "eyes" should be inserted;
 a toggle to indicate if the eyes should be images that are
 loaded separately; the two filenames for the eyes and a toggle to
 indicate if anti-aliasing should be used.
 
-=head1 EYES
-
 The "eyes" are normally either black or white dots in the middle of the
 circular regions of the two halves of the Yin and Yang. If you like
 you can load these eyes from another image.
@@ -175,23 +124,38 @@ the sun, etc.)
 =item *
 
 Map two opposed or dualistic images. One into the black region, one
-into the white. For a really cool look, make the eyes show a peice of
+into the white. For a really cool look, make the eyes show a piece of
 the other image.
 
-=item *
+=back
 
-Dip in 1 tbsp chunky peanut butter, 1 tbsp rice vinegar, 1 tbsp
-lime juice, 1 dash black pepper. Eat to taste.
+=head1 PARAMETERS
 
-=back
+  [PF_INT32, "width", "Width", 256],
+  [PF_INT32, "height", "Height", 256],
+  [PF_TOGGLE, 'do_eyes', "Insert eyes", 1],
+  [PF_TOGGLE, 'eye_images', "Eyes are images?", 0],
+  [PF_FILE, 'white_eye_image', "Top eye filename", ""],
+  [PF_FILE, 'black_eye_image', "Bottom eye filename", ""],
+  [PF_TOGGLE, 'aa', "Anti-aliasing", 1]
+
+=head1 HISTORY
+
+ Written by Aaron Sherman, (c) 1998
+   04-22-2001, peter kirchgessner net: fix problems with functions
+               that changed number of arguments
+   2004-03-29, dov imagic weizmann ac il: fixed for Gimp-2.0
 
 =head1 AUTHOR
 
 Written by Aaron Sherman <ajs ajs com>, (c) 1998.
 
+=head1 DATE
+
+1999b
+
 =head1 LICENSE
 
-Copyright Aaron Sherman.
-Distributed under unknown license terms.
+(c) 1998, Aaron Sherman
 
-=cut
+Distributed under unknown license terms.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]