#!/usr/bin/perl use warnings; use strict; use PDL::LiteF; use PDL::IO::GD; my $im = PDL::IO::GD->new( { filename => '1Zen16.png' } ); # Grab the PDL of the data: my $pdl = $im->to_pdl(); print dims $pdl,"\n"; # Allocate some colors: # my $black = $im->ColorAllocate( 0, 0, 0 ); my $red = $im->ColorAllocate( 255, 0, 0 ); my $green = $im->ColorAllocate( 0, 255, 0 ); my $blue = $im->ColorAllocate( 0, 0, 255 ); # Draw a rectangle: $im->Rectangle( 10, 10, 290, 290, $red ); # Add some text: $im->String( gdFontGetLarge(), 20, 20, "Test Large Font!", $green ); # Write the output file: $im->write_Png( "$0.png" );