Jump to content
How to Install Plugins ×

Erode / Dilate filter


dake

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

 

Link to comment
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.

Link to comment
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!

I am not a mechanism, I am part of the resistance;

I am an organism, an animal, a creature, I am a beast.

~ Becoming the Archetype

Link to comment
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

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Link to comment
Share on other sites

Good job, dake. I can already see very good use for this! :)

Before:

crystals2zd1.png

After:

crystals3ly8.png

v An excellent open–source strategy game—highly recommended.

 

"I wish I had never been born," she said. "What are we born for?"

"For infinite happiness," said the Spirit. "You can step out into it at any moment..."

Link to comment
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?

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Link to comment
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.

Link to comment
Share on other sites

My text tool remains unaffected. I can still add text as usual with the plugin installed.

I am not a mechanism, I am part of the resistance;

I am an organism, an animal, a creature, I am a beast.

~ Becoming the Archetype

Link to comment
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!

Link to comment
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

Link to comment
Share on other sites

Can you compress it in a zip rather than a rar?

No. Way. I've just seen Bob. And... *poof!*—just like that—he disappears into the mist again. ~Helio

Link to comment
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.

Link to comment
Share on other sites

I got the new dll working and it looks good. I like the whole shape option thing!

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Link to comment
Share on other sites

Even better!

crystals4nu2.png

Weird...(literally :P )

v An excellent open–source strategy game—highly recommended.

 

"I wish I had never been born," she said. "What are we born for?"

"For infinite happiness," said the Spirit. "You can step out into it at any moment..."

Link to comment
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

I am not a mechanism, I am part of the resistance;

I am an organism, an animal, a creature, I am a beast.

~ Becoming the Archetype

Link to comment
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

ed-sig2.png.3c040e8f8a7b22d05fbfbad8e5ea6994.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...