#!/usr/bin/perl use Gimp; use Gimp::Fu; podregister { die "Must select layer.\n" unless $drawable->is_layer; $drawable->become('Gimp::Layer'); my $image2 = $drawable2->get_image; my ($w1, $h1) = ($drawable->width, $drawable->height); my ($w2, $h2) = ($drawable2->width, $drawable2->height); my $hmax = $h1 > $h2 ? $h1 : $h2; # new height is maximum height of the images $image->undo_group_start; # Create an undo group # Resize the drawable layer to make room for the image $image->resize($w1+$w2, $hmax, 0, ($hmax-$h1)/2); $drawable->resize($w1+$w2, $hmax, 0, ($hmax-$h1)/2); # Copy $drawable2 and paste it into the new space of $drawable1 $image2->selection_all; # select all of image2 $drawable2->edit_copy; $image2->selection_none; # make a selection in image 1 where $drawable2 is to be pasted $image->select_rectangle(CHANNEL_OP_ADD, $w1, ($hmax-$h2)/2, $w2, $h2); $drawable->edit_paste(0)->floating_sel_anchor; # paste and then anchor it $image->undo_group_end; # Close the undo group return; }; exit main; __END__ =head1 NAME horiz_cat - Horizontal concat =head1 SYNOPSIS /Filters/Tutorial/Horizontal Concat =head1 DESCRIPTION Horizontal concatenation of images. =head1 PARAMETERS [PF_DRAWABLE, "drawable2", "Drawable to concatenate", undef], =head1 IMAGE TYPES * =head1 AUTHOR Dov Grobgeld =head1 DATE 2004-03-27 =head1 LICENSE Dov Grobgeld