Color Control, Palettes, and Patterns
A color is represented by an anonymous array of three elements representing the red, green, and blue values:
my $red = [ 255, 0, 0 ];
The Gimp comes with several default patterns, palettes, and gradients, all of which may be referred to by name:
# Set the current pattern my $pattern = "Blob1"; gimp_patterns_set_pattern($pattern); # Convert $image to an indexed palette my $palette = "Reds_And_Purples"; gimp_convert_indexed_palette($image, 1, 4, 0, $palette); # Set the active gradient my $gradient = "Mexican_flag_smooth"; gimp_gradients_set_active($gradient);
Table C-4. Procedures for Manipulating the Colors in an Image, and Managing Palettes and Patterns
Name |
Description |
Arguments |
---|---|---|
gimp_brightness_contrast |
Modify brightness/contrast in the specified drawable |
|
gimp_color_balance |
Modify the color balance of the specified drawable |
|
gimp_color_picker |
Determine the color at the ... |
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.