Sign in to follow this  
John Stewien

Stewien Filters First Release 2009-03-23

Recommended Posts

Stewien Filters is a Paint.NET plugin project I’ve just started working on. I’ve got some background in image processing in the medical industry, and I wanted to apply some of that experience to creating Paint.NET plugins. Although what I’ve done so far is pretty simple.

I’ve put up some documentation and sample images on a web site with separate web pages for each filter. This is the first release (version 1.2) and instead of releasing all the filters as separate DLLs and hard coding the parent menu into the filters, I’ve instead included an XML file that allows the user to configure which filters are visible, and which parent menu the filters come under. The XML file goes in the same location as the DLL. If missing the DLL will create a new XML file with default options.

Let me know what you think about this configuration method.

The filters are open source and are hosted on SourceForge as part of my StewienMisc project. The binary DLL, and xml file are in a zip archive that can be downloaded from

http://sourceforge.net/project/showfiles.php?group_id=208437

The filters included in this version are (links contain screenshots):

Dilate (see http://stewienfilters.com/Dilate.aspx)

Kuwahara Filter (see http://stewienfilters.com/KuwaharaFilter.aspx)

Kuwahara Filter Modified (see http://stewienfilters.com/KuwaraharaFilterModified.aspx)

To Angle (see http://stewienfilters.com/ToAngle.aspx)

Transparency By Color Subtraction (see http://stewienfilters.com/TransparencyByColor.aspx)

Share this post


Link to post
Share on other sites
Any screens to see what these plugins can do? I think it would be useful...

Hi Red Falcon, the links next to the Filter names contain screen shots of what the filters do. I modified the original post to explain this more clearly.

Share this post


Link to post
Share on other sites

interesting but I'd really rather have dll not being a computor expert I've no idea what to do with the xml. (actually I do but that's what quite a few are going to be telling you, if you look at all the posts help! I can't install plugin x, or y or z)

a pkg of dlls is great by me. similar to how madjik does it is the easiest to understand. although how Pyrochild does his with the common dll isn't too hard to understand either.

just a few pennies worth from this old gal.

ciao

OMA :wink:

EDIT; no I don't understand where they go afterall. and If I don't get it I'm sure there will be others. not going to download now even if they do look like great additions.

Share this post


Link to post
Share on other sites

@Simon

I’ve instead included an XML file that allows the user to configure which filters are visible, and which parent menu the filters come under. The XML file goes in the same location as the DLL. If missing the DLL will create a new XML file with default options.

sound like a nightmare to you?

Share this post


Link to post
Share on other sites

I meant that you should list the default menus.

sound like a nightmare to you?

Now I think about it, I agree - it may lead to the problem Rick described: users not being able to find it for tutorials and general use.

Share this post


Link to post
Share on other sites
users not being able to find it for tutorials and general use.
It is for this very reason why I'm going to ask you John Stewien to change the method you have employed here.

It is a great idea, don't get me wrong. Mind, however, that it will be far less hassle for both you and us if you present your plugins with a more straight-forward approach.

Share this post


Link to post
Share on other sites
If missing the DLL will create a new XML file with default options.

In other words, if you don't want to mess with it, you don't have to. I see no reason why OP should have to change anything.

Share this post


Link to post
Share on other sites
If missing the DLL will create a new XML file with default options.

In other words, if you don't want to mess with it, you don't have to. I see no reason why OP should have to change anything.

so explain to me inbetter the steps I need to do to try these out?

some look quite similar to others we have already.

Share this post


Link to post
Share on other sites
so explain to me inbetter the steps I need to do to try these out?

Unzip the archive, copy the .DLL to the effects directory where Paint.NET is installed. The filters will appear in Paint.NET under the "StewienFilters" parent menu. Optionally you can edit the xml file.

some look quite similar to others we have already.

Quite likely as what I've done so far is fairly simple. I'm going to add some more filters. Looking through this forum I think most of the plugins are for effects rather than image filters. I just thought I would post what I had already to see if people complain about my setup for example:

A) The download is from SourceForge which requires a couple of clicks

B) The filters are grouped under "StewienFilters" parent menu by default

C) I've set up a dedicated website with sample images that people have to go to if they want to preview what the filters do

D) I haven't posted the source code in a convenient .zip archive

Share this post


Link to post
Share on other sites

http://stewienfilters.com/TransparencyByColor.aspx

The Transparency By Color function works by removing a color such that when you set that color to the background underneath the processed image it looks normal. You might notice that this filter doesn't round trip properly when you blend back with the color that was removed, this is a GDI+ issue with Paint.NET. See this post:

Why are you blaming GDI+ and Paint.NET? You have access to the raw pixel data, you can do whatever pixel manipulation you want.

Share this post


Link to post
Share on other sites
Why are you blaming GDI+ and Paint.NET? You have access to the raw pixel data, you can do whatever pixel manipulation you want.

Hi Rick,

My "Transparency by Color" filter removes the color, to round trip back to the original image an underlying layer needs to be filled with the color that was removed, and then the image needs to be flattened using the built in Paint.NET functionality. After doing this there seems to be some quantization errors which I reported in my bug report post that I linked to, and that you responded to saying it was a GDI+ issue. If you like I can remove the bit about how it doesn't round trip properly. I tried to get around it by biasing the values that came out of the transparency by color filter, but that ended up overshooting the required values.

Share this post


Link to post
Share on other sites

The post you linked to, where you draw a rectangle, involves a shape tool that uses GDI+. In that case yes, GDI+ is mishandling alpha composition. However, the layer composition and effects systems in Paint.NET are not dependent on GDI+. The RenderArgs provides a Graphics and Bitmap for convenience, but those only come in to play if you choose to use them. What you are seeing is thus neither a Paint.NET nor a GDI+ bug, and is simply (as far as I can tell) an artifact of the limited precision available when using 8 bits per channel.

Share this post


Link to post
Share on other sites
What you are seeing is thus neither a Paint.NET nor a GDI+ bug, and is simply (as far as I can tell) an artifact of the limited precision available when using 8 bits per channel.

I've changed the web page to read "You might notice that this filter doesn't quite round trip properly when you blend back with the color that was removed, this is likely due to a precision error from working in 8-bits per channel."

Paint.NET is a great platform, I hope I can find the time to contribute something a bit more interesting in the future.

Share this post


Link to post
Share on other sites

Actually, even that statement is slightly misleading ;) It isn't a precision error. It's an error due to lack of precision. The precision itself is not an error :)

