Name

Negate( ) — apply color inversion

Synopsis

$image->Negate(gray=>{1,
0})

Negate( ) flips each bit of every color in the colormap of the image, effectively negating the intensities of the three color channels, as shown in Figure 5.9. If the optional gray parameter is set to 1, only the grayscale pixels are inverted.

$image->Negate( )

Figure 5-9. $image->Negate( )

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.