Edge Detecting UDFs(Note: If you're unfamiliar with User Defined Filters (UDFs), then please take a look at UDF Basics before working through this tutorial.). In our first UDF tutorial we looked at the basic rules of thumb for making UDFs, and we made a couple blur filters. In the second UDF tutorial, we made some sharpen filters. In this tutorial, we'll make a couple edge detecting filters. With the blur filters, we added to the UDF matrix positive peripheral cell values around a positive central value. For the sharpening filter, we used a positive central value but surrounded the central cell with negative values. For edge filters, the central value is what's negative, with positive surrounding values. Here's our rule of thumb for Edge Detecting filters: For an edge filter, use a negative center value and surround it with a symmetrical pattern of positive values. To create your first edge filter, choose Image | User Defined Filters and click Edit. Then fill in the matrix like this:
Remember that in general you maintain the overall brightness of your original image by using values in the matrix that sum to 1. Here we have a central value of -7 and eight surrounding cells filled with 1, for a sum of 1. Applying this filter gives this result:
The effect here is quite extreme, but don't forget another rule of thumb mentioned in the other UDF tutorials: Lessen the effect of a filter by increasing the value in the center cell; compensate with the appropriate Division Factor to maintain the brightness of the original image. Let's give it a try. We'll modify our original edge filter this way:
We've increased the central value from -7 to -2. The sum of the matrix values now is 6, since we have a central value of -2 and eight surrounding cells filled with 1. To adjust this sum to get 1, we set the Division Factor to 6. Here's the result this time:
This more-subtle effect (which is approaching a blur effect) might be a good start for a digital painting. Experiment with your own selected values. Maybe try placing positive values in the corner cells, with or without interior positive cells. That's all for edge detecting UDFs. Soon I'll add a tutorial on making your own embossing filters. Until then, enjoy expLamanderng! Back Copyright ©2000 Lamander |