Jump to content
  • Advertisement


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


[java] How to perform a blur effect on a pic ?

This topic is 5970 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A blur is created by averaging pixels. A basic blur would look something like this:

Make a copy of the image (buffer)
For each pixel find the total red, green and blue values of itself and the surrounding eight pixels in the buffer (don''t read the values from the image itself, since they will change as you apply the blur). Divide those three values by 9 to get new red, green and blue values and set the pixel to that color.
When done you can dispose of the buffer.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!