Jump to content

TechnoRobbo

Members
  • Posts

    1,740
  • Joined

  • Last visited

  • Days Won

    131

Everything posted by TechnoRobbo

  1. Thanks Drew, added a new example using Strobe Motion for cloning and Tilt-Shift for fake depth of field.
  2. Welsh and All, Version 1.1 is posted Ok, added extra error trapping and trash collection the image below is 4 layers 1900 X 1266, full frames 75 (3X25) per layer and full rotation. Looks like something out of the last Matrix movie https://www.dropbox.com/s/wi2khd4qcja4caw/Welshtest.png?dl=0
  3. Welsh, What were your setting - Full rotation & Max frames? Rotation is the most resource intensive. I'll slip a try & catch in the code to assure the stack gets resolved . Wait for v 1.1. I'll pull 1.0 off the post until I add the try & catch
  4. Ed Catmull is a God, I'm still not pin-worthy.

  5. BarbieQ, It really is, and I'm putting that picture at the top of my gallery. I like it.
  6. TechnoRobbo's Strobe Motion Plugin Version 1.2 Stroboscopic Effect Silmulation. Version 1.2 Solves Large image problem Plugin can be used to imply motion as captured by a strobe light. It can also be used to create extrusions, cloning and other numerous effects. The object should be in the center and placed using the Points control. Not placed where you want it then modified by the Points control. The plugin looks at the layer as a whole and the Points represent the center of the layer at different points in time. This is after all an animation represented in 1 frame ( a temporal Picasso!). Those of you who have done keyframe animation are familiar with theses controls. Menu: Effects->Render Time Flies Example of Cloning: (rotation setting adds realism) Replic-Ants . Twist and Growl Tutorial The Code Hidden Content: // Submenu: Render // Name: TR's Strobe Motion // Title: TR's Strobe Motion - v1.2 // Author: TechnoRobbo // URL: http://www.technorobbo #region UICode Pair<double, double> Amount1 = Pair.Create( 0.0 , 0.0 ); // Point 1 Pair<double, double> Amount2 = Pair.Create( 0.0 , 0.0 ); // Point 2 Pair<double, double> Amount3 = Pair.Create( 0.0 , 0.0 ); // Point 3 Pair<double, double> Amount4 = Pair.Create( 0.0 , 0.0 ); // Point 4 int Amount5 = 5; // [2,25] Frames per Point (3X) double Amount6 = 0; // [-180,180] Start Rotation double Amount7 = 0; // [-180,180] End Rotation double Amount8 = 0; // [0,1] Start Opacity double Amount9 = 1; // [0,1] End Opacity double Amount10 = 0.5; // [0.01,1] Start Size double Amount11 = 0.5; // [0.01,1] End Size #endregion PointF CatmullRom(PointF p0, PointF p1, PointF p2, PointF p3, float t) { PointF ret = new PointF(); float t2 = t * t; float t3 = t2 * t; ret.X = 0.5f * ((2.0f * p1.X) + (-p0.X + p2.X) * t + (2.0f * p0.X - 5.0f * p1.X + 4 * p2.X - p3.X) * t2 + (-p0.X + 3.0f * p1.X - 3.0f * p2.X + p3.X) * t3); ret.Y = 0.5f * ((2.0f * p1.Y) + (-p0.Y + p2.Y) * t + (2.0f * p0.Y - 5.0f * p1.Y + 4 * p2.Y - p3.Y) * t2 + (-p0.Y + 3.0f * p1.Y - 3.0f * p2.Y + p3.Y) * t3); return ret; } void Render(Surface dst, Surface src, Rectangle rect) { try { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((sel .Right - sel .Left) / 2)+sel .Left; int CenterY = ((sel .Bottom - sel .Top) / 2)+sel .Top; Graphics gn = new RenderArgs(dst).Graphics; gn.Clip = new Region(rect); gn.Clear(Color.FromArgb(0,0,0,0)); gn.Dispose(); PointF p0 =new PointF (CenterX * (float)Amount1.First + CenterX , CenterY * (float)Amount1.Second + CenterY); PointF p1 =new PointF (CenterX * (float)Amount2.First + CenterX , CenterY * (float)Amount2.Second + CenterY); PointF p2 =new PointF (CenterX * (float)Amount3.First + CenterX , CenterY * (float)Amount3.Second + CenterY); PointF p3 =new PointF (CenterX * (float)Amount4.First + CenterX , CenterY * (float)Amount4.Second + CenterY); PointF pt = new PointF(); int frames = Amount5 * 3; for (int t = 0 ; t < frames; t++ ) { float interp = (float)t / (float)frames; //============================================================ Bitmap bmp = new RenderArgs(src).Bitmap; Graphics g = new RenderArgs(dst).Graphics; g.Clip = new Region(rect); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver; System.Drawing.Imaging.ColorMatrix matrix = new System.Drawing.Imaging.ColorMatrix(); System.Drawing.Imaging.ImageAttributes IA = new System.Drawing.Imaging.ImageAttributes(); //================================================================= switch ((int)(t/Amount5)) { case 0: pt= CatmullRom(p0,p0,p1,p2,(float)(t % Amount5)/Amount5); break; case 1: pt= CatmullRom(p0,p1,p2,p3,(float)(t % Amount5)/Amount5); break; case 2: pt= CatmullRom(p1,p2,p3,p3,(float)(t % Amount5)/Amount5); break; } //rotate center double m33 = Amount9 * interp + Amount8 - Amount8 * interp; double rot = Amount7 * interp + Amount6 - Amount6 * interp; double sz = Amount11 * interp + Amount10 - Amount10 * interp; //======================== matrix.Matrix33 = (float)m33; IA.SetColorMatrix(matrix, System.Drawing.Imaging.ColorMatrixFlag.Default, System.Drawing.Imaging.ColorAdjustType.Bitmap); //======================== System.Drawing.Drawing2D.Matrix m = new System.Drawing.Drawing2D.Matrix(); m.RotateAt((float)rot,new PointF(pt.X, pt.Y), System.Drawing.Drawing2D.MatrixOrder.Append); g.Transform = m; g.DrawImage(bmp, new Rectangle((int)pt.X - (int)(CenterX * sz),(int)pt.Y - (int)(CenterY * sz) , (int)(bmp.Width * sz), (int)(bmp.Height * sz)), 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, IA); m.Dispose(); IA.Dispose(); g.Dispose(); bmp.Dispose(); } }catch (Exception e){} } TRsStrobeMotion.zip
  7. TechnoRobbo's Coquin Graduated Filter A simulation of the legendary Cokin Graduated Photographic Filter Back in the 70's a photographer named Jean Coquin invented a new style of filter called Cokin http://en.wikipedia.org/wiki/Cokin One of the most used filters in the Cokin is the graduated color filter. http://www.cokin-filters.com/creative-system/ This simulation allows you to slide the filter up and down and rotate it just like the real fiter. It does not add color to the picture it subtracts the complimentary colors simulating what a real photographic filter would do. Menu: Effects -> Color No instructions - just play around. The Code Hidden Content: // Submenu: Color // Name: TR's Coquin Filter // Title: TR's Coquin Filter - v1.0 // Author: TechnoRobbo // URL: http://www.technorobbo #region UICode double Amount1 = 0; // [-1,1] Offset ColorBgra Amount2 = ColorBgra.FromBgr(0,0,0); // Tint double Amount3 = -90; // [-180,180] Rotation #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Delete any of these lines you don't need Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((sel.Right - sel.Left) / 2)+sel.Left; int CenterY = ((sel.Bottom - sel.Top) / 2)+sel.Top; double rad = Amount3 * Math.PI/180; float shortside = (sel.Height > sel.Width) ? sel.Width : sel.Height; shortside +=(float)Amount1 * shortside; ColorBgra CP; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { //======================================== PointF position = new PointF(x-CenterX,y-CenterY); position.X =(float)Math.Cos(rad) * position.X -(float)Math.Sin(rad) * position.Y + CenterX; //=========================================================== float grad = 1-( position.X / shortside); grad = Math.Max(grad,0); grad = Math.Min(grad,1); CP = src[x,y]; int R = (int)((Amount2.B + Amount2.G)/2 * grad) ; int G =(int)((Amount2.B + Amount2.R)/2 * grad) ; int B =(int)((Amount2.R + Amount2.G)/2 * grad) ; CP.R = Int32Util.ClampToByte((int)( CP.R - R )); CP.G = Int32Util.ClampToByte((int)( CP.G - G )); CP.B = Int32Util.ClampToByte((int)( CP.B - B )); dst[x,y] = CP; } } } TRsCoquin.zip
  8. EER You are absolutely right . I changed the name in the header from Color Filler to Contour Filler because Color Filler wasn't descriptive. But I forgot to change the name of the C# file. DLL name has been fixed I posted the Source Code in the OP (Original Post). posted a better tutorial too.
  9. Bummer lost my pin

  10. TechnoRobbo's Contour Filler V1.5.2 A gradient fill plugin that follows the contour of the Alpha Channel Make sure to deselect before using. Larger images take longer to render. Choose from smooth (zero slices) and stepped gradient Version 1.5.2 minor code cleanup Version 1.5.1 My apologies uploaded wrong version Version 1.5 has a smoothing component and new high speed code. Version 1.1 Updated for Paint.net 4.0 Menu: Effects -> Color Text Demo Quick Example on you Tube music by TechnoRobbo CHAPLIN Bogey1 https://www.dropbox.com/s/ioixkivgokaox9s/Bogart.png?raw=1 The VS Source Code The Plug-In TRsContourFiller.zip
  11. Einstein claimed never to memorize anything which could be looked up in less than two minutes.

  12. TechnoRobbo's Tilt-Shift Another Classic photographic simulation. https://en.wikipedia.org/wiki/Tilt%E2%80%93shift_photography Tilt Shift Photography is created by misaligning the lens with the film or image sensor. This misalignment actually shifts the depth of field. TR's Tilt-Shift is a directional gradient blur tool designed to easily achieve the effect. Menu: Effects - > Blurs Video Tutorial for image plane image music by TechnoRobbo Vanishing Point The Code Hidden Content: // Submenu: Blurs // Name: TR's TiltShift // Title: TR's TiltShift - v1.0 // Author: TechnoRobbo // URL: http://www.technorobbo #region UICode int Amount1 = 15; // [1,100] Blur Amount double Amount2 = 45; // [-180,180] Tilt double Amount3 = .5; // [0,1] Length #endregion public struct PointD { public double x, y; public PointD(double p1, double p2) { x = p1; y = p2; } } void Render(Surface dst, Surface src, Rectangle rect) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((sel .Right - sel .Left) / 2)+sel .Left; int CenterY = ((sel .Bottom - sel .Top) / 2)+sel .Top; double rad = Amount2 * Math.PI/180; double diag = Math.Sqrt(sel.Width * sel.Width + sel.Height + sel.Height); ColorBgra CP = new ColorBgra(); //Test varaibles //Amount1 = 20; //Amount2 = -90; //Amount3 = .85; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { //======================================== PointD position = new PointD(x-CenterX,y-CenterY); double oldx = position.x ; position.x =(float)Math.Cos(rad) * (float)position.x - Math.Sin(rad) * position.y + CenterX; double length =diag * Amount3 + 1; double val =1 - Math.Min(1,position.x /length); //quadratics val *=val; int Amount =(int)((double)Amount1 * val); //=========================================================== if (Amount>0){ int y1= y - Amount; int y2 = y + Amount; int x1= x - Amount; int x2 = x + Amount; int A=0,R=0,G=0,B=0,D=0; for (int j=y1;j<y2;j++){ for (int i=x1;i<x2;i++){ CP = src.GetBilinearSampleClamped(i,j); A += CP.A; R += CP.R; G += CP.G; B += CP.B; D++; } } if (D==0){D=1;} CP.A = Int32Util.ClampToByte(A/D); CP.R = Int32Util.ClampToByte(R/D); CP.G = Int32Util.ClampToByte(G/D); CP.B = Int32Util.ClampToByte(B/D); }else{ CP=src[x,y]; } dst[x,y] = CP; } } } TRsTiltShift.zip
  13. DD , Skull and Everybody else. Eureka, Holy Cow, Huzzah!!!! I figured out how to bypass the ROI scanlines and retain the progress dialogs!!!!!! Speed is dependant on image size but watch this video. Video Removed
  14. DD I uploaded a Beta with no preview option in the original post, try it , it's much quicker but by removing the preview you cant see the progress. it just appears when i t's done. try setting it around 100 and checking preview off. Any suggestions in making it more user friendly is welcomed. I know it says Faste , but it's a Beta
  15. slide the threshold slider to the left it will scatter darker pixels too - and increae the distance so it's easiers to see. also try more layers. Here's a non photo PDN example Settings: Distance 602 pixels. spread 10 threshold 0 (all pixels) Layers 14 .
  16. DD That's the consequence of turning the preview back on. You can see progress but chews up processing cycles. Tough nut to crack, but I'm not giving up on this speed thing.
  17. 4.3 just posted - it turns preview back on - PDN doesnt render the preview accurately until it hits 100%. Then it looks perfect v 4.3 was updated to feather the edges better. If your having trouble rendering : deselect make sure your on the right layer. Preview appears choppy Fully render image appears smooth
  18. I do have an update coming and I may have an option to turn on full preview so you can watch it work.
  19. It works by tracing the alpha then it does consecutive passes shrinking the outline and reducing the alpha until it hits solid. It totally ignores a selection so if you use a selection it may never get fed the alpha edges by pdn. Alpha Only.
  20. make sure you hit escape to remove any selections - it works on alpha and selections stop it from working.
  21. Skull and EER Thank you for the kind words. and EER , It's not the size of the code but how you use it. DD, That is exactly, I mean exactly what I was thinking. I wanted to melt alarm clocks. Before I even had one ounce of math on my spreadsheet I had the name "TR's Dali Plugin". I then thought that might be too obscure, I learned my lesson with Bokeh, so I made the name something you could visualize. couldn't resist
  22. TechnoRobbo's Pixel Pusher A truly sandbox effect Pixel pusher lets you manipulate image in a unique free form fashion. Menu: Effects - > Distort Video Demo The Code Hidden Content: // Submenu: Distort // Name: TR's Pixel Pusher // Title: TR's Pixel Pusher - v1.0 // Author: TechnoRobbo // URL: http://www.technorobbo #region UICode Pair<double, double> Amount1 = Pair.Create( 0.0 , 0.0 ); // From Pair<double, double> Amount2 = Pair.Create( 0.0 , 0.0 ); // To double Amount3 = .4; // [0,1] Size #endregion // Here is the main render loop function void Render(Surface dst, Surface src, Rectangle rect) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((sel .Right - sel .Left) / 2) + sel .Left; int CenterY = ((sel .Bottom - sel .Top) / 2) + sel .Top; double fx = CenterX * (float)Amount1.First + CenterX; double fy = CenterY * (float)Amount1.Second + CenterY; double tx = CenterX * (float)Amount2.First + CenterX; double ty = CenterY * (float)Amount2.Second + CenterY; double rad = Math.Sqrt((tx - fx) * (tx - fx) + (ty - fy)*(ty - fy)); double wide = sel.Width * Amount3 +.0001; dst.CopySurface(src,rect.Location,rect); for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { double dl = Math.Sqrt((x-fx)*(x-fx) + (y-fy)*(y-fy))/rad; double dw = Math.Sqrt((x-tx)*(x-tx) + (y-ty)*(y-ty))/wide; if (dl<1 || dw <1){ dl = Math.Min(dl,1); dl *=dl; dw = Math.Min(dw,1); dw *=dw; double nx= fx * dl + x - dl * x; double ny= y * dl + fy - dl * fy; nx= x * dw + nx - dw * nx; ny= y * dw + ny - dw * ny; ColorBgra CP = src.GetBilinearSampleClamped((int)nx,(int)ny); dst[x,y] = CP; } } } } TR's Pixel Push.zip
  23. I learned a new word this week!

  24. Welsh, Heck , I don't mind, that's why I publish my source codes - free knowledge for everyone.
×
×
  • Create New...