Ash Posted June 5, 2007 Share Posted June 5, 2007 Exactly like that...assuming you did it with code, and not by making a circular ellipse and then resizing it. Sorry, Reshaped it. :? But it works just as well, for the moment. Would be cool if it's a tool. Quote All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ] Link to comment Share on other sites More sharing options...
Ash Posted June 5, 2007 Share Posted June 5, 2007 Exactly like that...assuming you did it with code, and not by making a circular ellipse and then resizing it. Sorry, Reshaped it. :? But it works just as well, for the moment. Would be cool if it's a tool. Quote All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ] Link to comment Share on other sites More sharing options...
PineappleQc Posted June 6, 2007 Share Posted June 6, 2007 Hey is the plugin supposed to be located in a special folder in the effect list? I just cant seem to find it althought I'm pretty sure I put it in the right folder.. Quote "Ah, i love it when huge pineapples try to take over the world, it makes me sentimental :')" -Stephan Link to comment Share on other sites More sharing options...
PineappleQc Posted June 6, 2007 Share Posted June 6, 2007 Hey is the plugin supposed to be located in a special folder in the effect list? I just cant seem to find it althought I'm pretty sure I put it in the right folder.. Quote "Ah, i love it when huge pineapples try to take over the world, it makes me sentimental :')" -Stephan Link to comment Share on other sites More sharing options...
Ash Posted June 6, 2007 Share Posted June 6, 2007 For me it's in Distort Quote All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ] Link to comment Share on other sites More sharing options...
Ash Posted June 6, 2007 Share Posted June 6, 2007 For me it's in Distort Quote All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ] Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Author Share Posted June 6, 2007 I do not understand well what you are saying!But it makes me think about the Fragment plugin (from Ed Harvey) http://paintdotnet.12.forumer.com/viewtopic.php?t=2969 Here's the best I can explain it... ... sorry for rambling...So, who knows about plugins and ellipses? No gradient nor ellipses... I took the "Texture Helper" from Boltbait, and instead moving the pixel, I make an average with Source+Destination. http://paintdotnet.12.forumer.com/viewtopic.php?t=2614 Test the code with CodeLab: void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = (int)(((selection.Right - selection.Left) / 2) + selection.Left); int CenterY = (int)(((selection.Bottom - selection.Top) / 2) + selection.Top); ColorBgra PixD,Pix1,Pix2; int srcX = 0, srcY = 0; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { srcX = x; srcY = y; if (x < CenterX) srcX += CenterX; else srcX -= CenterX; if (y < CenterY) srcY += CenterY; else srcY -= CenterY; Pix1 = src[srcX,srcY]; Pix2 = src[x,y]; PixD = src[x,y]; PixD.R = (byte)((float)(Pix1.R + Pix2.R + 0.5f)/2.0f); PixD.G = (byte)((float)(Pix1.G + Pix2.G + 0.5f)/2.0f); PixD.B = (byte)((float)(Pix1.B + Pix2.B + 0.5f)/2.0f); PixD.A = (byte)((float)(Pix1.A + Pix2.A + 0.5f)/2.0f); dst[x,y] = PixD; } } } Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Author Share Posted June 6, 2007 I do not understand well what you are saying!But it makes me think about the Fragment plugin (from Ed Harvey) http://paintdotnet.12.forumer.com/viewtopic.php?t=2969 Here's the best I can explain it... ... sorry for rambling...So, who knows about plugins and ellipses? No gradient nor ellipses... I took the "Texture Helper" from Boltbait, and instead moving the pixel, I make an average with Source+Destination. http://paintdotnet.12.forumer.com/viewtopic.php?t=2614 Test the code with CodeLab: void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = (int)(((selection.Right - selection.Left) / 2) + selection.Left); int CenterY = (int)(((selection.Bottom - selection.Top) / 2) + selection.Top); ColorBgra PixD,Pix1,Pix2; int srcX = 0, srcY = 0; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { srcX = x; srcY = y; if (x < CenterX) srcX += CenterX; else srcX -= CenterX; if (y < CenterY) srcY += CenterY; else srcY -= CenterY; Pix1 = src[srcX,srcY]; Pix2 = src[x,y]; PixD = src[x,y]; PixD.R = (byte)((float)(Pix1.R + Pix2.R + 0.5f)/2.0f); PixD.G = (byte)((float)(Pix1.G + Pix2.G + 0.5f)/2.0f); PixD.B = (byte)((float)(Pix1.B + Pix2.B + 0.5f)/2.0f); PixD.A = (byte)((float)(Pix1.A + Pix2.A + 0.5f)/2.0f); dst[x,y] = PixD; } } } Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Squ1rrel Posted June 6, 2007 Share Posted June 6, 2007 i like the plugin. Quote visit my flickr account Link to comment Share on other sites More sharing options...
Squ1rrel Posted June 6, 2007 Share Posted June 6, 2007 i like the plugin. Quote visit my flickr account Link to comment Share on other sites More sharing options...
barkbark00 Posted June 6, 2007 Share Posted June 6, 2007 ...I make an average with Source+Destination... Is this "average" like The Lighten blending mode? Quote Take responsibility for your own intelligence. -Rick Brewster Link to comment Share on other sites More sharing options...
barkbark00 Posted June 6, 2007 Share Posted June 6, 2007 ...I make an average with Source+Destination... Is this "average" like The Lighten blending mode? Quote Take responsibility for your own intelligence. -Rick Brewster Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Author Share Posted June 6, 2007 ...I make an average with Source+Destination... Is this "average" like The Lighten blending mode? I don't know how The Lighten blending mode works! Pixel Destination = (Pixel1 + Pixel2) /2 PixD.R = (Pix1.R + Pix2.R + 0.5)/2 PixD.G = (Pix1.G + Pix2.G + 0.5)/2 PixD.B = (Pix1.B + Pix2.B + 0.5)/2 PixD.A = (Pix1.A + Pix2.A + 0.5)/2 Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Author Share Posted June 6, 2007 ...I make an average with Source+Destination... Is this "average" like The Lighten blending mode? I don't know how The Lighten blending mode works! Pixel Destination = (Pixel1 + Pixel2) /2 PixD.R = (Pix1.R + Pix2.R + 0.5)/2 PixD.G = (Pix1.G + Pix2.G + 0.5)/2 PixD.B = (Pix1.B + Pix2.B + 0.5)/2 PixD.A = (Pix1.A + Pix2.A + 0.5)/2 Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Bob Posted June 6, 2007 Share Posted June 6, 2007 LightenThe lighter pixel of either the layer or the composition is used. http://www.getpaint.net/doc/latest/en/L ... es#Lighten Quote 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 More sharing options...
Bob Posted June 6, 2007 Share Posted June 6, 2007 LightenThe lighter pixel of either the layer or the composition is used. http://www.getpaint.net/doc/latest/en/L ... es#Lighten Quote 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 More sharing options...
drakaan Posted June 6, 2007 Share Posted June 6, 2007 Test the code with CodeLab: void Render(Surface dst, Surface src, Rectangle rect) ... dst[x,y] = PixD; } } } I get a compile error in codelab that PixD is an unassigned local variable. (line 41, which is the "dst[x,y] = PixD" one). I'd very much like to understand what this code is doing, but I don't know enough about the colorBGRa type to understand why it would be unassigned after 4 lines of code that appear to assign values to its color channel properties. Quote Link to comment Share on other sites More sharing options...
drakaan Posted June 6, 2007 Share Posted June 6, 2007 Test the code with CodeLab: void Render(Surface dst, Surface src, Rectangle rect) ... dst[x,y] = PixD; } } } I get a compile error in codelab that PixD is an unassigned local variable. (line 41, which is the "dst[x,y] = PixD" one). I'd very much like to understand what this code is doing, but I don't know enough about the colorBGRa type to understand why it would be unassigned after 4 lines of code that appear to assign values to its color channel properties. Quote Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Author Share Posted June 6, 2007 Test the code with CodeLab: void Render(Surface dst, Surface src, Rectangle rect) ... dst[x,y] = PixD; } } } I get a compile error in codelab that PixD is an unassigned local variable. (line 41, which is the "dst[x,y] = PixD" one). I'd very much like to understand what this code is doing, but I don't know enough about the colorBGRa type to understand why it would be unassigned after 4 lines of code that appear to assign values to its color channel properties. Fixed! See above... Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Author Share Posted June 6, 2007 Test the code with CodeLab: void Render(Surface dst, Surface src, Rectangle rect) ... dst[x,y] = PixD; } } } I get a compile error in codelab that PixD is an unassigned local variable. (line 41, which is the "dst[x,y] = PixD" one). I'd very much like to understand what this code is doing, but I don't know enough about the colorBGRa type to understand why it would be unassigned after 4 lines of code that appear to assign values to its color channel properties. Fixed! See above... Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
barkbark00 Posted June 6, 2007 Share Posted June 6, 2007 ...I make an average with Source+Destination... Is this "average" like The Lighten blending mode? I don't know how The Lighten blending mode works! Pixel Destination = (Pixel1 + Pixel2) /2 PixD.R = (Pix1.R + Pix2.R + 0.5)/2 PixD.G = (Pix1.G + Pix2.G + 0.5)/2 PixD.B = (Pix1.B + Pix2.B + 0.5)/2 PixD.A = (Pix1.A + Pix2.A + 0.5)/2 They are different! Using Lighten Blending Mode: Your effect: Quote Take responsibility for your own intelligence. -Rick Brewster Link to comment Share on other sites More sharing options...
barkbark00 Posted June 6, 2007 Share Posted June 6, 2007 ...I make an average with Source+Destination... Is this "average" like The Lighten blending mode? I don't know how The Lighten blending mode works! Pixel Destination = (Pixel1 + Pixel2) /2 PixD.R = (Pix1.R + Pix2.R + 0.5)/2 PixD.G = (Pix1.G + Pix2.G + 0.5)/2 PixD.B = (Pix1.B + Pix2.B + 0.5)/2 PixD.A = (Pix1.A + Pix2.A + 0.5)/2 They are different! Using Lighten Blending Mode: Your effect: Quote Take responsibility for your own intelligence. -Rick Brewster Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Author Share Posted June 6, 2007 Well, so why not a chooser for blend mode! As an example : int Amount1=2; //[1,3]1=Lighten,2=Average,3=Darken void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = (int)(((selection.Right - selection.Left) / 2) + selection.Left); int CenterY = (int)(((selection.Bottom - selection.Top) / 2) + selection.Top); ColorBgra PixD,Pix1,Pix2; int srcX = 0, srcY = 0; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { srcX = x; srcY = y; if (x < CenterX) srcX += CenterX; else srcX -= CenterX; if (y < CenterY) srcY += CenterY; else srcY -= CenterY; Pix1 = src[srcX,srcY]; Pix2 = src[x,y]; PixD = src[x,y]; if (Amount1==1) { PixD.R = (byte)(Math.Max(Pix1.R,Pix2.R)); PixD.G = (byte)(Math.Max(Pix1.G,Pix2.G)); PixD.B = (byte)(Math.Max(Pix1.B,Pix2.); PixD.A = (byte)(Math.Max(Pix1.A,Pix2.A)); } else if (Amount1==2) { PixD.R = (byte)((float)(Pix1.R + Pix2.R) / 2.0f + 0.5f); PixD.G = (byte)((float)(Pix1.G + Pix2.G) / 2.0f + 0.5f); PixD.B = (byte)((float)(Pix1.B + Pix2. / 2.0f + 0.5f); PixD.A = (byte)((float)(Pix1.A + Pix2.A) / 2.0f + 0.5f); } else if (Amount1==3) { PixD.R = (byte)(Math.Min(Pix1.R,Pix2.R)); PixD.G = (byte)(Math.Min(Pix1.G,Pix2.G)); PixD.B = (byte)(Math.Min(Pix1.B,Pix2.); PixD.A = (byte)(Math.Min(Pix1.A,Pix2.A)); } dst[x,y] = PixD; } } } Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Author Share Posted June 6, 2007 Well, so why not a chooser for blend mode! As an example : int Amount1=2; //[1,3]1=Lighten,2=Average,3=Darken void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = (int)(((selection.Right - selection.Left) / 2) + selection.Left); int CenterY = (int)(((selection.Bottom - selection.Top) / 2) + selection.Top); ColorBgra PixD,Pix1,Pix2; int srcX = 0, srcY = 0; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { srcX = x; srcY = y; if (x < CenterX) srcX += CenterX; else srcX -= CenterX; if (y < CenterY) srcY += CenterY; else srcY -= CenterY; Pix1 = src[srcX,srcY]; Pix2 = src[x,y]; PixD = src[x,y]; if (Amount1==1) { PixD.R = (byte)(Math.Max(Pix1.R,Pix2.R)); PixD.G = (byte)(Math.Max(Pix1.G,Pix2.G)); PixD.B = (byte)(Math.Max(Pix1.B,Pix2.); PixD.A = (byte)(Math.Max(Pix1.A,Pix2.A)); } else if (Amount1==2) { PixD.R = (byte)((float)(Pix1.R + Pix2.R) / 2.0f + 0.5f); PixD.G = (byte)((float)(Pix1.G + Pix2.G) / 2.0f + 0.5f); PixD.B = (byte)((float)(Pix1.B + Pix2. / 2.0f + 0.5f); PixD.A = (byte)((float)(Pix1.A + Pix2.A) / 2.0f + 0.5f); } else if (Amount1==3) { PixD.R = (byte)(Math.Min(Pix1.R,Pix2.R)); PixD.G = (byte)(Math.Min(Pix1.G,Pix2.G)); PixD.B = (byte)(Math.Min(Pix1.B,Pix2.); PixD.A = (byte)(Math.Min(Pix1.A,Pix2.A)); } dst[x,y] = PixD; } } } Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
PineappleQc Posted June 6, 2007 Share Posted June 6, 2007 For me it's in Distort AHA! Found it in "Déformer"! Thx a lot Quote "Ah, i love it when huge pineapples try to take over the world, it makes me sentimental :')" -Stephan Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.