Fountain Fills

This page gives a simple demonstration of the Imager fountain filter. See the bottom of the page for sample code that could draw the given fountain fill.

Fill type:
Repeat:
Supersample: about samples
Combine:
Point A (, )
Point B (, )
StartMiddleEnd c0 + alphac1 + alphaTypeColor Trans.
   
   
   
   
   
   
   
   
   
   

Code:

use Imager;
use Imager::Fountain;
my $img = Imager->new(xsize=>200, ysize=>200);
my $bg = Imager::Color->new("#FF00FF);
$img->box(color=>$bg, filled=>1);
my $segs = Imager::Fountain->new;
$segs->add(
           c0 => Imager::Color->new(web=>"#000000", alpha=>255),
           c1 => Imager::Color->new(web=>"#FFFFFF", alpha=>255),
           color=>"direct");
$img->filter(type => "fountain", ftype => "linear", repeat => "none",
             super_sample => "circle", ssample_param => 4,
             combine => "none", segments => $segs,
             xa => 10, ya => 130, xb => 10, yb => 10);