Sign in to follow this  
dake

Erode / Dilate filter

Recommended Posts

Erode/dilate filter. The dilatation is one of the most simple way to remove scratches and noise from an uniform background.

Updated version (0.2) :
DLL : http://www.freewebs.com/dakepdn/ErodeDilate_v0.2.dll
SRC : http://www.freewebs.com/dakepdn/ErodeDilateSrc_v0.2.rar

ErodeDilate_v0.2.dll.zip

 

Examples :

dilate_scratch_removal_before.jpg
dilate_scratch_removal_after.jpg

With a higher intensity you can achieve kindoff artistic effects :

erode.jpg

 

Share this post


Link to post
Share on other sites

All pics editors have dilate and erode... except PDN :) The erode somehow looks like a rough version of the median filter, don't know if it may be useful. I sometimes used such filters in the past, to enhance contour detection for example.

Share this post


Link to post
Share on other sites

Sweet genius!

I was actually thinking about this the other day. It's one thing that I really liked in The GIMP that I missed when working in PDN. And it seems to work rather well!

Thank you!

Share this post


Link to post
Share on other sites
Erode/dilate filter. The dilatation is one of the most simple way to remove scratches and noise from an uniform background.

I understand that this is similar to the Median Blur effect. I used the Median Blur effect remove the power lines in the image below. With your plugin the edited areas were to blocky at any intensity to be useful. The Median Blur makes it less noticeable that the image was edited.

Original:

PowerLines.jpg

Edit:

PowerLinesEdit-1.jpg

Share this post


Link to post
Share on other sites
crystals3ly8.png

That has a cool crystalline look to it.

This looks like the exact same as Median, except with a square shaped area instead of a circle shaped area.

There's one other difference I can see...

Median blur is more configurable.

This would do well as a check box on the Median Blur effect...Square/Circle?

Share this post


Link to post
Share on other sites

Could someone confirm if this plugin affects the 'Text' tool? After installing it, I couldn't insert any text onto a new layer. Succeeded after removing the new plugin. Wonder if this problem is peculiar to my notebook or whether it is a more widespread problem.

Share this post


Link to post
Share on other sites

Awesome! I'll use this definatly.. It really looks like it could be more of a photo editing tool than a "Paint" tool... But its efficiant enough to be used as both!

Share this post


Link to post
Share on other sites

The erode/dilate filter can be extended to have a smooth shape around the pixels (instead of a square). The filter basically works like this : you define a box around each source pixel (the box size is set by the intensity) and you find the brightest pixel in this small area (ie. the brightest neighbour in the source picture). The destination pixel is then replaced by the brightest pixel. The erode is exactly the same except that you use the darkest pixel.

Now, instead of using a square area, one could use a circle, a star, whatever (though you must keep in mind that you can not have a large shape otherwise it would take ages to complete). I will try to add some shapes to see if it comes up with interesting effects, not to replace the median blur but to have some "crystalize" effects.

To Rick : I have to check your median code but I would say it is different. A median blur is (by definition) not based on the brightest or darkest pixel in the area of interest but by the neighbour which is in the middle of the neighbours list after sorting. You may be interested in this :

http://homepages.inf.ed.ac.uk/rbf/HIPR2/morops.htm

Share this post


Link to post
Share on other sites

For a strange reason, Freewebs doesn't accept the zip (which is less than 750k) :

FreeWebs accounts newer than 7 days are provisional and can only upload files up to 750K. Provisional users also can not upload .exe files. You can remove this provision immediately by signing up for a premium service.

Share this post


Link to post
Share on other sites

I'm loving the update!

I have noticed that, when used on shapes on transparent layers, you get rough edges.

erodedilate.png

Is is possible to correct this?

It works excellently on solid layers, though. :D

Share this post


Link to post
Share on other sites

To Rick : I have to check your median code but I would say it is different. A median blur is (by definition) not based on the brightest or darkest pixel in the area of interest but by the neighbour which is in the middle of the neighbours list after sorting.

Dake,

I'm sure Rick is well aware of the definition of a median filter :)

To get a median filter as you defined above, you need to sort the values.

If you have the values sorted, it is trivial to get the max or min value, or anywhere in between (the 'percentile').

Can you now see how the pdn Median filter is a somewhat more sophisticated version of yours (all be it with a circular neighbourhood selection) ?

Ed

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this