*** empty log message ***

This commit is contained in:
Marc Lehmann 1999-12-25 03:43:14 +00:00
parent 86a79906e3
commit c3f8c2ae33
19 changed files with 6 additions and 1295 deletions

View File

@ -1,3 +1,9 @@
Sat Dec 25 04:14:03 CET 1999 Marc Lehmann <pcg@goof.com>
* gimp1_1_splash.ppm: Crappy it is, but at least temporary! Feel
free to enhance or replace, but please do not revert it back to
the previous version ;)
1999-12-24 Shirasaki Yasuhiro <yasuhiro@gnome.gr.jp>
* plug-ins/common/exchange.c
@ -99,7 +105,6 @@ Mon Dec 20 18:42:51 EST 1999 Gregory McLean <gregm@comstar.net>
* gimp.spec: Slightly more upto date spec file. Work in progress.
>>>>>>> 1.1949
Mon Dec 20 17:58:59 GMT 1999 Adam D. Moss <adam@gimp.org>
* app/edit_selection.c: Remove old movement code and unused

Binary file not shown.

View File

@ -1,114 +0,0 @@
#!/usr/bin/perl
use Gimp qw( :auto N_ );
use Gimp::Fu;
# alpha2color.pl
# by Seth Burgess <sjburges@gimp.org>
# Version 0.02
# Oct 16th, 1998
#
# This script simply changes the current alpha channel to a given color
# instead. I'm writing it primarily for use with the displace plugin,
# but I imagine it'll have other uses.
# TODO: Selection is currently ignored. It'd be better if it remembered
# what the previous selection was.
# Also, it needs to find a happier home than in the Filters/Misc menu.
# Gimp::set_trace(TRACE_ALL);
# Revision History
# v0.02 - fixed up @color (should be $color) and undef; (should be return();)
sub save_layers_state ($) {
$img = shift;
my @layers = $img->get_layers;
$i = 0;
foreach $lay (@layers) {
if ($lay->get_visible){
$arr[$i] = 1;
}
else {
$arr[$i] = 0;
}
$i++;
}
return @arr;
}
sub restore_layers_state($@) {
$img = shift;
@arr = @_;
my @layers = $img->get_layers;
$i = 0;
foreach $lay (@layers) {
$lay->set_visible($arr[$i]);
$i++;
}
}
sub alpha2col {
my ($img, $drawable, $color) = @_;
my $oldcolor = gimp_palette_get_background();
my @layers = gimp_image_get_layers($img);
# if there's not enough layers, abort.
if ($#layers < 0) {
gimp_message("You need at least 1 layer to perform alpha2color!");
print "Only ", scalar(@layers), " layers found!(", $layers[0],")\n";
return 0;
}
# Hide the bottom layer, so it doesn't get into the merge visible later.
@layer_visibilities = save_layers_state ($img);
# foreach $visible (@layer_visibilities) {
# print $visible, "\n";
# }
$target_layer = gimp_image_get_active_layer($img);
@offsets=$target_layer->offsets;
# print $target_layer, "\n";
foreach $eachlay (@layers) {
$eachlay->set_visible(0);
}
$target_layer->set_visible(1);
gimp_palette_set_background($color);
$newlay = $target_layer->copy(1);
$img->add_layer($newlay, 0);
$newlay->set_offsets(@offsets);
$target_layer->set_active_layer;
$img->selection_all;
$target_layer->edit_fill;
$img->selection_none;
$foreground = gimp_image_merge_visible_layers($img,0);
restore_layers_state($img, @layer_visibilities);
gimp_palette_set_background($oldcolor);
gimp_displays_flush();
return();
}
register
"plug_in_alpha2color",
"Alpha 2 Color",
"Change the current alpha to a selected color.",
"Seth Burgess",
"Seth Burgess<sjburges\@gimp.org>",
"2-15-98",
N_"<Image>/Image/Colors/Alpha2Color",
"RGBA",
[
[PF_COLOR, "color", "Color for current alpha", [127,127,127]]
],
\&alpha2col;
exit main;

View File

