Paint.NET

Welcome to the Paint.NET forum!
It is currently Wed Feb 10, 2010 12:29 am

All times are UTC


Forum rules


Questions or problems with plugin installation? Click here.



Post new topic Reply to topic  [ 153 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next
Author Message
 Post subject: Feather Plugin - Updated for PdN 3.36! 2008-08-26
PostPosted: Tue Oct 31, 2006 4:51 am 
Offline
2009 Homer Simpson Award winner - Forum Admin
User avatar

Joined: Tue Aug 02, 2005 10:27 pm
Posts: 6904
Location: California, USA Weather: Sunny
Download v2.0 DLL here: BoltBait's Plugin Pack

There have been many requests for a Feather feature (like this one, this one, and this one) so I decided to create it myself.

Thanks goes out to Rick for writing the Gaussian Blur function and to Illnab1024 for sending it to me in Codelab format.

If you don't know what feathering is, take a look at this picture:

Image

Basically, it softens the edges of objects that you are combining to make composit pictures.

Please see this page for :arrow: instructions on how to use it.

Enjoy. 8)
=============================================
EDIT: I have recompiled this effect with the new CodeLab beta and added an icon to the effect and also added a UI that allows specifying the feather amount (from 1 to 5 with a default of 2).
=============================================
EDIT: Updated again. Changed range from 1-5 to 1-10. Also, added the frequently requested freature of a true feather. The original method is called "grow" as it grows the object slightly. The new method is called "shrink" as it makes the edges of the object slightly transparent--the object shrinks slightly. I also moved the effect to the Blurs submenu. Here is the new UI:
Image
(4/15/07 update)
=============================================
FIXED: Updated DLL to fix the UI bug where it gets confused if you move the sliders back and forth too much.
(6/11/07 update)
=============================================
FIXED: Fixed a typo. The last time I built this, I accidentally put "feather2" in the menu instead of "Feather".
=============================================
NEW: I have rewritten this effect from scratch. The effect now shows up in the Effects > Object submenu.
It now includes a third slider to control the strength of the effect.
(1/27/2008 update)
=============================================
NEW: I have rewritten this effect's UI from scratch. It now uses the IndirectUI of Paint.NET.
Image
(2/18/2008 Update)
=============================================
FIXED: I have fixed the Paint.NET 3.36 bug.
(8/26/2008 Update)
Download the update here: BoltBait's Plugin Pack

_________________
Warning: The above post contains sarcasm. Use as directed.
Image
BoltBait's Plugin Pack | CodeLab | More... and a Dominoes Computer Game


Last edited by BoltBait on Fri Jun 15, 2007 12:16 am, edited 16 times in total.

Top
 Profile  
 
 
 Post subject:
PostPosted: Tue Oct 31, 2006 4:54 am 
Offline
User avatar

Joined: Wed Oct 18, 2006 3:20 am
Posts: 173
Location: The City
This sounds cool-- I look forward to trying it out!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 4:55 am 
Offline
Paint.NET Lead Developer
User avatar

Joined: Tue Jul 19, 2005 6:22 pm
Posts: 9255
Location: Kirkland, WA
Heh, did you really copy and paste the Gaussian Blur code to do this? That's intense :) I recommend using composition instead ... basically you just instantiate a BlurEffect instance as part of your effect, and act as a proxy to its Render() method. This makes things much more manageable: the Gaussian Blur code is optimized for performance, and its readability and maintainability suffers as a result.

_________________
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html
Avatar from The Oatmeal, 5 Reasons Pigs Are More Awesome Than You

Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 5:05 am 
Offline
2009 Homer Simpson Award winner - Forum Admin
User avatar

Joined: Tue Aug 02, 2005 10:27 pm
Posts: 6904
Location: California, USA Weather: Sunny
Yes, Rick, Illnab1024 sent me the Gaussian Blur code (which he converted for use in Codelab). Then, I tried to understand it (big mistake--it would help if you'd used decent variable names). I figured it out well enough to modify it to my purpose. Then, I compiled the DLL using Codelab and posted it up.

I hope someone finds it useful. I know I will ;)

_________________
Warning: The above post contains sarcasm. Use as directed.
Image
BoltBait's Plugin Pack | CodeLab | More... and a Dominoes Computer Game


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 2:04 am 
Offline

Joined: Sun Oct 01, 2006 5:17 pm
Posts: 72
Location: Behind you!
Mmm... this isn't exactly what I'd call a feather. Feathering isn't blurring the edges, it's fading the edges to transparent, which is actually doable with the new gradient tool, to an extent.

Not saying this isn't useful, but calling it a feather isn't very accurate. :/

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 3:52 am 
Offline
User avatar

Joined: Wed Nov 30, 2005 11:40 pm
Posts: 1266
Location: Middle Tennessee
Would Faux Antialias work for you?

But anyway, Feather is the best term here I think, because it is easy for the layman to recognize.

_________________
Image
Kitteh all growed up :_(


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 8:46 pm 
Offline
2009 Homer Simpson Award winner - Forum Admin
User avatar

Joined: Tue Aug 02, 2005 10:27 pm
Posts: 6904
Location: California, USA Weather: Sunny
Kaiser Yoshi wrote:
Mmm... this isn't exactly what I'd call a feather. Feathering isn't blurring the edges, it's fading the edges to transparent, which is actually doable with the new gradient tool, to an extent.

Not saying this isn't useful, but calling it a feather isn't very accurate. :/


But, if you think about it, that's EXACTLY what its doing.

If you Gaussian blur a pixel that is sitting next to a totally transparent pixel, it becomes slightly transparent. Then, if you blur that transparent pixel, it takes on some of the color of the previous pixel and becomes slightly less transparent. Isn't that exactly what you describe?

Anyway, I did some experimenting with it and figured out that the blur that I was applying was too small. I had hard set the Gaussian Blur to a radius of 1. I have changed it to 2, recompiled the DLL and re-posted. Except for the smallest of pictures, it is a big improvement.

_________________
Warning: The above post contains sarcasm. Use as directed.
Image
BoltBait's Plugin Pack | CodeLab | More... and a Dominoes Computer Game


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 9:47 pm 
Offline
User avatar

Joined: Tue Jul 25, 2006 10:12 pm
Posts: 3130
Location: Rochester, NY
Looks MUCH better.

_________________
Image
Take responsibility for your own intelligence. ;) -Rick Brewster


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 10:55 pm 
Offline

