high-pass filter for sharpening pictures?

Y
Posted By
YrbkMgr
Jul 1, 2003
Views
518
Replies
6
Status
Closed
A blurred picture is basicly nothing more than a crisp picture passed throught a 2-D low-pass filter of a certain characteristic

I’m not an engineer, so take that into consideration. I’m not certain that the statement above is 100% true. It seems to imply that no matter how badly a picutre is out of focus, there should be a "counter" algorithm to bring it back into focus.

If I’ve got that right, and if this is true, I don’t know how this helps us at all. Consider your typical non-digital camera: the variation in focus seems infinite in the possiblilities of the "math" behind why it’s out of focus. We use our eye with a little help from the TTL viewfinder to assure an image is in focus, but that value is (or seems that it would be) impossible to produce twice in a row unless the focus was never changed.

With that in mind, you snap a pic of Aunt Judy at 3 feet away, that would produce a "math value" of X; if you never touch the focus again, it *might* be possible to calculate the algorithm that would counter any out-of-focus issues. However, if you put the camera down, and reposition Aunt Judy to get a profile, the photographer will re-focus, thereby changing the algorithm needed to correct any slight out of focus.

Taking that a step further, if you always shot out of focus, never changing the focus of the camera, a single step forward or step backward by the subject, would again, change whatever value you were trying to apply, from an algorithm perspective, thereby obviating the whole exercise.

So, I’m not saying I understand exactly what you’re after, but as an engineer, I’m sure you know, theory is WAY different than real life.

Once the transmission of this filter function is found, it should be easy to calculate an inverse transformation to bring back the sharpness,

In consideration of what I was saying above, I’m not sure that you can EVER find the inverse transformation.

<shrug>

Peace,
Tony

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

DP
Daryl Pritchard
Jul 1, 2003
Harald,

You’re correct that the high-pass filter can be used for sharpening an image, and it is a pretty common technique in Photoshop even if easily overlooked since "sharpen" isn’t part of the tool’s name. If you do a Google search on the words/phrases "photoshop", "sharpening", and "hi-pass filter", you’ll see links to many sites discussing the technique.

Adding another comment, now seeing Tony’s posting, I’ll just add that while theory may differ somewhat from reality, at least the premise of your idea is correct. And, better yet, without worrying about the theory you can simplify it down to exploring use of the hi-pass filter to sharpen your images.

Regards,

Daryl
GH
Gernot Hoffmann
Jul 1, 2003
Harald,

it´s probably not the forum here for theoretical discusssions.

In a few words & formulas:

OI = Original image
HI = High Pass filtered image
LI = Low Pass filtered image
SI = Sharpened image

SI = OI + HI = 2*OI-LI

HI = OI – LI

The factor 2 comes from the fact that a uniformly colored image is not affected:
SI = 2*OI – OI = OI.

SI should be calculated in one pass. The splitting into two filters may cause unnecessary clipping. The FINAL result has to be clipped for [0,255] in each channel.
If users have the impression that High Pass + Original is better than direct Sharpening, then this may be a result of different implementations of the single filters in PhS (they are not comple- mentary).
Sorry if this shouldn´t be understandable. I have tried to explain it by formulas (and it works in practice).

Best regards –Gernot
EI
Enrique Ivern
Jul 1, 2003
Focus Magic claims to sharpen via ‘unblurring’.
There’s a free demo. Interesting results.
MV
Mathias Vejerslev
Jul 1, 2003
You can sharpen via High Pass.

See

<http://www.2morrow.dk/75ppi/coolpix/actions/>

For example. (Blatant selfpromotion aside – I learned from Bruce Fraser)

Mathias
Y
YrbkMgr
Jul 2, 2003
Well I always knew you could sharpen via high pass, and in fact use Mathias’ action every day. I guess I misunderstood the question.

Sorry for sounding like a dope.
P
Phosphor
Jul 2, 2003
Sharpening an image with the High-Pass filter on a duplicate layer with blend mode set to Overlay, Soft Light, or even Hard Light and using that layer’s opacity as a control has been so commonly cited that it is difficult to credit any one source.

While the technique has been passed along from author to author, what I have never seen is an explanation of why it works. A full explanation is probably too tedious for this forum, but here’s a broad brush look at the process:

The high-pass filter does half the job. It determines where the rate-of-change in brightness exceeds a threshold determined by the radius parameter the user selects. At pixel sites where the threshold is not exceeded, a mid-gray (128) value is assigned to that point. When the threshold is exceeded the gray value laid down deviates from 128—upward or downward depending on the sense of the brightness change, with magnitude depending on the rate-of-change detected.

The blend mode takes over where the High-Pass filter leaves off. They work hand-in-glove. For any of the three blend modes cited—and this is the key idea—the layer has NO EFFECT WHATSOEVER at points where it is mid-gray (most of the image).

The resulting brightness is increased or decreased from the substrate brightness where the layer brightness value (produced by the High-Pass filter)is higher or lower, respectively, than mid-gray. In close to mid-gray the brightness change is hardly noticeable.

Thus, you end up exaggerating the contrast across edges, because it is at edges that high rates of change are detected by the High-Pass filter. You mute the blend mode effect via the layer’s opacity. You control the filter’s effect via the radius.

You probably should use Soft Light, but if you need extreme sharpening not achievable with Soft Light, Overlay will widen the range of possible effects. The Hard Light range is even greater but, although usable, is not really needed and, unless the opacity is set very low, may give bizarre results.

George

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

Related Discussion Topics

Nice and short text about related topics in discussion sections