Jump to content
  • Treść wyszukiwania
    Search In
    • More options...
    Find results that contain...
    Find results in...
  • Sign Up
Password for all archives on our forum: 123

Image Filter with C language

Sources

Recommended Posts

Image manipulation with C. Beginners guide.

As an image is a collection of pixels grouped together in a certain order and each pixels is a byte which contains Red Green and Blue value, we can change the position or the values according to what we like to achieve. Here is a program which has four functions Grayscale, Reflect, Blur and Edge detection which converts an image into each of the respective functions.

Gray scale: Nothing much to explain here. The new value of each RGB value of each pixel is the average value of the current RGB value.  Eg:- Red = 126, Green = 211 and Blue = 107 and so the average value of these 3 RGB value is (Red + Green + Blue)/3 = 444/3 = 148. So Red = 148, Green = 148 and Blue = 148.

Reflect: Loop through width/2 and copy the pixels of the first half to the right.

Blur Image algorithm explanation:-

Hidden Content

    Give reaction to this post to see the hidden content.

Edge detection algorithm explanation:-

Hidden Content

    Give reaction to this post to see the hidden content.

Note: I know i hard code blur function instead of nesting more loops. Its mainly to show beginners how the algorithm behind blur image works.

Hidden Content

    Give reaction to this post to see the hidden content.

  • Like 6
  • Haha 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...