11.31. Border Average
| 11. The Colors Menu |

### 11.31. Border Average

Revision History
Revision $Revision: 2438 $ | 2007-10-22 | ude

#### 11.31.1. Overview

Figure 15.185. Example for the “Border Average” filter

Original image

Filter “Border Average” applied

This plug-in calculates the most often used color in a specified border of the the active layer or selection, allowing a specified range to not be exact. The calculated color becomes the foreground color in the Toolbox. This filter is interesting when you have to find a Web page color background that differs as little as possible from your image border. The action of this filter is not registered in Undo History and can't be deleted with Ctrl+Z.

#### 11.31.2. Activate the filter

This filter is found in the image window menu under Colors → Border Average.

#### 11.31.3. Options

Figure 15.186. Options of the “Border Average Filter”

Border Size

  You can set there the border Thickness in pixels.

Number of Colors

  The Bucket Size lets you control the number of colors considered as similar and counted with the same “bucket”. A low bucket size value (i.e. a high bucket number) gives you better precision in the calculation of the average color. Note that better precision does not necessarily mean better results (see example below).

#### 11.31.4. Examples illustrating the “Border Average” filter

Figure 15.187. Original image

Original image: colors are pure Red (255;0;0), pure Blue (0;0;255), and different but similar kinds of Green (00******;11******;00******).

Figure 15.188. “Number of Colors” is set to 8:

The resulting color is a Red (254,2,2).

The most frequent color on the image border is pure Red (255,0,0). Since the bucket size is low, the different Green tones are not recognized as the same color. The resulting color is a nearly pure Red (254,2,2) and becomes the foreground color of the Toolbox.

Figure 15.189. “Number of Colors” is set to 64:

The resulting color is Green (32,224,32).

Here the bucket size is high, the number of buckets low. The filter looks at only the two most significant bits of every color channel value. Now Green (0-63,192-255,0-63) is the most frequent color. The resulting color is Green (32,224,32), which is the average of all colors possibly counted by this “bucket”.

11.30. Histogram |  | 11.32. Colorcube Analysis