Computer Science Canada Reverse Blurring? |
Author: | scytheblades [ Mon May 29, 2006 1:35 pm ] |
Post subject: | Reverse Blurring? |
Hey all First time posting, very impressed with the stuff i've seen here. Anyways, i'm trying to do a "reverse blurring". The effect i'm trying to get is having an original picture blurred, then not as blurred, until it becomes normal. I was thinking of a "for descending" to handle the down blurring, but I am getting nowhere. I think this is possible, but am having trouble with making this happen. Any pointers would be welcome. THanks, MikeB |
Author: | Albrecd [ Mon May 29, 2006 1:46 pm ] |
Post subject: | |
It would be very helpful if you'd post your code. A desending for loop sounds like the right Idea but we need to know your method of blurring in order to help ![]() |
Author: | TheOneTrueGod [ Mon May 29, 2006 1:56 pm ] | ||
Post subject: | |||
the command "descending" isn't really going to help you in this instance, all that will allow it to do is start at the top left as opposed to the bottom left. (Depending on which one you chose to be your "descending" for count) What you want to do is check every other pixel (Or every 3rd pixel, or every 5th pixel, or whatever you want, depending on how blurry you want it) and copy that pixels colour to the pixel beside it (Once again, depending on how often you check, you may want to adjust where the new colour). For this, go check the Turing Walkthrough for View.WhatDotColour. This will give you the pixel colour at a certain co-ordinate. As for the checking every other pixel,
I think thats a good enoug hint ![]() |
Author: | Albrecd [ Mon May 29, 2006 2:04 pm ] |
Post subject: | |
TheOneTrueGod wrote: What you want to do is check every other pixel (Or every 3rd pixel, or every 5th pixel, or whatever you want, depending on how blurry you want it) and copy that pixels colour to the pixel beside it
But this wouldn't work for reverse blurring, which is what scytheblades is trying to do. scytheblades wrote: i'm trying to do a "reverse blurring". The effect i'm trying to get is having an original picture blurred, then not as blurred, until it becomes normal. |
Author: | Cervantes [ Mon May 29, 2006 4:20 pm ] |
Post subject: | |
That's an interesting question. Perhaps how it is done is, for each pixel on your grid, set the new colour of that pixel to the average of the colours of the 8 pixels around it. Some notes:
|
Author: | codemage [ Tue May 30, 2006 9:10 am ] |
Post subject: | |
Sharpening is logically the opposite of blurring. So, instead of adding colour information to a pixel from its neighbours, you subtract a small fraction of each neighbour's colour from the original. This will NOT be able to restore the original image, since blurring permanently destroys some of the original data - but you may be able to come close if the image isn't blurred too much, and if you get the fraction right. |
Author: | Delos [ Tue May 30, 2006 10:44 am ] |
Post subject: | |
As codemage has pointed out, it is pretty much impossible to 'unblur' an image once it has been blurred (think about the maths of averages. There are several combinations of numbers that could yield the same average, hence the problem). However, for your problem, could could do the following: - start with your original image - blur it as many times as you need, storing each blur in memory - present the images in reverse order to achieve your effect Note that blurring can be *very* slow in Turing. I haven't tried out the new 4.1 yet, but I'm told it is a little faster w.r.t. graphics...so you might not want to do the blurring on the fly. You could just as easily prerender your pics, save them, and use import them during the programme. Not as pretty, but it works. |