TechnoRobbo Posted July 26, 2013 Share Posted July 26, 2013 (edited) 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 Edited December 28, 2015 by TechnoRobbo 1 Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
skullbonz Posted July 26, 2013 Share Posted July 26, 2013 Lol,I love this guy,lol,Thanks for being you TechnoRobbo. Just when I think you can't possibly top your other cool plugins you pop out another one. This one looks like I am going to have some real fun with my family pics,heh,heh,heh. If you don't see me for awhile it's because they hung me,lol. Quote http://forums.getpaint.net/index.php?/topic/21233-skullbonz-art-gallery Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted July 26, 2013 Share Posted July 26, 2013 Damn. For code that short, this plugin shouldn't be this much fun. I love the video! Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
DrewDale Posted July 26, 2013 Share Posted July 26, 2013 (edited) This will be cool for adding some Salvador Dali styled mutilations to images. Nice one Edited July 26, 2013 by DrewDale Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted July 26, 2013 Author Share Posted July 26, 2013 (edited) Skull and EER Thank you for the kind words. and EER , It's not the size of the code but how you use it. DrewDale - This will be cool for adding some Salvador Dali styled mutilations to images. 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 Edited December 28, 2015 by TechnoRobbo Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins 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.