@ -1,109 +0,0 @@
#!/usr/bin/perl
# Blow In/Out
# John Pitney
use Gimp 1.06;
use Gimp::Fu;
# print "hello there\n";
# Gimp::set_trace(TRACE_CALL);
sub blowinout {
my ($img, $drawable, $angle, $nsteps, $distance, $inmode, $arithmode) = @_;
# bail out if $drawable isn't a layer
# print "Starting\n";
if( gimp_selection_is_empty($img) == 0) { return };
# if ($nsteps == 0) return;
eval { $img->undo_push_group_start };
# save the background color for later restoration
my $oldbg = gimp_palette_get_background();
#get the drawable dimensions
my $xsize = gimp_drawable_width($drawable);
my $ysize = gimp_drawable_height($drawable);
# Set background color to 128, for clearing dm
gimp_palette_set_background([128,128,128]);
# Create a grayscale workspace image for displacement map
my $dm = gimp_image_new($xsize, $ysize, 1);
eval { $dm->undo_push_group_start };
# It needs to have 2 layers
my $dmlayer = gimp_layer_new($dm, $xsize, $ysize, GRAY_IMAGE, "newlayer",
100, NORMAL_MODE);
gimp_image_add_layer($dm, $dmlayer, 0);
# Create the layers, one-by-one
my $i = 1;
my $xdist = ($arithmode) ?
$i * $distance / $nsteps * -cos($angle * 3.14159 / 180) :
$distance ** ($i/$nsteps) * -cos($angle * 3.14159 / 180);
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(1, $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_add_layer($img, $drawable, -1);
plug_in_displace(1, $img, $drawable, $xdist, $ydist, 1, 1, $dmlayer,
$dmlayer, 1);
if ( $inmode == 1 )
{
gimp_image_lower_layer($img, $drawable);
};
for ( $i = 2; $i <= $nsteps; $i++ ) {
$xdist = ($arithmode) ?
$i * $distance / $nsteps * -cos($angle * 3.14159 / 180) :
$distance ** ($i/$nsteps) * -cos($angle * 3.14159 / 180);
$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(1, $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_add_layer($img, $drawable, -1);
plug_in_displace(1, $img, $drawable, $xdist, $ydist, 1, 1, $dmlayer,
$dmlayer, 1);
if ( $inmode == 1 )
{
gimp_image_lower_layer($img, $drawable);
};
}
eval { $dm->undo_push_group_end };
# gimp_image_remove_layer($dm, $dmlayer);
# gimp_image_delete ($dm);
gimp_palette_set_background($oldbg);
eval { $img->undo_push_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 <pitney\@uiuc.edu>",
"1999-03-15",
N_"<Image>/Filters/Distorts/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],
# What I really need here are radio buttons! Maybe they even exist...
# You wanted them...
[PF_RADIO, "direction", "Blow direction", 0, [In => 1, Out => 0]],
[PF_RADIO, "series", "Kind of series", 1, [Arithmetic => 1, Geometric => 0]]
],
[],
\&blowinout;
exit main;

View File

@ -1,89 +0,0 @@
#!/usr/bin/perl
#BEGIN {$^W=1};
use Gimp::Feature qw(pdl);
use Gimp;
use Gimp::Fu;
use PDL::LiteF;
# Gimp::set_trace(TRACE_ALL);
register "border_average",
"calculates the average border colour",
"calulcates the average border colour",
"Marc Lehmann",
"Marc Lehmann",
"0.2.2",
N_"<Image>/Filters/Misc/Border Average",
"RGB",
[
[PF_INT32, "thickness", "Border size to take in count", 10],
[PF_INT32, "bucket_exponent", "Bits for bucket size (default=4: 16 Levels)", 4],
],
[
[PF_COLOUR, "border_colour", "Average Border Colour"],
],
sub { # es folgt das eigentliche Skript...
my($image,$drawable,$thickness,$exponent)=@_;
($empty,@bounds)=$drawable->mask_bounds();
return () if $empty;
my $rexpo = 8-$exponent;
my $bucket_num = 1<<$exponent;
# ideally, we'd use a three-dimensional array, but index3 isn't
# implemented yet, so we do it flat (Still its nicer than C).
my $cube = zeroes long,$bucket_num**3;
my $width = $drawable->width;
my $height = $drawable->height;
$thickness=$width if $thickness>$width;
$thickness=$height if $thickness>$height;
local *add_new_colour = sub($) {
# linearize and quantize pixels (same as original, slightly wrong)
my $pixels = $_[0] >> $rexpo;
# intead of something like
# $cube->index3d($pixels)++;
# we have to first flatten the rgb triples into indexes and use index instead
my $flatten = long([$bucket_num**2,$bucket_num**1,$bucket_num**0]);
my $subcube = $cube->index(inner($pixels,$flatten)->clump(2));
$subcube++;
};
Gimp->progress_init("Border Average", 0);
add_new_colour ($drawable->pixel_rgn ($bounds[0] ,$bounds[1] , $thickness,$height, 0, 0)
->get_rect(0,0, $thickness,$height));
add_new_colour ($drawable->pixel_rgn ($bounds[2]-$thickness,$bounds[1] , $thickness,$height, 0, 0)
->get_rect(0,0, $thickness,$height));
add_new_colour ($drawable->pixel_rgn ($bounds[0] ,$bounds[1] , $width ,$thickness, 0, 0)
->get_rect(0,0, $width, $thickness));
add_new_colour ($drawable->pixel_rgn ($bounds[0] ,$bounds[3]-$thickness, $width ,$thickness, 0, 0)
->get_rect(0,0, $width, $thickness));
# now find the colour
my $max = $cube->maximum_ind;
my $b = $max % $bucket_num << $rexpo;
my $g = ($max >>= $exponent) % $bucket_num << $rexpo;
my $r = ($max >>= $exponent) % $bucket_num << $rexpo;
if ($Gimp::Fu::run_mode != RUN_NONINTERACTIVE)
{
my $layer = new Layer ($image, width $image, height $image, RGB_IMAGE, "bordercolour", 100, NORMAL_MODE);
add_layer $image $layer,0;
Palette->set_background([$r,$g,$b]);
$layer->edit_fill;
Gimp->message("Added layer with border colour ($r,$g,$b) on top");
}
[$r,$g,$b];
};
exit main;

View File

@ -1,77 +0,0 @@
#!/usr/bin/perl
use strict 'subs';
use Gimp;
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 = (
RGB, RGB_IMAGE,
GRAY, GRAY_IMAGE,
INDEXED, INDEXED_IMAGE,
);
register "plug_in_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_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)=@_;
Gimp::set_trace(-1);
$drawable->is_layer or die "this plug-in only works for layers";
$image->undo_push_group_start;
# make sure something is selected
$drawable->mask_bounds or $image->selection_all;
my ($x1,$y1,$x2,$y2)=($drawable->mask_bounds)[1..4];
my ($w,$h)=($x2-$x1,$y2-$y1);
my $sel = $image->selection_save;
$image->rect_select($x1,$y1,$w,$h,REPLACE,0,0);
$drawable->edit_copy;
$sel->selection_load;
$sel->remove_channel;
my $copy = new Image($w, $h, $image->base_type);
$copy->undo_disable;
my $draw = new Layer($copy, $w, $h,
$imagetype2layertype{$image->base_type},
"temporary layer", 100, NORMAL_MODE);
$copy->add_layer ($draw, 1);
$draw->edit_paste(0)->anchor;
$copy->convert_indexed ($dither, MAKE_PALETTE, $colours, 1, 1, "");
$draw->edit_copy;
$drawable->edit_paste(1)->anchor;
$copy->delete;
$image->undo_push_group_end;
();
};
exit main;

View File

@ -1,70 +0,0 @@
#!/usr/bin/perl
use Gimp;
use Gimp::Fu;
register "gimp_fu_example_script", # fill in a function name
"A non-working example of Gimp::Fu usage", # 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 Marc Lehmann", # and your copyright!
"19990316", # the date this script was written
N_"<Toolbox>/Xtns/Gimp::Fu Example", # the menu path
"RGB*, GRAYA", # image types to accept (RGB, RGAB amnd GRAYA)
[
# 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_INT , "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" , "#ff8000"],
[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" ],
],
sub {
# now do sth. useful with the garbage we got ;)
my($width,$height,$text,$font,$fg,$bg,$ignore,$brush,$pattern,$gradient)=@_;
# set tracing
Gimp::set_trace(TRACE_ALL);
my $img=new Image($width,$height,RGB);
# put an undo group around any modifications, so that
# they can be undone in one step. The eval shields against
# gimp-1.0, which does not have this function.
eval { $img->undo_push_group_start };
my $l=new Layer($img,$width,$height,RGB,"Background",100,NORMAL_MODE);
$l->add_layer(0);
# now a few syntax examples
Palette->set_foreground($fg) unless $ignore;
Palette->set_background($bg) unless $ignore;
fill $l BG_IMAGE_FILL;
$text_layer=$img->text_fontname(-1,10,10,$text,5,1,xlfd_size($font),$font);
gimp_palette_set_foreground("green");
# close the undo push group
eval { $img->undo_push_group_end };
$img; # return the image, or an empty list, i.e. ()
};
exit main;

View File

@ -1,32 +0,0 @@
#!/usr/bin/perl
# example for the gimp-perl-server (also called Net-Server)
use Gimp;
Gimp::on_lib {
print STDERR "$0: this script is not intended to be run from within the gimp!\n";
};
Gimp::on_net {
# simple benchmark ;)
$img=new Gimp::Image(600,300,RGB);
# the is the same as $img = new Image(600,300,RGB)
$bg=$img->layer_new(30,20,RGB_IMAGE,"Background",100,NORMAL_MODE);
$bg->add_layer(1);
new Gimp::Display($img);
for $i (0..255) {
Palette->set_background([$i,255-$i,$i]);
$bg->edit_fill;
Display->displays_flush ();
}
# Gimp::Net::server_quit; # kill the gimp-perl-server-extension (ugly name)
};
exit main;

View File

@ -1,37 +0,0 @@
#!/usr/bin/perl
# this extension shows some oo-like calls
# it's really easy
use Gimp;
# the extension that's called.
sub plug_in_example_oo {
my $img=new Image(300,200,RGB);
my $bg=new Layer($img,300,200,RGB_IMAGE,"Background",100,NORMAL_MODE);
Palette->set_background([200,200,100]);
$bg->fill(BG_IMAGE_FILL);
# Palette->set_background([200,100,200]);
# gimp_drawable_fill ($bg,BG_IMAGE_FILL);
$img->add_layer($bg,1);
new Display($img);
}
Gimp::on_run {
plug_in_example_oo;
};
Gimp::on_query {
gimp_install_procedure("plug_in_example_oo", "a test plug-in in perl",
"try it out", "Marc Lehmann", "Marc Lehmann", "1998-04-27",
N_"<Toolbox>/Xtns/Perl Example Plug-in", "*", PROC_EXTENSION,
[[PARAM_INT32, "run_mode", "Interactive, [non-interactive]"]], []);
};
exit main;

View File

@ -1,41 +0,0 @@
#!/usr/bin/perl
# Revision 1.0: Released it
# 1.1: Marc Lehman added undo capability! <pcg@goof.com>
# 1.2: Added my email, and put it in "Noise" where it belongs
# <sjburges@gimp.org>
use Gimp;
use Gimp::Fu;
register "feedback",
"Take an image and feed it back onto itself multiple times",
"This plug-in simulates video feedback. It makes for kinda a neat desktop if you're into that sort of thing",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"2-15-99",
N_"<Image>/Filters/Noise/Feedback",
"RGB, GRAY",
[
[PF_SLIDER, "offset", "the amount the frames will offset", 3, [0, 255, 1]],
[PF_SLIDER, "repeat", "the number of times to repeat the illusion", 3, [0, 100, 1]],
],
sub {
my($img,$drawable,$offset,$repeat)=@_;
eval { $img->undo_push_group_start };
for (; $repeat>0; $repeat--) {
$drawable = $img->flatten;
$copylayer = $drawable->copy(1);
$img->add_layer($copylayer,0);
$copylayer->scale($img->width - $offset, $img->height - $offset, 0);
}
$img->flatten;
eval { $img->undo_push_group_end };
return();
};
exit main;

View File

@ -1,151 +0,0 @@
#!/usr/bin/perl
# THIS IS OUTDATED AND WILL NOT RUN WITH CURRENT GIMP VERSIONS!
# this test-plugin will create a simple button, and does automatically
# save it as an indexed gif in /tmp/x.gif
# it works as plug-in as well as standalone!
# this script is old (its the first script ever written for gimp-perl)
# and I had no time to fix it yet.
use Gimp;
$blend1 = [0, 150, 255];
$blend2 = [0, 255, 208];
$black = "#000000";
$font = "Engraver";
# enable example mode... if disabled, it will write out some logos, and not
# wont' display anything.
$example = 1;
# set trace level to watch functions as they are executed
Gimp::set_trace(TRACE_NAME) if $example;
sub set_fg ($) { gimp_palette_set_foreground ($_[0]) };
sub set_bg ($) { gimp_palette_set_background ($_[0]) };
sub get_fg ($) { gimp_palette_get_foreground () };
sub get_bg ($) { gimp_palette_get_background () };
# shorthand function for drawing text
sub text($$$$$) {
my($img,$text,$border,$font,$size)=@_;
my $layer=gimp_text($img,-1,0,0,$text,$border,1,$size,PIXELS,"*",$font,"*","*","*","*");
if (wantarray()) {
($layer,gimp_text_get_extents($text,$size,PIXELS,"*",$font,"*","*","*","*"));
} else {
$layer;
}
}
# convert image to indexed
# and automatically save it as interlaced gif.
sub index_and_save($$) {
my($img,$path)=@_;
gimp_image_flatten($img);
gimp_convert_indexed_palette($img,1,0,32,"");
file_gif_save(RUN_NONINTERACTIVE,$img,-1,$path,$path,1,0,0,0) unless $example;
}
sub write_logo {
my($string,$active,$w,$h,$uc)=@_;
# create a new image
my $img=gimp_image_new($w,$h,RGB);
# and a layer for it
my $bg=gimp_layer_new($img,$w,$h,RGB_IMAGE,"Background",100,NORMAL_MODE);
gimp_image_add_layer($img,$bg,1);
set_fg($blend1);
set_bg($blend2);
# blend the background
gimp_blend($bg,FG_BG_HSV,NORMAL_MODE,LINEAR,100,0,
REPEAT_NONE,0,0,0,
0,0,$w*0.9,$h);
gimp_rect_select ($img,$w*0.92,0,$w,$h,REPLACE, 0, 0);
gimp_blend($bg,FG_BG_HSV,NORMAL_MODE,LINEAR,100,0,
REPEAT_NONE,0,0,0,
$w,0,$w*0.92,0);
gimp_selection_all($img);
set_fg($black);
my ($text,$tw,$th,$ta,$td) = text ($img, $string, 1, $font, $active ? $h*0.7 : $h*0.5);
gimp_layer_translate ($text,($w-$tw)/2,($h-$th+$td)/2);
my ($shadow) = gimp_layer_copy ($text, 0);
plug_in_gauss_rle ($text, 1, 1, 1) unless $active;
gimp_image_add_layer ($img,$shadow,1);
gimp_shear ($shadow,1,ORIENTATION_HORIZONTAL,-$th);
gimp_layer_scale ($shadow, $tw, $th*0.3, 1);
gimp_layer_translate ($shadow, $th*0.1, $th*0.3);
plug_in_gauss_rle ($shadow, 1, 1, 1);
gimp_hue_saturation($bg, ALL_HUES, 0, 0, $active ? 10 : -40);
plug_in_nova ($bg, $h*0.4, $h*0.5, '#f0a020', 5, 50) if $active;
plug_in_nova ($bg, $w-$h*0.4, $h*0.5, '#f0a020', 5, 50) if $active;
# add an under construction sign
if ($uc) {
set_fg($active ? "#a00000" : "#000000");
my ($uc,$tw,$th,$ta,$td) = text ($img, "u/c", 1, $font, $h*0.4);
gimp_rotate ($uc,1,0.2);
gimp_layer_translate ($uc,$w*0.84,($h-$th+$td)/2);
}
index_and_save ($img, "/root/www/src/marc/images/${string}_".($active ? "on" : "off").".gif");
gimp_display_new ($img) if $example;
gimp_image_delete($img) unless $example;
}
# the extension that's called.
sub extension_homepage_logo {
# if in example mode just draw one example logo.
if($example) {
push(@logos,[ "-Projects", 0, 480, 60 ]);
# push(@logos,[ "-Projects", 1, 480, 60 ]);
} else {
for $active (0, 1) {
for $string (qw(Projects -Background -Main)) {
push(@logos,[$string,$active,240,30]);
}
}
for $active (0, 1) {
for $string (qw(PGCC Judge -FreeISDN -Gimp -Destripe -Links -EGCS)) {
push(@logos,[$string,$active,240,20]);
}
}
}
gimp_progress_init ("rendering buttons...");
$numlogos = $#logos+1;
while($#logos>=0) {
gimp_progress_update (1-($#logos+1)/$numlogos);
my($string,$active,$w,$h)=@{pop(@logos)};
$uc=$string=~s/^-//;
write_logo($string,$active,$w,$h,$uc);
}
}
sub query {
gimp_install_procedure("extension_homepage_logo", "a test extension in perl",
"try it out", "Marc Lehmann", "Marc Lehmann", "1997-02-06",
N_"<Toolbox>/Xtns/Homepage-Logo", "*", PROC_EXTENSION,
[[PARAM_INT32, "run_mode", "Interactive, [non-interactive]"]], []);
}
sub net {
extension_homepage_logo;
}
exit main;

View File

@ -1,109 +0,0 @@
#!/usr/bin/perl
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
# Gimp::set_trace(TRACE_ALL);
sub prep {
my ($img, $drawable, $threshold, $growth, $index, $dither, $colors) = @_;
# Duplicate this image, and work on the duplicate for the rest of the
# procedure.
my $out = gimp_channel_ops_duplicate($img);
# @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);
# if there's not enough layers, abort.
if ($#layers <= 0) {
gimp_message(__"You need at least 2 layers to perform prep4gif");
return;
}
# 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_layer_set_visible($bottomlayer, 0);
gimp_layer_add_alpha($bottomlayer);
# NOTE TO PERL NEWBIES - 'my' variables should be declared in their outermost
# scope - if defined inside the if statement, will disappear to program.
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_image_add_layer_mask ($out, $foreground, $layer_mask);
gimp_threshold($layer_mask,$threshold,255);
# Transfer layer mask to selection, and grow the selection
gimp_selection_layer_alpha($foreground);
gimp_selection_grow($out,$growth);
# Apply this selection to the background
gimp_layer_set_visible($bottomlayer, 1);
gimp_image_set_active_layer($out, $bottomlayer);
gimp_selection_invert($out);
gimp_edit_cut($bottomlayer);
# Clean up after yourself
gimp_image_remove_layer_mask($out, $foreground, 1);
my $outlayer = gimp_image_merge_visible_layers($out,0);
# Convert to indexed
if ($index) {
gimp_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;
exit main;

View File

@ -1,59 +0,0 @@
#!/usr/bin/perl
use Gimp;
use Gimp::Fu;
use Gimp::Util;
sub new_scratchlayer {
my($image,$length,$gamma,$angle)=@_;
my $type=$image->layertype(0);
my($layer)=$image->layer_new ($image->width, $image->height, $image->layertype(0),
"displace layer ($angle)", 100, NORMAL_MODE);
$layer->add_layer(-1);
$layer->fill (WHITE_IMAGE_FILL);
$layer->noisify (0, 1, 1, 1, 0);
$layer->mblur (0, $length, $angle);
#$layer->levels (VALUE_LUT, 120, 255, $gamma, 0, 255);
$layer->levels (VALUE_LUT, 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]],
#[PF_BOOL, , "bump_map" , "Use bump map instead of displace", 0],
],
[],
['gimp-1.1'],
sub {
my($image,$drawable,$anglex,$angley,$gamma,$length,$width)=@_;
$image->undo_push_group_start;
my $layer1 = new_scratchlayer ($image, $length, $gamma, $anglex);
my $layer2 = new_scratchlayer ($image, $length, $gamma, $angley);
$drawable->displace ($width, $width, 1, 1, $layer1, $layer2, WRAP);
$layer1->remove_layer;
$layer2->remove_layer;
$image->undo_push_group_end;
$image;
};
exit main;

View File

@ -1,37 +0,0 @@
#!/usr/bin/perl
use Gimp::Feature qw(pdl);
use PDL;
BEGIN { eval "use PDL::Graphics::TriD"; $@ and Gimp::Feature::missing('PDL TriD (OpenGL) support') }
use Gimp;
use Gimp::Fu;
register
'view3d',
'View grayscale drawable in 3D',
'This script uses PDL::Graphics:TriD to view a grayscale drawable in 3D. You can choose a Cartesian (default) or Polar projection, toggle the drawing of lines, and toggle normal smoothing.',
'Tom Rathborne', 'GPLv2', '1999-03-11',
N_"<Image>/View/3D Surface",
'RGB*,GRAY*', [
[ PF_BOOL, 'polar', 'Radial view', 0],
[ PF_BOOL, 'lines', 'Draw grid lines', 0],
[ PF_BOOL, 'smooth', 'Smooth surface normals', 1]
], [],
sub {
my ($img, $dwb, $polar, $lines, $smooth) = @_;
my $w = $dwb->width;
my $h = $dwb->height;
my $regn = $dwb->pixel_rgn (0, 0, $w, $h, 0, 0);
my $surf = $regn->get_rect (0, 0, $w, $h);
$surf=$surf->slice("(0)");
imag3d [ $polar ? 'POLAR2D' : 'SURF2D', $surf ],
{ 'Lines' => $lines, 'Smooth' => $smooth };
();
};
exit main;

View File

@ -1,47 +0,0 @@
#!/usr/bin/perl
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],
],
sub {
my($img,$drawable,$new,$alpha,$bg,$thresh,$colours,$autocrop)=@_;
$img = $img->channel_ops_duplicate if $new;
eval { $img->undo_push_group_start };
$drawable = $img->flatten;
if ($alpha) {
$drawable->add_alpha;
$drawable->by_color_select($bg,$thresh,REPLACE,1,0,0,0);
$drawable->edit_cut if $img->selection_bounds;
}
Plugin->autocrop($drawable) if $autocrop;
$img->convert_indexed (2, 0, $colours, 0, 0, '') if $colours;
eval { $img->undo_push_group_end };
$new ? ($img->clean_all, $img) : ();
};
exit main;

View File

@ -1,65 +0,0 @@
#!/usr/bin/perl
# sent to me by Seth Burgess <sjburges@gimp.org>
# small changes my Marc Lehmann <pcg@goof.com>
use Gimp;
use Gimp::Fu;
#Gimp::set_trace(TRACE_CALL);
sub windify {
my ($img, $drawable, $angle, $density, $distance, $wrap) = @_;
my $oldbg = gimp_palette_get_background();
my $xsize = gimp_drawable_width($drawable);
my $ysize = gimp_drawable_height($drawable);
my $out = gimp_image_new($xsize,$ysize,0);
gimp_palette_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_add_layer($out,$windlayer,0);
my $windlayercopy = gimp_layer_copy($windlayer, 1);
gimp_image_add_layer($out,$windlayercopy,0);
plug_in_noisify(1,$out,$windlayercopy,0,$density/255,
$density/255,
$density/255,1);
plug_in_mblur(1,$out,$windlayercopy,0,15,$angle);
gimp_layer_set_mode($windlayercopy, 10); # Lighten Only
gimp_image_merge_visible_layers($out,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);
plug_in_displace(1,$img,$drawable,-$distance*cos($angle*180/3.14159),
$distance*sin($angle*180/3.14159),
1,1, $newlay,$newlay, $wrap);
gimp_image_remove_layer($out,$newlay);
gimp_image_delete ($out);
gimp_palette_set_background($oldbg);
gimp_displays_flush();
undef;
}
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, 0 is left", 120],
[PF_INT32, "density", "How Much Is Blown",80],
[PF_VALUE, "distance", "How Far Its Blown",30],
[PF_TOGGLE, "smear", "Smear on Edges (or Wrap)",0]
],
\&windify;
exit main;

View File

@ -1,119 +0,0 @@
#!/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"
# 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, [0, 255, 1]],
[PF_SLIDER, "knob_factor", "The size of your knob...", 67, [0, 100, 5]],
],
sub {
my($img,$drawable,$blocksize, $knobfactor)=@_;
$selection_flag = 0;
eval { $img->undo_push_group_start };
if (!$drawable->has_alpha) {
$drawable->add_alpha;
};
if ($img->selection_is_empty) {
$img->selection_all;
$selection_flag = 1;
}
$oldbackground = gimp_palette_get_background();
# Now the fun begins :)
$selection = $img->selection_save;
#1. Pixelize the photo
$drawable->plug_in_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->add_layer($gridlayer,0);
$img->selection_all;
gimp_edit_clear($gridlayer);
gimp_palette_set_background([255,255,255]);
gimp_edit_fill($gridlayer);
$gridlayer->plug_in_grid($blocksize, $blocksize, 0, 0);
$gridlayer->plug_in_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);
# <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);
# <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->add_layer($cleangrid,0);
gimp_edit_fill($cleangrid);
$cleangrid->plug_in_grid($blocksize, $blocksize, 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;
# Clean up stuff
$img->remove_layer($cleangrid);
# $cleangrid->delete; # Deleting these layers after removal seems to cause
# strange problems (I think gimp handles this
# automatically now)
$img->remove_layer($gridlayer);
# $gridlayer->delete;
gimp_selection_load($selection);
gimp_palette_set_background($oldbackground);
if ($selection_flag ==1) {
$img->selection_none;
}
eval { $img->undo_push_group_end };
return ();
};
exit main;

View File

@ -1,84 +0,0 @@
#!/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 ackward, 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
#
# Here's the boring start of every script...
use Gimp qw(:auto __ N_);
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, [0, 255, 1]],
],
sub {
my($img,$drawable,$blocksize) =@_;
eval { $img->undo_push_group_start };
# $selection_flag = 0;
if (!$drawable->has_alpha) {
$drawable->add_alpha;
};
# This only can be applied to an entire image right now..
# $selection = $img->selection_save;
$img->selection_all;
$oldbackground = gimp_palette_get_background();
# Now the fun begins :)
$drawable->plug_in_pixelize($blocksize);
$shadowlayer = $drawable->layer_copy(0);
$img->add_layer($shadowlayer,0);
$checkmask = $shadowlayer->create_mask(WHITE_MASK);
$img->add_layer_mask($shadowlayer, $checkmask);
plug_in_checkerboard ($img, $checkmask, 0, $blocksize);
$frontlayer = $shadowlayer->layer_copy(0);
$img->add_layer($frontlayer,0);
gimp_palette_set_background([0,0,0]);
$shadowlayer->fill(BG_IMAGE_FILL);
$checkmask->plug_in_gauss_iir(0.3*$blocksize, 1, 1);
gimp_channel_ops_offset ($checkmask, 1, 0, 0.2*$blocksize, 0.2*$blocksize);
$gridlayer = $img->layer_new($img->width, $img->height, RGBA_IMAGE, "Grid 1", 100, 0);
$img->add_layer($gridlayer,0);
$img->selection_all;
gimp_edit_clear($gridlayer);
gimp_palette_set_background([255,255,255]);
gimp_edit_fill($gridlayer);
$gridlayer->plug_in_grid((1, $blocksize, 0, "black", 0) x 3);
gimp_layer_set_mode($gridlayer, 3);
# Clean up stuff
gimp_palette_set_background($oldbackground);
eval { $img->undo_push_group_end };
gimp_displays_flush();
return();
};
exit main;

