Jump to content
How to Install Plugins ×

Curtis' Plugin Pack (Update for 3.5.4)


Curtis

Recommended Posts

OK, the time has finally come for me to post my updated plugin pack, all the plugins have been updated in some way or another, be it UI or compatibility updates and I have added a new plugin.

You will notice that all the color sliders and color wheels are new, these are controls that I have made, they incorporate the additional features that Ed Harvey's controls use so credit for that idea goes to him not me, however I did extend upon his ideas and add a few extra functions.

For the Color Sliders, Holding shift will clamp the value to the nearest increment, these are

  • 15, for Red, Green, Blue, Alpha and Hue sliders
  • 5, for Saturation and Value sliders.

For the Color Wheel, there 6 combinations of Control, Alt and Shift keys that will produce different results, they are the same as Ed Harvey's but I will list them all anyway.

  • Shift - clamps the hue to 15 degree increments.
  • Control - clamps the saturation to the current value.
  • Alt - clamps the hue to the current value.
  • Control + Alt - clamps the hue to the current value and the saturation to increments of 10.
  • Control + Shift - clamps the saturation to the current value and the hue to 15 degree increments
  • Control + Shift + Alt - clamps the hue to an increment of 15 and the saturation to an increment of 10.Anyway, on to the plugins.

 

Download

CurtisBlack.Effects.zip

 

 

 

Spoiler

OLDER VERSIONS:

 


Download for 3.5.4 and newer
This is the beta release for 3.5.4, they may still have problems, please post all bugs or problems in this thread.

 

Download

 

CurtisBlack.Effects.zip

 


Download for 3.36
To install these plugins, extract and place all three files in this zip inside your Paint.Net/Effects folder.

 

CurtisBlack.Effects.v11.zip

 


Tile Image (Distort -> Tile Image) Version 1.3
tile_image_small.png
This was my first ever attempt at a plugin, basically it just tiles the image the selected number of times in each direction. It also has the ability to flip every 2nd image to make the edges of each image line up, with the ability to change the offset of which images get flipped. It started out as a CodeLab script but as I got more familiar with the plugin template I moved it over to add the flipping feature.

Version 1.1
Its now in the proper sub menu for people not using an English Pdn.

Version 1.2
Cleaned up the UI, it now looks like the plugins with the IndirectUI update for 3.30, even thought none of my plugins are property based, (I really should look into how to make property based effects), I thought this plugin would benefit from the new look.

Version 1.3
Improved the performance of this plugin, in my testing I was able to decrease rendering time from 5.17s to 300ms for a 1024x768 image. Now all quality settings take the same time to render.

Jumble (Distort -> Jumble) Version 1.4
jumble_small.png
I can't see this plugin getting used a lot but I thought it was a cool idea, again, it was just something I wanted to do to get more familiar with Visual Studio and the plugin template. Basically all it does is jumble the image, you get to choose the amount of blocks and if you want, you can click Jumble to re-jumble the blocks.

Version 1.1
Same as before, its now in the proper sub menu.

Version 1.2
Again, updated the UI.

Version 1.3
Fixed a bug causing some images to get pixelated when jumbled.

Version 1.4
Improved performance, Rendering time is now half of what it used to be.

Selective Palette (Color -> Selective Palette) Version 1.2
selectivepalettesmall.png
Ok, this is the first of what I consider to be one of my good plugins. What it does is allow the user to build up a list of colours, and then it converts each pixel in the image to the closest colour on the list. To make life easier it also loads and saves these lists in the same format as the Paint.NET Palette file, so if you have any custom palettes, you can quickly load one and see what your image looks like using only those colours.

There are several options with this one so I'll just explain them

  • Random - Adds a random colour to the list, you can specify whether or not you want the alpha to be random and if you want to add more than one colour at a time then you can change that as well.
  • Sort List - Originally I was going to have it auto sort the colours every time you add one, but then I thought, because this can be used to make Paint.NET Palette files, I will leave it up to the user to add colours in their desired order. This option sorts the colours by hue, from 0 to 360.
  • Clean List - Basically it just removes the colours from the list that aren't the closest match to any pixel in the image, its handy if you have a large list and you want to clean it up.

 

Just a note: Large colour lists may take a while to reload when you change them, as I said, I have only been programming for a year, so if anyone has a suggestion on how to make it faster while retaining all its functionality, I am open to suggestions. For small lists though, it really isn't that bad.

Version 1.1
Added a reset button for the colour picker, that's pretty much it.

Version 1.2
This plugin now has those new color sliders and the new color wheel I was talking about and is now compatible with Paint.Net v3.30.

