0

I've hit a bit of a brick wall writing a blur function for filter (more). This is my second go at refactoring the code, and although it produces a blurred image without any issues (no weird edges, missing areas etc), it fails check50 Deleted code as it was very similar to the solution. Any ideas, as I'm pretty stuck?

Original picture (zoomed in) Sharp Picture

Blurred picture (zoomed in) enter image description here

0

1 Answer 1

1

Yes, it produces a blurred picture, just not correctly blurred. You should work with something simple, like a 3x3 bitmap and look at the actual input and output values to see what it does. Specifically, think carefully about when and how the avgRed, avgGreen and avgBlue are updating vs. when they're used.

This is a good example why it's critical to look at raw data when writing code and not just look at images. What may appear to be working correctly could actually be very wrong.

2
  • Thank you for your feedback Cliff. I shall do as you suggest and report back.
    – leftcase
    Jun 25 at 12:56
  • The advice to create and use my own 3x3 bitmap helped immensely. This helped me understand where I'd gone wrong with the code.
    – leftcase
    Jun 28 at 9:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .