VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Describes the Diffusion of Images

by manikantan (12 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 25th October 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Describes the Diffusion of Images

Rate Describes the Diffusion of Images




Manikantan
3rd Agenda,
Web Development,
India.
Website:www.3rdagenda.com
Email:[email protected]


Image Diffuse Filter

Various Filters can be applied to an image one of Such kind is the Diffuse filter.
The diffuse filter uses  the rnd function to introduce some randomness to the image
and give it a painterly look.


For i = 1 To Picturebox.ScaleHeight - 3
For j = 1 To Picturebox.ScaleWidth - 3
pixval = Picturebox.Point(j + CInt(Rnd * 10), i + CInt(Rnd * 10))
red_val = "&h" & Mid$(CStr(Hex(pixval)), 5, 2)
green_val = "&h" & Mid$(CStr(Hex(pixval)), 3, 2)
blue_val = "&h" & Mid$(CStr(Hex(pixval)), 1, 2)
If red_val = "&h" Then red_val = "&h0"
If green_val = "&h" Then green_val = "&h0"
If blue_val = "&h" Then blue_val = "&h0"
Picturebox.PSet (j, i), RGB(red_val, green_val, blue_val)
Next
Next
This Code above Traverses the images as a twodimensional array picks all the pixels 
and randomly rearranges the pixels  to some fixed diameter.Since this happens to all
the pixels a kind of diffused eeffeect can be seen on the images.



Article By
Manikantan
email:[email protected]





Download this snippet    Add to My Saved Code

Describes the Diffusion of Images Comments

No comments have been posted about Describes the Diffusion of Images. Why not be the first to post a comment about Describes the Diffusion of Images.

Post your comment

Subject:
Message:
0/1000 characters