/usr/share/doc/libgd-gd2-perl/examples/demos/brushes.pl is in libgd-gd2-perl 1:2.46-3.1build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #!/usr/bin/perl
use GD;
$im = new GD::Image(300,300);
# allocate white
$white = $im->colorAllocate(255, 255, 255);
# allocate black
$black = $im->colorAllocate(0, 0, 0);
# allocate red
$red = $im->colorAllocate(255, 0, 0);
# allocate green
$green = $im->colorAllocate(0,255,0);
# allocate yellow
$yellow = $im->colorAllocate(255,250,205);
# Get an image from a png file
open (TILE,"./tile.png") || die;
$tile = newFromPng GD::Image(TILE);
close TILE;
# use it as a paintbrush
$im->setBrush($tile);
$im->arc(100,100,100,150,0,360,gdBrushed);
# use it as a tiling pattern to fill a rectangle
$im->setTile($tile);
$im->filledRectangle(150,150,250,250,gdTiled);
$im->rectangle(150,150,250,250,$black);
# Draw a dotted line
$im->setStyle($green,$green,$green,gdTransparent,$red,$red,$red,gdTransparent);
$im->line(0,280,300,280,gdStyled);
binmode STDOUT;
# print the image to stdout
print $im->png;
|