Jump to content

TR's Strobe Motion V 1.2


Recommended Posts

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


 


StrobeMenu1.PNG?raw=1


 


 



 


Time Flies


Time%20Flies.png?raw=1


 


Example of Cloning:


(rotation setting adds realism)


 


Replic-Ants


ants.png?raw=1


.


 


Twist and Growl


twist.png?raw=1


 


 


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

Edited by TechnoRobbo
  • Upvote 1

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

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

Edited by TechnoRobbo

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

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

Edited by TechnoRobbo
Linked to image

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

Welsh

 

No it wasn't your fault. Large images may slow it down but shouldn't under any cirucumstances crash PDN. That's why I had to put safe gaurds in V1.1.

 

I assume you're now using V1.1.

 

I'm glad all is fine now- Please keep me posted if you have any further issues or suggestions.

 

Looking forward to more of your awesome art work.

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

I still have same problem as welshblue even with the final release, to repro it do this

 

- Put "Frames per point (3X)" option to full (25) and play with the Rotation.

- When rendering is finished click OK

- Open the plugin again you will face the flickering problem, your PC will act crazy :)

 

By the way, nice plugin though,

I needed same like this effect before can't remeber for what, and posted here asking if someone could create it, but this is more than my expectations, thanks so much,

I whish if it is a little faster, is ignoring the transparent pixels will speed up the rendering?

Edited by yellowman
  • Upvote 1
Link to comment
Share on other sites

Yellow - thank you - I was able to reproduce it using your instructions. Multithreading render using too many open bitmaps. I've changed it to dispose of every bitmap as soon as a frame renders.

 

To All 

 

Uploaded V1.2 as of now!!!!!!

 

Give it your worst.

 

Thanks again Yellowman.

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

Thanks TechnoRobbo. It has helped a little. I cannot understand how to place objects in a straight line as you have with the Repli-cants image and how Dug has with the figures. all I can manage is a wavy line no matter what setting I use. 

HFuQlot.png

 

 

 

Link to comment
Share on other sites

Motto

 

Maybe this will help

 

Set both point 1 sliders to -1

Set both point 2 sliders to -0.33

Set both point 3 sliders to  0.33

Set both point 4 sliders to 1

This will create a straight even diagonal render.

 

Set both point 1 sliders to First -1 and Second 0

Set both point 2 sliders to First  -0.33 and Second 0

Set both point 3 sliders to First  0.33 and Second 0

Set both point 4 sliders to First  1 and Second 0

This will create a straight even horizontal render.

 

Set both point 1 sliders to First 0  and Second -1

Set both point 2 sliders to First 0  and Second -0.33

Set both point 3 sliders to First 0  and Second 0 0.33

Set both point 4 sliders to First 0  and Second 1

This will create a straight even vertical render.

 

Also...

 

Try to imagine all the Points  overlapping like this

 

Motto.png?raw=1

It will help visualize what the points are doing.

Edited by TechnoRobbo

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

I followed the first method post above -

Set both point 1 sliders to -1  -  Set both point 2 sliders to -0.33 - Set both point 3 sliders to  0.33 - Set both point 4 sliders to 1 
This will create a straight even diagonal render

 

I end up with this (I maintained all other sliders at default) I have re - downloaded also the plug in again to ensure It is not a fault.

calaispark_zps0ea45f6f.jpg

 

There appears to be a clutter of football on the right side.

HFuQlot.png

 

 

 

Link to comment
Share on other sites

I think I left out that your object should be centered .

 

since the whole layer is processed (read below).

 

That being said I took your example cutout the ball, centered the ball and ran it through the first method

(set size=1 and took out the transparency for clarity)

and viola.

motto2.png?raw=1

 

I think the confusion comes from object placement. 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 us who have done keyframe animation are familiar with theses controls.

 

Sorry for the confusion.

Edited by TechnoRobbo
  • Upvote 1

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

After seeing your explanation I think I finally got how to use it, lol. Just happened to pick butterflies,lol   Cool plugin TR.   :trophy:

 

butterflies-2-b-800x600_zps125d5efd.png

Edited by skullbonz

 

                                                              http://forums.getpaint.net/index.php?/topic/21233-skullbonz-art-gallery

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...