Version 1.3
Now supports several dithering modes as well as loading predefined palettes and the ability to reorder colours in the list.

Equations (Render -> Equations) Version 2.2    (Moderator Note:  as of 6/21/22 this is not working).
equations_small.png
Before I get started I would like to say that there are parts of this plugin that use source code from the CodeLab plugin, so credit for this goes to Tom Jackson and BoltBait. This plugin might be useful to some people, Basically it lets you type in a mathematical equation in one of the given forms and renders it to the image.
There are currently 3 different types of equations you can use.

Regular Equations
These take the form y = some function of x.
Parametric Equations
These take the form y = some function of t and x = some other function of t, here you can use two different functions to represent the x and y coordinates of each point on the line.
Polar Equations
These take the form Radius = some function of theta, where theta is measured in radians, counter-clockwise from the x axis.
You can specify the start angle, the end angle, how much to rotate the whole graph by and, how much to increment theta by, for a smooth curve, the smaller the better, but good blocky results can be obtained by increasing this value.
You also have the options to vary the axis and function width and colour as well as the origin position on the screen, I added a quick help dialog to it which shows a list of common functions you can use in your equations.

Version 2.0
Added a fair few features, including-

  • You can now use lower or upper case functions.
  • The ability to load and save equations for later, it also comes with all the equations I had here, plus more I found while testing, to save you typing them out.
  • The ability to scale both the X and Y axis between 20 and 500 percent of the original value.
  • I changed when it draws the graph, it now only checks if it should draw about 1 second after you stop typing or changing a slider, and then it will only do so if changes are made, this should speed it up a bit.
  • You can now check or uncheck the auto draw option for those people who didn't want it to build while they're typing, even though I changed the when it draws, I thought it might still be useful for some.
  • You can now choose to add arrow heads to the ends of the axis and graph, the code for working out where to place the arrow heads is not perfect so sometimes they will be placed farther than they should from the edges, the code to do it properly would be more complicated and I think this is good enough for now, I might make it better in the future.
  • You can now choose the option to add shading to the graph, there are various different shading modes and styles to choose from, but shading will increase render time, not by heaps, but it is noticeable.
  • Like the other plugins, it now appears in the proper localised sub menu.I also fixed a mistake in the render loop, it should now render a little bit faster than before(without shading that is).


Version 2.1
Thanks to MadJik, it should finally work for everyone, that error preventing some people from using this plugin should now be gone.

Version 2.2
All the text box's now automatically colour your equation to make it easier to read and find any errors. Just a note, most errors will appear black, as everything else will get coloured, but just because its not black, doesn't mean its not an error, for example if you have more left brackets than right, that's an error, but all the brackets will be coloured.

Effects Lab (Advanced -> Effects Lab) Version 1.1
effects_lab_small.png
The newest addition to my plugin pack, this plugin allows you to run an existing effect through a filter, so to speak. All you have to do is find the effect you want to use, click "Use Effect", then fiddle with the effects controls and the filter controls until you get the result you're after.
I have added a search box that searches as you type to help out those with lots of effects, the way it works is that it searches for all effects starting with your search query, so if you start typing "co" it will automatically bring up "Color Balance", "Conditional Hue/Saturation", "CodeLab" etc. To re-display all effects, just clear the search box.
When you click "Use Effect" it will show the effects dialog if it has one and will display the effects name next to the button so you know what effect you are using. If, however, you close the effects dialog, you will loose all the settings for that effect and you will have to start again, but you shouldn't need to be closing the effects dialog unless you want to switch effects as the plugin allows you to access both dialogs simultaneously.
I put this effect in the Advanced sub-menu because I couldn't think where else to put it. I was going to call it "Conditional Effects" or something along that line, but then when I moved it to the Advanced sub-menu I thought I'd stick with Advanced effects naming scheme and call it "Effects Lab". 😉
And before I forget, I would like to thank Pyrochild for helping me out with some problems I was having during development and sharing some of his code for me to have a look at.

Version 1.1
Fixed a bug stopping some effects from working

Fern Fractal (Render -> Fern Fractal) Version 1.2
fern_fractal_small.png
This plugin is pretty self explanatory, all it does is render a fern onto your canvas. You have the option to choose its colour, angle, position, as well being able to scale its width and height. The "Iterations" slider controls the density of the fern, the larger the amount of iterations, the more dense the fern will look.

Version 1.1
Fixed the bug where the fern wouldn't render after you click OK.

Version 1.2
Fixed the bug where it would sometimes crash Paint.NET.

Channel Mask (Object -> Channel Mask) Version 1.2  MODERATORS NOTE:  This effect is incompatible with Paint.NET 4.x
channel_mask_small.png
This plugin comes straight from the mind of Mike Ryan. What he was after was a plugin similar to the Alpha Mask plugin but which had more control over what channels to apply the mask to and what channels of the mask image to mask from. You use this plugin in the same way as you would the Alpha mask plugin, however you will see that each channel has a list of options of where to source the mask channel from, so, if you have a mask image and want to set the alpha channel of your current image to the blue channel of your mask image, you can do that by simply setting the alpha channel source option to blue. You can also choose to strech the mask image or tile the mask image if the dimensions of your current image and your mask image aren't the same. You also have the option to invert the mask channel and to blend it with the original.

It supports all file formats that Paint.NET supports, and any filetype plugins you may have installed, meaning that if you are working on a multilayer .pdn, you don't need to create a new file for masking, simply create a new layer in that file with the mask and then load the file you are working on into the plugin, from there you can then select that new layer you just created from the list. I would like to thank Pyrochild and Mike Ryan for their time testing the plugin and giving me valued feedback, and to Mike Ryan for the actual idea itself.

Version 1.1
The filename text box now remembers the last image locations you have used and includes all the files that are in your Paint.NET recent file list.

Version 1.2
Fixed the bug where it would crash when you try to use the plugin a second time.

Displacement Map (Distort -> Displacement Map) Version 1.1  MODERATORS NOTE:  This effect is incompatible with Paint.NET 4.x
displacement_small.png
This is pretty much the same as the previous Displacement plugin but with more options. The pixels of the image are offset by the amount determined by the map channel and the displacement slider, and are offset in the direction of the angle chooser. Like Channel Mask, you can choose whether the image should be stretched or tiled if the dimensions aren't the same, and it has support for all the filetypes that Paint.NET itself supports.

Version 1.1
Fixed the bug where it would crash when you try to use the plugin a second time.

Blur Map (Blurs -> Blur Map) Version 1.0  MODERATORS NOTE:  This effect is incompatible with Paint.NET 4.x
blur_map_small.png
This is pretty much the same as my Displacement Map plugin except it will blur the image by the value taken from the map image.

Dots (Stylize -> Dots) Version 1.0
dots_small.png
Basically, it turns your image into a grid of dots which you can adjust the size of, and how much highlighting to add to make them look 3D. It was based on the ideas of this tutorial.

Rounded Rectangle (Render -> Rounded Rectangle) Version 1.0
rounded_rectangle_small.png
A lot of people have been wanting to be able to adjust the amount of curve on the corners of the rounded rectangle tool, well, Paint.NET can't do that yet so this is the next best thing.

 

  • Upvote 6
Link to comment
Share on other sites

Hey! Great plugin pack; however, there's already a plugin named "Tiles." Is there any way we could convince you to rename yours (Filename and display name)? "Curtis' Tiles" would be sufficient. :-) Good job either way!

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

It's always cool to have new plugins, can you add reset button to your plugins so users can easily reset everything? (ie. Color picker for Selective Palette and such)

Yeah, and what Daivd said, I thought both plugins can work at the same time if I rename the file name for one of them.

But that's not the case.. :(

Anyways, very cool.

Thanks!

Edit: Possible for Equations to affect the image or does it only make lines? or am I missing something?

The_next_thousand_words_by_0_ASH_0.png

All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ]

Link to comment
Share on other sites

OK, so I renamed Tiles to Tile Image, thats probably more descriptive anyway. I think most of the options have a reset button, but if you want I will add them for all the options that don't have them.

Edit: Possible for Equations to affect the image or does it only make lines? or am I missing something?

Yeah, it doesn't affect the image, it just draws your equation on top of it, I know there were people on here who have asked for custom sine waves and other types of equations where they wanted something more exact then trying to draw it with the line tool.

Link to comment
Share on other sites

Awesome, thank you! :-)

My only complaint (for now) is allayed. Good work!

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

OK, so I renamed Tiles to Tile Image, thats probably more descriptive anyway. I think most of the options have a reset button, but if you want I will add them for all the options that don't have them.
Edit: Possible for Equations to affect the image or does it only make lines? or am I missing something?

Yeah, it doesn't affect the image, it just draws your equation on top of it, I know there were people on here who have asked for custom sine waves and other types of equations where they wanted something more exact then trying to draw it with the line tool.

Thanks for the quick reply :)

Please add some reset button if it's not too much trouble.

And is it possible to make Equations to affect the image? Then the plugin would have almost endless possibilities.

Thanks!

The_next_thousand_words_by_0_ASH_0.png

All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ]

Link to comment
Share on other sites

