Methods to fill image pixel regions
unsigned int ColorFloodfillImage( Image *image, const DrawInfo *draw_info, const PixelPacket target, const long x_offset, const long y_offset, const PaintMethod method );
ColorFloodfill() changes the color value of any pixel that matches target and is an immediate neighbor. If the method FillToBorderMethod is specified, the color value is changed for any neighbor pixel that does not match the bordercolor member of image.
By default target must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.
The format of the ColorFloodfillImage method is:
unsigned int ColorFloodfillImage( Image *image, const DrawInfo *draw_info, const PixelPacket target, const long x_offset, const long y_offset, const PaintMethod method );
The image.
The draw info.
The RGB value of the target color.
The starting location of the operation.
Choose either FloodfillMethod or FillToBorderMethod.
unsigned int MatteFloodfillImage( Image *image, const PixelPacket target, const unsigned int opacity, const long x_offset, const long y_offset, const PaintMethod method );
MatteFloodfill() changes the transparency value of any pixel that matches target and is an immediate neighbor. If the method FillToBorderMethod is specified, the transparency value is changed for any neighbor pixel that does not match the bordercolor member of image.
By default target must match a particular pixel transparency exactly. However, in many cases two transparency values may differ by a small amount. The fuzz member of image defines how much tolerance is acceptable to consider two transparency values as the same. For example, set fuzz to 10 and the opacity values of 100 and 102 respectively are now interpreted as the same value for the purposes of the floodfill.
The format of the MatteFloodfillImage method is:
unsigned int MatteFloodfillImage( Image *image, const PixelPacket target, const unsigned int opacity, const long x_offset, const long y_offset, const PaintMethod method );
The image.
The RGB value of the target color.
The level of transparency: 0 is fully opaque and MaxRGB is fully transparent.
The starting location of the operation.
Choose either FloodfillMethod or FillToBorderMethod.
unsigned int OpaqueImage( Image *image, const PixelPacket target, const PixelPacket fill );
OpaqueImage() changes any pixel that matches color with the color defined by fill.
By default color must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.
The format of the OpaqueImage method is:
unsigned int OpaqueImage( Image *image, const PixelPacket target, const PixelPacket fill );
The image.
The RGB value of the target color.
The replacement color.
unsigned int TransparentImage( Image *image, const PixelPacket target, const unsigned int opacity );
TransparentImage() changes the opacity value associated with any pixel that matches color to the value defined by opacity.
By default color must match a particular pixel color exactly. However, in many cases two colors may differ by a small amount. Fuzz defines how much tolerance is acceptable to consider two colors as the same. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.
The format of the TransparentImage method is:
unsigned int TransparentImage( Image *image, const PixelPacket target, const unsigned int opacity );
The image.
The RGB value of the target color.
The replacement opacity value.
Copyright © GraphicsMagick Group 2002 - 2023