Joined: Sun Oct 01, 2006 5:17 pm
Posts: 72
Location: Behind you!
BoltBait wrote:
Kaiser Yoshi wrote:
Mmm... this isn't exactly what I'd call a feather. Feathering isn't blurring the edges, it's fading the edges to transparent, which is actually doable with the new gradient tool, to an extent.

Not saying this isn't useful, but calling it a feather isn't very accurate. :/


But, if you think about it, that's EXACTLY what its doing.

If you Gaussian blur a pixel that is sitting next to a totally transparent pixel, it becomes slightly transparent. Then, if you blur that transparent pixel, it takes on some of the color of the previous pixel and becomes slightly less transparent. Isn't that exactly what you describe?


That would be what I'm describing, if the feathered object were a solid color and nothing more.

Image

I made this with the gradient tool, rect to polar, and alpha mask. This is a true feather. On the faded edges, not a single pixel has had an RGB value changed, only the alpha transparency. This is what the feather tool in Fireworks does, and I'm pretty sure that applies to other image editing programs.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 10:57 pm 
Offline
Paint.NET Lead Developer
User avatar

Joined: Tue Jul 19, 2005 6:22 pm
Posts: 9255
Location: Kirkland, WA
BoltBait, you might be able to do that by doing Gaussian Blur like you are doing, and after that copying all the RGB values (not alpha) from src to dst in the render rectangle. This will effectively do the Gaussian Blur but mask it to just the alpha channel.

_________________
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html
Avatar from The Oatmeal, 5 Reasons Pigs Are More Awesome Than You

Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 11:16 pm 
Offline
2009 Homer Simpson Award winner - Forum Admin
User avatar

Joined: Tue Aug 02, 2005 10:27 pm
Posts: 6904
Location: California, USA Weather: Sunny
Rick, the problem with this is that most of the pixels that are being blurred are completely transparent. But, I'll look again at this for the non-transparent pixels.

I'm using the results of the Gaussian blur to slightly expand the size of the new object, not make it smaller.

I played around with making the new object smaller (by only making the edges more transparent) and the results were not looking as good--remember my goal, combining natural objects with a natural background.

Kaiser Yoshi, you are correct. This effect will not work for EVERY image you can come up with. However, for combining natural images, I think you will find it very useful.

EDIT: OK, Rick, I did a test by keeping the RGB values of non-transparent pixels and I couldn't see the difference until I zoomed way in (400%+). And, when I did zoom in and could start to perceive a difference, it didn't look as natural as the regular blur. So, meh. I'm leaving it.

Oh, I'm sure you could come up with a pattern that would show a major difference, but like I said, when used to combine one natural picture with another I think the effect is pretty good.

_________________
Warning: The above post contains sarcasm. Use as directed.
Image
BoltBait's Plugin Pack | CodeLab | More... and a Dominoes Computer Game


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 6:02 pm 
Offline
2009 Homer Simpson Award winner - Forum Admin
User avatar

Joined: Tue Aug 02, 2005 10:27 pm
Posts: 6904
Location: California, USA Weather: Sunny
OK, I found a bug in this filter.

It wasn't properly blurring the bottom and right edge pixel of your selection if your selection was not covering the entire layer.

So, if you have not downloaded the DLL since I posted this message, please do so--it has been corrected.

_________________
Warning: The above post contains sarcasm. Use as directed.
Image
BoltBait's Plugin Pack | CodeLab | More... and a Dominoes Computer Game


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 18, 2006 7:02 am 
Offline
User avatar

Joined: Tue Jul 25, 2006 10:12 pm
Posts: 3130
Location: Rochester, NY
I don't know how to compile the DLL with an icon, but here is one I made.
Image
I was just guessing, but I figured that it had to be 16x16...

_________________
Image
Take responsibility for your own intelligence. ;) -Rick Brewster


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 18, 2006 7:04 am 
Offline
2009 Homer Simpson Award winner - Forum Admin
User avatar

Joined: Tue Aug 02, 2005 10:27 pm
Posts: 6904
Location: California, USA Weather: Sunny
Thanks. I don't either.

Oh, and I had already made an icon, but I think I like yours better.

_________________
Warning: The above post contains sarcasm. Use as directed.
Image
BoltBait's Plugin Pack | CodeLab | More... and a Dominoes Computer Game


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 18, 2006 9:17 pm 
Offline
User avatar

Joined: Tue Jul 25, 2006 10:12 pm
Posts: 3130
Location: Rochester, NY
Thats cool. Now I wanna see yours.

_________________
Image
Take responsibility for your own intelligence. ;) -Rick Brewster


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 153 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Google Adsense [Bot] and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Get your Forumer™ today!

Adding a forum to your website is a great way to get return visitors.

» Get your own Free Forum!

Terms of Use

Privacy Policy

Report Abuse

Copyright © 2003-2010 Forumer. All Rights Reserved. | Copyright © paint.NET & phpBB