Perl 6 interface to the Gd graphics library.
Perl 6
Switch branches/tags
Nothing to show
#3 Compare This branch is 24 commits ahead of mrhdias:master.
Latest commit 01fa4db Apr 25, 2017 @zoffixznet zoffixznet committed on GitHub Use modern META filename

Build Status


GD Logo
Perl 6 interface to the Gd graphics library.


Perl6 interface to Thomas Boutell's gd graphics library. GD allows you to create color drawings using a large number of graphics primitives, and emit the drawings in multiple formats. You will need the Linux gd-libgd library or OS X gd2 port installed in order to use perl6-GD (preferably a recent version).


WARNING: This module is Work in Progress, which means: this interface is not final. This will perhaps change in the future.
A sample of the code can be seen below.

use GD;

my $image =, 200);
exit() unless $image;

my $black = $image.colorAllocate(
	red   => 0,
	green => 0,
	blue  => 0);

my $white = $image.colorAllocate(
	red   => 255,
	green => 255,
	blue  => 255);

my $red = $image.colorAllocate("#ff0000");
my $green = $image.colorAllocate("#00ff00");
my $blue = $image.colorAllocate(0x0000ff);

	location => (10, 10),
	size     => (100, 100),
	fill     => True,
	color    => $white);

	start => (10, 10),
	end   => (190, 190),
	color => $black);

my $png_fh = $"test.png", "wb");

$image.output($png_fh, GD_PNG);





Henrique Dias

See Also


This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.