|
Source: (largely custom); [PITA00:122-124]
Like the fish-eye lens effect, the random blur was used as a ‘study’ before venturing out on my own and creating the raindrop effect. This is the first filter we have looked at that does not exactly match one of the filter type definitions given earlier. It is probably closest related to an area filter, as the pixels that are modified are based on the surrounding pixels. The thing that makes this filter different is that not every pixel is necessarily processed, and the processing does not occur in a linear order.
The random blur effect randomly chooses an (x,y) coordinate in the image and blurs a square area around that pixel. The blur that occurs is exactly like the simple blur filter described earlier. The purpose of this filter was so that I could get practice in producing a filter effect to random areas in a subset of an image. The proposed raindrop effect would have to produce randomly placed fish eye lens effects over an image; since the blur is a simple filter, I felt this would be a good way to begin.
for every pixel in the image do
// copy the image since the entire image won't be
affected
filterpixel = currentpixel;
RAD = blocksize * blocksize;
repeat num_of_blurs times
{
x = rand() * (image_height / RAND_MAX);
y = rand() * (image_width / RAND_MAX);
for every pixel in radius blocksize surrounding (x,y) do
{
R = G = B = 0;
for every pixel in radius r surrounding the center pixel do
{
R += currentpixel.r;
G += currentpixel.g;
B += currentpixel.b;
numpixels++;
}
filterpixel.r = R / RAD;
filterpixel.g = G / RAD;
filterpixel.b = B / RAD;
}
}
The number of blurs, the block size, and the blur radius are all user supplied values through the random blur dialog box. The design of this filter did not have any particular artistic uses in mind; it was simply a study for the raindrop filter. The results however are somewhat interesting. It would be interesting to investigate using other ‘base’ filters here instead of the blur.

Random blur (default settings)
Return to
the list of filters
|