Results 1 to 2 of 2

Thread: [Tutorial] Surface Blur for Shapening and Anti-aliasing

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    chilango Con's Avatar
    Join Date
    Aug 2006
    Location
    Victoria, BC, Canada
    Posts
    8,397

    [Tutorial] Surface Blur for Shapening and Anti-aliasing

    Masked Surface Blur Sharpening
    A problem often encountered is blurriness of images when they're scaled up many times their original size. While it's impossible to create more detail out of the blurriness, we can try to sharpen edges as an illusion. The surface blur filter (filter/blur/surface blur) groups sections of the image within a certain threshold, then blurs the section within its borders with a specified blur radius. The advantage of this filter is that it creates hard edges from blurry ones, but the disadvantage is that this filter works with one specified threshold, and subtle details and edges can be lost. While blurry and compressed once-vector images can usually benefit from a single application of the filter, the method breaks down on more complex images with varying edge thresholds, such as photographs.

    Consider this tulip blown up many times its original size:

    The edges are no longer sharp and appear both blurred and jagged.

    Applying a surface blur yields the following result:

    As you can see, I was able to adjust the parameters to sharpen the top of the tulip, but you can see the areas where details fell within the threshold and were blurred to nothing.

    Instead, apply the surface blur on its own layer and give that layer a mask:

    1. Create a layer mask (1)
    2. Select the layer mask (2)
    3. Set foreground colour to black (D)
    4. Use the paint bucket (G) to fill the mask with black
    5. Use a soft brush (B) and set foreground to white (X)
    6. Draw over the edges that I pointed to with green arrows. There's no use using the red ones.
    7. You should now have a black layer mask with white lines on it. Some edges will be sharp, while others will remain blurry:



    It's a good start, but we need to fix those other edges.
    1. Duplicate (Ctrl + J) your original blown up layer.
    2. Apply a surface blur to this new layer, using different parameters this time:



    The goal here is to bring out other edges that the first surface blur missed. Just like before, we're going to give this new layer a mask so only these good edges show up.

    Repeat until you're happy with it:

    Not the best, and it could use a little more work, but it's a great improvement over both the blown up original and the original with a surface blur only. This is also a pretty bad case, the source image is quite small:


    The Lazy Method
    If the scene is pretty big and has a lot of edges, or you're lazy.


    Fuckin thing sucks.


    Again, applying a surface blur gets rid of certain details like the splashes, but it helps to sharpen the high contrast edges. Like in the previous example, we're going to use a mask... but this time we're going to make the mask differently.

    1. Duplicate your original base layer and give it a surface blur that brings detail to key edges
    2. Duplicate the base layer again, only this time apply the find edges filter (filter/stylize/find edges)
    3. Desaturate this layer (Ctrl + Shift + U)
    4. Invert this layer (Ctrl + I)


    You should have something like this:

    In case you're wondering, the faint grid is caused by the block artifacts in JPEG compression.

    Now adjust the levels (Ctrl + L) of this layer:

    Apply a gaussian blur (filters/blur/gaussian blur) that blends the solid white areas into their surroundings, but not too much. Finally, adjust the exposure (image/adjustments/exposure) so the centers of these lines are completely white.

    The next step is to switch over into the channels window and Ctrl + click the RGB icon. This will convert the image intensity into a selection; in other words, bright areas will be selected:

    Now with this selection made, create a layer mask on the surface blur layer.

    Here's a comparison:

    My method keeps the low contrast splashes in the image, but also sharpens the edges. Unfortunately, the JPEG artifacts are only slightly diminished. Removing them would require the combination of this quick method with the previous.


    Removing Aliasing
    The above method for sharpening blurry images can also be used in removing aliasing from game screenshots. We can use the fact that the surface blur filter anti-aliases its regions to our advantage. This is not a quick process, and the time it takes depends on the desired quality and the image itself.



    You can easily see the aliasing here, so what we can do is duplicate the source layer and apply a gaussian blur. The radius of the blur will be just enough to remove any hint of "steps" from the edges.

    Now, work with this blurred layer as if it were a blown up image using the above tutorial on masked surface blur sharpening. The more time you spend specializing for each edge threshold the better. For the purpose of this tutorial, I used one surface blurred layer:


    And just like the above tutorial, we'll create a mask for this layer so it only shows up where we want the anti-aliasing. I don't recommend using the quick and lazy method, but rather taking a small brush (~3 px) and drawing the mask yourself. Once you're done, you can expect something like this:


    Last edited by Con; October 30th, 2009 at 10:32 PM.
    Reply With Quote

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •