Jump to content
How to Install Plugins ×

Enormators Effects


Enormator

Recommended Posts

Right here:

http://paintdotnet.12.forumer.com/viewtopic.php?t=4828

...To make a border, run this with no selection....

EDIT:

MadJik's new gridmaker would also kinda work(with its independent horizontal and vertical size settings). You would just need to erase the lines that extend out of your "border"...

EDIT #2:

Or this Border/Stroke...

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Link to comment
Share on other sites

i've got something that should be easy enough to make:

Border Plugin

please :D

Try this with codelab:

(only for square/rectangle selections/images)

int Amount1=2;	//[0,100]Distance from the edge
int Amount2=2;	//[0,100]Border width

void Render(Surface dst, Surface src, Rectangle rect)
{
   PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds);
   Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();

   long MaxX = (long)(selection.Right - selection.Left);
   long MaxY = (long)(selection.Bottom - selection.Top);
   ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;

   ColorBgra CurrentPixel;
   for(int y = rect.Top; y < rect.Bottom; y++)
   {
       for (int x = rect.Left; x < rect.Right; x++)
       {
           if (selectionRegion.IsVisible(x, y))
           {
               CurrentPixel = src[x,y];
               if ((x>=Amount1) && (x=Amount1)  && (y                if ((x>=MaxX - Amount1 - Amount2) && (x=Amount1)  && (y                if ((x>=Amount1) && (x=Amount1)  && (y                if ((x>=Amount1) && (x=MaxY - Amount1 - Amount2) && (y                dst[x,y] = CurrentPixel;
           }
       }
   }
}

  • Like 1
Link to comment
Share on other sites

I think that DotAtCenter is a genius idea. Maybe you could add an option though to create straight lines that radiate left and right from the dot - so you'd have a line all the way across the selection at the very center of the y-axis, and a line all the way across the selection at the very center of the x-axis. I think that would be incredibly useful.

 

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

Nice that you solved that problem without my help.

Back to the unsolved prob: Lensflare. If someone tells me how to make a random number in Codelab, it will be coded soon.

You could test this:

int Amount1=97;  //[0,100]Frequency

void Render(Surface dst, Surface src, Rectangle rect)
{
 PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds);
 Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();

 // Create a random number to initiate the reseed value
 int reseed = 0;
 Random randinit = new Random();
 if (reseed == 0) reseed = randinit.Next((int)(rect.Bottom * rect.Right + 1));

 // rand = Random number generator
 Random rand = new Random(reseed);

 ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;

 ColorBgra CurrentPixel;
 for(int y = rect.Top; y < rect.Bottom; y++)
 {
   for (int x = rect.Left; x < rect.Right; x++)
   {
     CurrentPixel = src[x,y];
     float pixel = rand.Next(101); // rand.Next(100) will give a integer number between 0 and 100
     if (pixel <= Amount1 ) 
     {
       CurrentPixel.R = (byte)PrimaryColor.R;
       CurrentPixel.G = (byte)PrimaryColor.G;
       CurrentPixel.B = (byte)PrimaryColor.B;
       CurrentPixel.A = (byte)PrimaryColor.A;
     }
     dst[x,y] = CurrentPixel;
   }
 }
}

Link to comment
Share on other sites

So: Now some prework for lens flares to understand random classes. An effect which makes the whole pic random and affects alpha too.

It isn't the same as adding noise because adding noise also takes some information from the source. This is completely random.

I'll look after that centered line when I got some time.

But: Class test in German tomorrow.

Link to comment
Share on other sites

So: Now some prework for lens flares to understand random classes. An effect which makes the whole pic random and affects alpha too.

It isn't the same as adding noise because adding noise also takes some information from the source. This is completely random.

I'll look after that centered line when I got some time.

But: Class test in German tomorrow.

Link to comment
Share on other sites

So: Now some prework for lens flares to understand random classes. An effect which makes the whole pic random and affects alpha too.

It isn't the same as adding noise because adding noise also takes some information from the source. This is completely random.

I'll look after that centered line when I got some time.

But: Class test in German tomorrow.

I'm getting better and better (IMO) everydays, so you could find a better random example here:

http://paintdotnet.12.forumer.com/viewtopic.php?t=4997

or here

http://paintdotnet.12.forumer.com/viewtopic.php?t=4996

...for you to look at the day after tomorrow so. :wink: Good L...

Link to comment
Share on other sites

So: Now some prework for lens flares to understand random classes. An effect which makes the whole pic random and affects alpha too.

It isn't the same as adding noise because adding noise also takes some information from the source. This is completely random.

I'll look after that centered line when I got some time.

But: Class test in German tomorrow.

I'm getting better and better (IMO) everydays, so you could find a better random example here:

http://paintdotnet.12.forumer.com/viewtopic.php?t=4997

or here

http://paintdotnet.12.forumer.com/viewtopic.php?t=4996

...for you to look at the day after tomorrow so. :wink: Good L...

Link to comment
Share on other sites

Anyway I didn't feel like learning for the class test so I made the Centerlines thing.

Again two versions: One just draws a one dot wide line and with the other one that depends on the evenity of the pic.

Is it slowly becoming annoying that there are so many small Enormator effects in the Render menue? Should I make an Enormator directory?

Link to comment
Share on other sites

Anyway I didn't feel like learning for the class test so I made the Centerlines thing.

Again two versions: One just draws a one dot wide line and with the other one that depends on the evenity of the pic.

Is it slowly becoming annoying that there are so many small Enormator effects in the Render menue? Should I make an Enormator directory?

Link to comment
Share on other sites

Is it slowly becoming annoying that there are so many small Enormator effects in the Render menue? Should I make an Enormator directory?

The idea isn't bad, but I`m afraid that in a few months "effects" will look like this:

effectsnd8.png

This would be annoying, there's still space left in "render" I think...

BTW, when you use other languages than English your effects menue has already lesser space, because some plugins don' accept the namespaces of your language (French/German/etc) and create their own subdirectorys:

frenchgk4.png

germanoi6.png

The point I don't understand is that a couple of plugins (e. g. Madjik's Water and Waves) use the correct subdirs of your language, while the other ones don't do it. But this is another discussion...

So, at the moment "Render" is still fine for your plugins. :)

Link to comment
Share on other sites

Is it slowly becoming annoying that there are so many small Enormator effects in the Render menue? Should I make an Enormator directory?

The idea isn't bad, but I`m afraid that in a few months "effects" will look like this:

effectsnd8.png

This would be annoying, there's still space left in "render" I think...

BTW, when you use other languages than English your effects menue has already lesser space, because some plugins don' accept the namespaces of your language (French/German/etc) and create their own subdirectorys:

frenchgk4.png

germanoi6.png

The point I don't understand is that a couple of plugins (e. g. Madjik's Water and Waves) use the correct subdirs of your language, while the other ones don't do it. But this is another discussion...

So, at the moment "Render" is still fine for your plugins. :)

Link to comment
Share on other sites

there are two problems with the lense flare thing:

1. I can't draw lines from up to down because... I don't know why I can't! These lines should be only one from the top to the point where they end and at their end they shouldn't begin again with white but stay black!

bug01ebf_thumb.jpg

I have used alpha to grayscale on it to make it better viewable.

2. This is amazingly slow in rendering and I have no idea why.

void Render(Surface dst, Surface src, Rectangle rect)
{
   PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds);

 // Create a random number to initiate the reseed value
 int reseed = 0;
 Random randinit = new Random();
 if (reseed == 0) reseed = randinit.Next((int)(rect.Bottom * rect.Right + 1));

 // rand = Random number generator
 Random rand = new Random(reseed);
   // Delete any of these lines you don't need
   Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();

   long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left);
   long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top);
   ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;
   ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor;
   int BrushWidth = (int)EnvironmentParameters.BrushWidth;

   ColorBgra CurrentPixel;
   for(int x = rect.Left; x < rect.Right; x++)
   {
       int lenght = rand.Next(selection.Bottom - selection.Top -1) + 1;
       for (int y = selection.Top; y < selection.Bottom; y++)
       {
           if ((selectionRegion.IsVisible(x, y)) && (y<=lenght))
           {
               if ((y <= lenght) && (y == 0 || (src[x,y - 1].A != 0)))
               {
               CurrentPixel = src[x,y];
               // TODO: Add pixel processing code here
               // Access RGBA values this way, for example:
               CurrentPixel.R = 255;
               CurrentPixel.G = 255;
               CurrentPixel.B = 255;
               CurrentPixel.A = (byte)(255*(lenght-y)/lenght);
               dst[x,y] = CurrentPixel;
               }
           }
       }
   }
}

Any ideas?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...