Archived

This topic is now archived and is closed to further replies.

darkworldgames

Where can i find "Sharpen" codes?

Recommended Posts

darkworldgames    122
Yes,just like photoshop''s sharpen plugin,i wanna have my own code to process big count bitmap resources in short time and fast way,so i must code my own Sharpen tool.But where can i find a free code or algorithm about "Sharpen",any one helps me? thanks!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Its all about the convolution matrices, I hate them very much. Blur, sharpen, etc can be done with them. The java 2d tutorial has a section on that. <A HREF="http://java.sun.com/products/jdk/1.2/docs/guide/2d/spec/j2d-image.fm8.html"> Here </A>

Share this post


Link to post
Share on other sites
TerranFury    142
I''ll explain BeerHunter''s post:

The current pixel is the one in the middle of that matrix. Adjacent pixels have corresponding positions in the matrix. The current pixel value is set to be the sum of tha values of all the adjacent pixels, but with the coefficients in the matrix. So what his matrix means is this:


newpixel = 0 * getpixel(x-1, y-1) +
-1/4 * getpixel(x , y-1) +
0 * getpixel(x+1, y-1) +
-1/4 * getpixel(x-1, y) +
2 * getpixel(x , y) +
-1/4 * getpixel(x+1, y) +
0 * getpixel(x-1, y+1) +
-1/4 * getpixel(x , y+1) +
0 * getpixel(x+1, y+1);



In my first post I told you to subtract the surrounding pixels from the current pixel. This is a way to do that.

Share this post


Link to post
Share on other sites