Filter: Oil Paint

Source: modified for color pixels from [HOLZ88:46-47,111-112]; [SEUL00:52], [FOLE90:589-591]

The oil paint effect is a strict area process, like the blurs and the convolution described earlier. The effect is created by assigning the center pixel in an area kernel the most frequently appearing color in that area. This way, important colors are ‘clumped’ together, in the same manner that a painter might abbreviate an object by leaving out the details and painting just enough of the important information to get the sense of the object across to the viewer. The basic algorithm is surprising simple for such an interesting effect:

   for every pixel in the image do
      filterpixel = MostFreqentColor(currentpixel);

The complexity lies in the MostFrequentColor() function. It works like this: For each pixel surrounding the given coordinates of the current pixel MostFrequentColor() determines the intensity of that pixel and keeps track of how many pixels have which intensity. The RGB components of the pixels that have the same intensity as the most frequently appearing intensity are averaged and returned as being the ‘most frequent color’. 

As in other area processes, the number of pixels that surround the current pixel is based on a radius entered by the user on the oil paint dialog (in keeping with the theme, it is labeled as ‘brush size’). As it turns out, using 256 different intensity values (as has been common in other filters) does not allow for colors to be ‘clumped’ very well. That is, the surrounding pixels vary too much in intensity if there are 256 different possible intensity values. The resulting image is a little coarse, and not smooth. If intensity values are mapped instead, to say, only 100 different possibilities, the resulting image is smoother. The oil paint dialog box has a slider bar to set the number of possible intensities a pixel color can be mapped to, which in turn effects the image ‘smoothness’.


Oil paint (default settings)


Return to the list of filters
 


© 2001 Jason Waltman