I agree with you Ash, but that would require an entire rewrite (Equations affecting the image)

Also, can you release the src? I have been learning C# now for about two months and these look like some prime examples. (Please!)

Again, I made some crazy seashels using Equations. I am loving the fact that I now have a reason to continue taking math

signature.png

Link to comment
Share on other sites

Very nice plugins, especially for a C# newbie!

A couple suggestions:


  • [*:1xrk1wni]Could you add scaling to Equations? Currently, I'm working around this by multiplying x by a constant less than 1 and multiplying the entire equation by the constant's reciprocal.
    [*:1xrk1wni]Could you allow lowercase function names? (i.e. "y= sin(x)")
    [*:1xrk1wni]Instead of rerendering each time the input equation is changed, render only if no changes have been made in a few seconds, like Codelab.

Link to comment
Share on other sites

I agree with you Ash, but that would require an entire rewrite (Equations affecting the image)

Also, can you release the src? I have been learning C# now for about two months and these look like some prime examples. (Please!)

Again, I made some crazy seashels using Equations. I am loving the fact that I now have a reason to continue taking math

Yeah, it would require me to change how it draws the image, as it stands currently, it just draws a series of lines on top of the current image. My goal from the start was really only to do that but if you can you give me a couple of ideas of how you want it to affect the image, and I will see what I can do.

I will post the source code for them soon, I just realised that the Equations plugin, doesn't work as it should when you try to apply it to a selection, it draws the image in the wrong spot, I had that working properly but I think I changed it somewhere by accident. Let me fix that up, then I'll post it.

Link to comment
Share on other sites

Something like GIMP's Mathmap plugin. http://www.complang.tuwien.ac.at/schani ... shots.html

I tried it while testing Escher/Droste effect using GIMP, when PDN didn't have that plugin.

Like I said..."almost endless possibilities." :)

Would be one of the most powerful plugin for PDN if it's possible.

Thanks for your time!

The_next_thousand_words_by_0_ASH_0.png

All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ]

Link to comment
Share on other sites

Very nice plugins, especially for a C# newbie!

A couple suggestions:


  • [*:1fnh5e6z]Could you add scaling to Equations? Currently, I'm working around this by multiplying x by a constant less than 1 and multiplying the entire equation by the constant's reciprocal.
    [*:1fnh5e6z]Could you allow lowercase function names? (i.e. "y= sin(x)")

Scaling should be possible, it would probably be a good idea to have the option to scale each axis by a different amount wouldn't it, I'll see what I can do.

About the lower case functions, before it renders the equation, it converts all the functions to c# functions, for example, "Sin(x)" gets converted to "Math.Sin(x)", originally I wanted all the functions to be lower case but what happened when I tried this was that functions which have similar names would get converted when they shouldn't, for example, if your equation included "acos(x)" that would get converted to "Math.Acos(x)", no problems there but it would then convert that to "Math.AMath.Cos(x)" because it saw a lower case cos. So to stop this I had to make the start of each function a capital.

Here is the part of the code that does that, as you can see, I had that problem with "e" and the e in "height" and in "theta", (width and height are both integers, hence the need to convert to double to get smooth equations).

private string ParseEquation(string equation)
{
       equation = equation.Replace("Abs(", "Math.Abs(");
       equation = equation.Replace("Acos(", "Math.Acos(");
       equation = equation.Replace("Asin(", "Math.Asin(");
       equation = equation.Replace("Atan(", "Math.Atan(");
       equation = equation.Replace("Atan2(", "Math.Atan2(");
       equation = equation.Replace("Cos(", "Math.Cos(");
       equation = equation.Replace("Cosh(", "Math.Cosh(");
       equation = equation.Replace("Exp(", "Math.Exp(");
       equation = equation.Replace("Log(", "Math.Log(");
       equation = equation.Replace("Min(", "Math.Min(");
       equation = equation.Replace("Max(", "Math.Max(");
       equation = equation.Replace("Pow(", "Math.Pow(");
       equation = equation.Replace("Sin(", "Math.Sin(");
       equation = equation.Replace("Sinh(", "Math.Sinh(");
       equation = equation.Replace("Sqrt(", "Math.Sqrt(");
       equation = equation.Replace("Tan(", "Math.Tan(");
       equation = equation.Replace("Tanh(", "Math.Tanh(");
       equation = equation.Replace("pi", "Math.PI");
       equation = equation.Replace("e", "Math.E");
       equation = equation.Replace("hMath.Eight", "(1.0*height)");
       equation = equation.Replace("width", "(1.0*width)");
       equation = equation.Replace("thMath.Eta", "theta");
       return equation;
}

