Jump to content

TechnoRobbo

Members
  • Posts

    1,740
  • Joined

  • Last visited

  • Days Won

    131

Everything posted by TechnoRobbo

  1. Version 1.0.6+ Ready for Download Version 1.0.6+ adds 4X Zoom and more ToolTips
  2. Your Choices: Ctrl + D Edit Menu - > Deselect Click on this Icon :Deselect: Paint.Net Documentation : http://www.getpaint.net/doc/latest/index.html
  3. http://forums.getpaint.net/index.php?/topic/31736-level-horizon-plugin-with-tutorial-and-source-code-v13-2015-04-21/?p=425805 try that plugin - BoltBait's Level Horizon
  4. I have no idea - that's why I haven't posted it the plugin forum. I just wrote this to help Humility out. I played with coloring an image with multi colored speckles - kind of looked cool.
  5. Yes it counts pixels - you're criteria was: you can also choose to include or exclude diagonals as contiguous. BTW (Variance represents the euclidean distance between colors in an RGB 3D cube). TR's Speck Fill TRsSpecks.zip Menu: Effects ->Color CodeLab Source Code (it's just a little itty bitty thing) Hidden Content: // Name:TR's Speck Fill // Submenu: Color // Author:TechnoRobbo // Title:TR's Speck Fill v 1.1 // Desc: // Keywords: // URL: // Help: #region UICode int Amount1 = 10; // [0,128] Variance int Amount2 = 10; // [0,50] Size bool Amount3 = false; // [0,1] Diagonal Borders #endregion private double pythag(ColorBgra CP ,ColorBgra CP2 ) { return Math.Sqrt((CP.G -CP2.G) * (CP.G -CP2.G) +(CP.B -CP2. * (CP.B -CP2. + (CP.R -CP2.R) * (CP.R -CP2.R)); } private bool check(Surface s, int x, int y, ColorBgra f, int var ,int stop,bool diag ) { if (IsCancelRequested) return false; System.Collections.Generic.Stack<Point> que = new System.Collections.Generic.Stack<Point>(); int size=0; int[,] track = new int[Amount2 * 2 + 1,Amount2 * 2 + 1]; que.Push(new Point(x,y)); int limit = stop * 2 + 1; while (que.Count > 0) { Point p = que.Pop(); if (p.X < 0 || p.Y < 0 || p.X > (s.Width - 1) || p.Y>= (s.Height - 1))continue; Point pxy = new Point(p.X - x + stop, p.Y - y + stop); if (IsCancelRequested) return false; if (pxy.X > track.GetUpperBound(0) || pxy.Y > track.GetUpperBound(1) || pxy.X < 0 || pxy.Y <0) continue; if (track[pxy.X,pxy.Y]!=0)continue; if (pythag(s[p.X,p.Y],f)<=var) { track[pxy.X,pxy.Y]=1; p.Offset(1, 0); que.Push(p); p.Offset(-1, 1); que.Push(p); p.Offset(-1, -1); que.Push(p); p.Offset(1, -1); que.Push(p); if (diag) { p.Offset(1, 0); que.Push(p); p.Offset(0, 2); que.Push(p); p.Offset(-2, 0); que.Push(p); p.Offset(0, -2); que.Push(p); } } } for (int j = 0; j < track.GetUpperBound(1); j++) { for (int i = 0; i < track.GetUpperBound(0); i++) { if (IsCancelRequested) return false; if ( track[i,j] != 0)size++; } } return (size<=stop && size > 0); } void Render(Surface dst, Surface src, Rectangle rect) { Rectangle rect2 = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); ColorBgra pc = (ColorBgra)EnvironmentParameters.PrimaryColor; ColorBgra sc = (ColorBgra)EnvironmentParameters.SecondaryColor; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { if (IsCancelRequested) return; bool val = check(src,x,y,pc,Amount1,Amount2,Amount3); if (val) { dst[x,y] = sc; }else{ dst[x,y] = src[x,y]; } } } }
  6. I'll have my version finished tonight, if uses a flood fill algorithm into a buffer, counts the pixels in the buffer then decides then sets the pixel on criteria.
  7. it doesn't use selections - not for his purpose code not quite ready yet
  8. racerx- your on fire!!!!
  9. OK,here it is. I called it TR's Speck Fill. It's in the Effects ->Color Menu. http://forums.getpaint.net/index.php?/topic/32193-where-would-i-post-a-plug-in-request/?p=430363
  10. This sounds like a variation on the classic fill algorithm - I'll post some code and a dll when I get home.
  11. Did you unzip the file before placing it in the Effects folder?
  12. EER I read the ShapeMaker Manual, cover to cover. I just don't read manuals first I try and figure stuff out then I wave the white flag.
  13. this may gave you some insight - run this, don't even build it , just paste it in CodeLab. Then try a selection. // Name: // Submenu: // Author: // Title: // Desc: // Keywords: // URL: // Help: #region UICode #endregion Random rndm = new Random((int)Guid.NewGuid().GetHashCode()); void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra CurrentPixel = ColorBgra.FromBgr( (byte)rndm.Next(256), (byte)rndm.Next(256),(byte)rndm.Next(256)); for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { dst[x,y] = CurrentPixel; } } }
  14. Same here actually - going through the whole exercise of explaining it gave me a deeper insight. Part II may take a bit before I can get to it. We'll be making a kitty.
  15. ShapeMaker Tutorial Part I http://forums.getpaint.net/index.php?/topic/32198-shapemaker-tutorials/?p=430223
  16. ShapeMaker Tutorial Part I ShapeMaker Tutorial Part II
  17. That did the trick ,Thanks Midora Version 1.5 Ready for download Adjusted for very small selections
×
×
  • Create New...