in reply to Sort of embedded images

I have just got done doing a overhall of my site. I used the below Gimp::FU perl script to creat all my new logos for the site. This will also allow me to change the colors without much trouble. I am sure it can be improved.. but it work for me. I also have a similar script to do the small text links.
#!/usr/bin/perl use Gimp; use Gimp::Fu; register "large_logo", "Create a large logo\nfor use on a website", "My first gimp script... No help here!!!", "Joshua Curtis <joshua\@curtisonline.net>", "(c)2000 Joshua Curtis", "20000609", N_"<Toolbox>/Xtns/CurtisOnline/Large Logo", "RGB*, GRAYA", [ [PF_FONT, "font", "Font", "-urw-nimbus sans l-bo +ld-r-normal-*-*-640-*-*-p-*-iso8859-1"], [PF_STRING, "text", "Text", "Hello world!"], [PF_COLOUR, "background_color", "Background color", "#41 +69ff"], [PF_COLOUR, "text_color", "Text Color", "#ffd700"], [PF_COLOUR, "shadow_color", "Shadow Color", [0,0,0]], [PF_INT, "x_shadow_offset", "Shadow X Offset","5"], [PF_INT, "y_shadow_offset", "Shadow Y Offset","5"] ], sub { # now do sth. useful with the garbage we got ;) my($font,$text,$bg,$fg,$ds,$xset,$yset)=@_; # set tracing, disable this to get rid of the debugging output #Gimp::set_trace(TRACE_CALL); my $img = new Image (100, 100, RGB); # the __ before the string in the next line indicates text that mus +t be translated my $layer = new Layer ($img, 100, 100, RGB, __"Background", 100, NO +RMAL_MODE); $layer->add_layer(1); # now a few syntax examples Palette->set_foreground($fg); Palette->set_background($bg); fill $layer BG_IMAGE_FILL; my $text_layer = $img->text_fontname(-1, 0, 0, $text, 1, 1, xlfd_si +ze($font), $font); # Get size of the text drawable and resize the image and the # background layer to this size. my($width,$height) = ($text_layer->width,$text_layer->height); ###### # Now we try to account for - numbers... $xset_new = $xset; $yset_new = $yset; if ($xset =~ /-/) { $xset_new =~ s/-//; $width += $xset_new; $xset = 0; } else { $width += $xset; $xset_new = 0; } if ($yset =~ /-/) { $yset_new =~ s/-//; $height += $yset_new; $yset = 0; } else { $height += $yset; $yset_new = 0; } # End - numbers ####### $img->resize($width, $height, $xset_new, $yset_new); $layer->resize($width, $height, $xset_new, $yset_new); ###### # Now we try to give it a bump map... $text_layer->plug_in_bump_map($text_layer,"135.00","55.78",12 +,0,0,0,0,1,0,1); ###### # Now we add a drop shadow.... my $drop_shadow = $text_layer->copy(0); $drop_shadow->set_name("Drop Shadow"); $drop_shadow->add_layer(1); $drop_shadow->resize($width, $height, 0, 0); $drop_shadow->set_preserve_trans(1); Palette->set_background($ds); $drop_shadow->edit_fill(); $drop_shadow->set_preserve_trans(0); $drop_shadow->plug_in_gauss_iir(5.0, 1, 1); $drop_shadow->set_opacity("80.0"); $drop_shadow->set_offsets($xset, $yset); ###### # Flaten the image. $img->flatten; return($img); # return the image, or an empty list, i.e. () }; exit main;
--
Joshua M Curtis
http://www.curtisonline.net

Lancaster Co. Linux Users Group
http://www.lancaster-linux.org

ICQ: 59943578

Replies are listed 'Best First'.
RE: Website logo's buttons..
by t0mas (Priest) on Jul 03, 2000 at 16:50 UTC
    Cool. I've been thinking about using Gimp for this, but some of my customers run NT and I don't know how WinGimp can handle that. Another way is to use ImageMagick.

    /brother t0mas