I do agree it would be better if all the functions were lower case, and now that I think about it, it might be possible, let me fiddle with it some more.

Something like GIMP's Mathmap plugin. http://www.complang.tuwien.ac.at/schani ... shots.html

I tried it while testing Escher/Droste effect using GIMP, when PDN didn't have that plugin.

Like I said..."almost endless possibilities." :)

Would be one of the most powerful plugin for PDN if it's possible.

Thanks for your time!

I will have to go and check that out. :)

Link to comment
Share on other sites

I'm guessing that the user's code is passed through that method and compiled into a C# class. In that case, you can define methods instead of replacing strings.

public class Equation {
public void Evaluate(double x) {
	return [stuff user typed];
}

private const double PI = Math.PI;
private const double pi = Math.PI;
private double width;
// etc.

private double cos(double x) {
	return Math.Cos(x);
}

private double Cos(double x) {
	return Math.Cos(x);
}

// etc.
}

Link to comment
Share on other sites

Cool, especially the Selective Palette. :)

Just an observation:

Jumble renders some blocks pixelated (aliased) if image width or height doesn't divide exactly by number of blocks.

For example 4x4 blocks on 725x497 image. Not critical but maybe you want to fix this.

Link to comment
Share on other sites

I'm guessing that the user's code is passed through that method and compiled into a C# class. In that case, you can define methods instead of replacing strings.

public class Equation {
public void Evaluate(double x) {
	return [stuff user typed];
}

private const double PI = Math.PI;
private const double pi = Math.PI;
private double width;
// etc.

private double cos(double x) {
	return Math.Cos(x);
}

private double Cos(double x) {
	return Math.Cos(x);
}

// etc.
}

Thats such a simple but good solution, I don't know why I didn't think of it :? , I will do that for the update, thanks. :)

Cool, especially the Selective Palette. :)

Just an observation:

Jumble renders some blocks pixelated (aliased) if image width or height doesn't divide exactly by number of blocks.

For example 4x4 blocks on 725x497 image. Not critical but maybe you want to fix this.

I did have this happen once but could not have it do it again to work out why, thanks for letting me know.

Link to comment
Share on other sites

You know, writing a recursive-descent parser and building up a System.Linq.Expressions.Expression tree wouldn't be that difficult. I highly recommend it -- using string.Replace() is not a very good way to go about this. You'll learn a lot, too. Parsers are good stuff to learn.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Sorry, but I have a request. With the equations, is there anyway that you can get rid of the autopreview and have a preview button instead? It really slows down my PC when I am trying to write out an equation and it is rendering as I go. Thanks!

signature.png

Link to comment
Share on other sites

You know, writing a recursive-descent parser and building up a System.Linq.Expressions.Expression tree wouldn't be that difficult. I highly recommend it -- using string.Replace() is not a very good way to go about this. You'll learn a lot, too. Parsers are good stuff to learn.

I couldn't agree more.

I wrote a recursive-descent parser in compiler design class when I was in college. Of course, you'll need to start by writing a tokenizer... and come up with a language definition... but, after that, it's easy!

Link to comment
Share on other sites

You know, writing a recursive-descent parser and building up a System.Linq.Expressions.Expression tree wouldn't be that difficult. I highly recommend it -- using string.Replace() is not a very good way to go about this. You'll learn a lot, too. Parsers are good stuff to learn.

I couldn't agree more.

I wrote a recursive-descent parser in compiler design class when I was in college. Of course, you'll need to start by writing a tokenizer... and come up with a language definition... but, after that, it's easy!

Is it bad if I'm about to graduate college with a CIS degree...and I have no idea what you're talking about? :P

Link to comment
Share on other sites

You know, writing a recursive-descent parser and building up a System.Linq.Expressions.Expression tree wouldn't be that difficult. I highly recommend it -- using string.Replace() is not a very good way to go about this. You'll learn a lot, too. Parsers are good stuff to learn.

I couldn't agree more.

I wrote a recursive-descent parser in compiler design class when I was in college. Of course, you'll need to start by writing a tokenizer... and come up with a language definition... but, after that, it's easy!

Is it bad if I'm about to graduate college with a CIS degree...and I have no idea what you're talking about? :P

Unbelievably. Yes.

Link to comment
Share on other sites

I have just one compaint. The pieces on the Jumble plugin seem to be more pixelated. :? That is all.

Everything else is absolutely wonderful. I hope to see more plug-ins from you. Very nice!! :)

ryansigmoon.png
Link to comment
Share on other sites

I was planning on writing an equations plugin. Now I don't have to :D

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

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...