Painting, Drawing, and Transforms

In the Gimp, a Drawable is a layer, a channel, or an image. You can use the Gimp::Drawable object to simplify the use of most of these drawing procedures. Procedures to get information about drawables are listed later in this appendix, in Table 3.3.

For more information on operating directly on the raw pixels of an image, check out the Gimp::Pixel manpage that is distributed with the Gimp-Perl module.

Table C-3. Procedures for Drawing and Painting on Images, Controlling Brushes, and Performing Transformations

Name

Description

Arguments

gimp_airbrush

Paint in the current brush with varying pressure. Paint application is time-dependent

image (Image)

The image

drawable (Drawable)

The drawable

pressure (Float)

The pressure of the airbrush strokes in the range 0 to 100

num_strokes (Integer)

Number of stroke control points (count each coordinate as 2 pts)

strokes (FloatArray)

Array of stroke coordinates (strokex1, strokey1, ... strokexn, strokeyn)

gimp_blend

Blend between the starting and ending coordinates with the specified blend mode and gradient type

image (Image)

The image

drawable (Drawable)

The affected drawable

blend_mode (Integer)

The type of blend (FG_BG_RGB, FG_BG_HSV, FG_TRANS, CUSTOM)

paint_mode (Integer)

The paint application mode (NORMAL_MODE, DISSOLVE_MODE, BEHIND_MODE, MULTIPLY_MODE, SCREEN_MODE, OVERLAY_MODE, DIFFERENCE_MODE, ADDITION_MODE, SUBTRACT_MODE, DARKEN_ONLY_MODE, LIGHTEN_ONLY_MODE, HUE_MODE, SATURATION_MODE, COLOR_MODE, ...

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.