Share this post


Link to post
Share on other sites
Actually, even that statement is slightly misleading

Thinking about it, this minor issue probably isn't worth mentioning as many users won't know what I'm babbling on about, so I've removed all mention of it. Discussions of limitations are probably best left for the forum :mrgreen:

Share this post


Link to post
Share on other sites

hey john, I havn't yet downloaded your plugins (I'm writting this quickly before school...), but it looks pretty nice, I love the painting effect on the kamashumashua or something like that :lol: And the dilate effect looks like a low median blur, which i use all the time :)

Share this post


Link to post
Share on other sites

Yes! The XML file means I HAVE COMPLETE CONTROL! God bless you sir. God bless your pants right off. It would be a major paradigm shift, but I wish all the plugins were like this. I get fussy about how things are organized, so the more control I have, the more fun I have while creating. Things go where they make sense TO ME. ;) Thanks!

Share this post


Link to post
Share on other sites
Yes! The XML file means I HAVE COMPLETE CONTROL! God bless you sir. God bless your pants right off. It would be a major paradigm shift, but I wish all the plugins were like this.

Your the first person who liked my little scheme. I'm going to have to change it a little bit though so as to please more people. I'm going to:

- Split up all the functions into separate DLLs

- Change the default parent menu items to be the standard menu items

But I will be retaining the single XML file that can be used to change the default parent menu items. What will change is that instead of turning off a function in the xml file, you simply remove the DLL for that function.

Share this post


Link to post
Share on other sites
the dilate effect looks like a low median blur, which i use all the time :)

If you need something of similar behaviour, but slightly different, let me know and I'll see if I can code it up. BTW what is a kamashumashua? do you mean the Pelican?

Share this post


Link to post
Share on other sites

Hello,
The Transparency By Color Subtraction is a neat idea, but there seems to be an issue (v1.2), I tested it by loading Jurvetson’s “bloody moon” image and attempted to turn the orange moon green (kept a green layer at full intensity behind), and there seemed to be an issue... The lower ridge of the moon remained dark red almost until fully replaced (see the part about overbrightening, at that time it would then suddenly flip the pixel transparent) - I would have thought that it would scale here too.

 

Other apparent issues was the upper ridges remaining bright green, but its probably because of the original image (The transparency seemed to be misaligned), and, when adjusted for red replacement it seemed to be overbrightening the moon green (but is to be expected, needs to add green if it were to retain the orange it had while having a red background). I would like a calculator to find the average shade of colour in a selection (the colour returned is at full intensity) so i can input the optimal shade for replacement.

Thanks!
Before   /   After part replacement
post-147485-0-23185100-1464832875_thumb.post-147485-0-07978700-1464832896_thumb.

Edited by charlieb000

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