View File

@ -1,54 +0,0 @@
#!/usr/bin/perl
# Once again, an effect of Xach's
# Created by Seth Burgess <sjburges@gimp.org>
use Gimp qw(:auto __ N_);
use Gimp::Fu;
register "xachvision",
"Xach Survielence Camera/XachVision",
"This makes an interlaced-looking machine vision type thing.",
"Seth Burgess",
"Seth Burgess <sjburges\@gimp.org>",
"1999-02-28",
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_push_group_start };
$oldbackground = gimp_palette_get_background();
$midlayer = $drawable->gimp_layer_copy(1);
$img->add_layer($midlayer, 0);
$toplayer = $drawable->gimp_layer_copy(0);
$img->add_layer($toplayer, 0);
gimp_palette_set_background($color);
$toplayer->edit_fill();
$toplayer->set_mode(COLOR_MODE);
gimp_palette_set_background([0,0,0]);
$drawable->edit_fill();
$amt = $amt/255;
$midlayer->plug_in_noisify(1,$amt, $amt, $amt, $amt);
$midmask = $midlayer->create_mask(0);
$img->add_layer_mask($midlayer, $midmask);
$midmask->plug_in_grid($img->height * 3, 3, 0, 0);
$midmask->plug_in_gauss_iir(1.01, 1, 1);
gimp_palette_set_background($oldbackground);
eval { $img->undo_push_group_end };
gimp_displays_flush();
return();
};
exit main;