Operators Dialog / Operator Details

§ 12.11.15 - Convolve

Scripting command: convolve [Cell=-1000...1000] (x9) [Mono=0...1] [mix=0...100]

Note: All available scripting operations are listed on the Script operator page.

Applies a user-defined 3x3 convolution to the image.


The Convolve operator

§ 12.11.15.1 - What Convolutions Do

This iToolBox operator applies a three-wide by three-high convolution to each pixel in an area selection.

At the beginning of the process, a copy is taken of the image which is used as an unmodified source while the action image is modified.

Each pixel in the selection (except for the edge pixels, which we'll come back to) in the copy of the image has the above box of nine multipliers centered over it, which puts the center multiplier over the pixel to be changed, and the other eight multipliers over the pixels surrounding it.

For each color component channel (red, green, and blue) of each of the nine pixels under the array of cells, the channel value is multiplied by the value in the corresponding cell; these values are added together for all nine pixels, and then the center pixel's channel in the action image is replaced by that sum. The sum is limited so that it cannot go below minimum channel brightness or above maximum channel brightness.

At this point, the nine cells are centered over the next pixel in the image copy, and the process is repeated and applied to the next pixel in the action image. This process continues for all pixels in the image.

At the edges, when the array is centered over the target pixel in the image copy, some of the cells will be off-image; that is, they will not be over any pixels. There are many strategies that can be used to deal with this circumstance; the one iToolBox uses is as follows: Non-overlapping cell multipliers do not contribute to the sums that are applied to the action image's channels.

When  B&W is checked, the copy of the image is converted to monochrome prior to the convolution process.

Mix allows you to specify a mix of the result with the original image pixels from 0% to 100%

When the process is complete, the image copy is discarded.

§ 12.11.15.2 - Some Common Convolutions

Note: All of the following examples were created with Mix set to 100% and  B&W not checked.
The image is of one of the pickups of my Ibanez "flying squid" electric guitar. The photo was taken in very low light conditions with a Canon 6D DSLR, then loaded directly into iToolBox, adjusted using Gain operator, reduced in size with the Enlarge / Reduce dialog and then cropped using the Crop operator.
.1111.1111.1111
.1111.1111.1111
.1111.1111.1111
=
Box Blur


0-10
-14-1
0-10
=
Edge detection (Laplacian)


-1-1-1
-18-1
-1-1-1
=
Edge detection (Laplacian w/diagonals)


-2-10
-102
012
=
Emboss


0.06250.1250.0625
0.1250.250.125
0.06250.1250.0625
=
Gaussian Blur


000
010
000
=
Identity


-1-12
-12-1
2-1-1
=
Lines (45 degrees)


2-1-1
-12-1
-1-12
=
Lines (-45 degrees)


-1-1-1
222
-1-1-1
=
Lines (horizontal)


-12-1
-12-1
-12-1
=
Lines (vertical)


0-10
-15-1
0-10
=
Sharpen


-1-2-1
000
121
=
Sobel (bottom)


10-1
20-2
10-1
=
Sobel (left)


-101
-202
-101
=
Sobel (right)


121
000
-1-2-1
=
Sobel (top)



Document Keyboard Navigation
, Previous Page . Next Page
t TOC i Index k Keyboard o Operators g Glossary c Changes

Valid HTML 4.01 Loose
 

This manual was generated with wtfm
wtfm uses aa_macro and SqLite
wtfm and aa_macro are coded in python 2.7
iToolBox 3.11
This Documentation and Associated Application Executables are Public Domain
Please consider supporting my iToolBox development efforts with a small PayPal donation.