To obtain a

A=imread('aish.jpg');

%WINDOW SIZE

m=6;

n=7;

Image=uint8(zeros([size(A,1)-m,size(A,2)-n,3]));

for i=1:size(A,1)-m

for j=1:size(A,2)-n

mymask=A(i:i+m-1,j:j+n-1,:);

%Select a pixel value from the neighborhood.

x2=ceil(rand(1)*m);

y2=ceil(rand(1)*n);

Image(i,j,:)=mymask(x2,y2,:);

end

end

figure,imshow(Image);

We can change the matrix size and see the difference in the result.

SEE ALSO : Oil Painting Swirl effect Cone effect Tiling effect Paint application

**glassy effect**, define a window of size m by n. Obtain a random pixel value from the window matrix and add it with the current position value.**MATLAB CODE:**A=imread('aish.jpg');

%WINDOW SIZE

m=6;

n=7;

Image=uint8(zeros([size(A,1)-m,size(A,2)-n,3]));

for i=1:size(A,1)-m

for j=1:size(A,2)-n

mymask=A(i:i+m-1,j:j+n-1,:);

%Select a pixel value from the neighborhood.

x2=ceil(rand(1)*m);

y2=ceil(rand(1)*n);

Image(i,j,:)=mymask(x2,y2,:);

end

end

figure,imshow(Image);

We can change the matrix size and see the difference in the result.

SEE ALSO : Oil Painting Swirl effect Cone effect Tiling effect Paint application

Reference:

- Algorithms for Graphics and Image Processing
- Beyond photography: The Digital Darkroom

## 0 comments:

## Enjoyed Reading? Share Your Views