Name
Shade( ) — shade the image with light source
Synopsis
$image->Shade(geometry=>geometry
, azimuth=>integer
, elevation=>float
, color=>{1, 0})
Shade( )
, as
shown in Figure 5.12, creates an effect similar to that of
Emboss( )
in that it gives the edges of the
image a three-dimensional look and lights it with a distant light
source (in fact, Emboss( )
is a special enhanced
case of the Shade( )
function). You may control
the light source with the azimuth
and
elevation
parameters; azimuth
is measured in degrees off the x axis and
elevation
is measured in “virtual
pixels” on the (also virtual) z axis. The geometry parameter
may be specified as a shortcut for azimuth
×
elevation
.
Figure 5-12. $image->Shade(azimuth => 60, elevation => 50, color => 0)
Get Programming Web Graphics with Perl and GNU Softwar now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.