I saw a jagabo answer about rotating an image with avisynth long time ago, it was something like this:
I'm trying to learn this but I'm failing miserably, I'm trying to create this effect:Code:function MyRotate(clip c, float angle) { c.Rotate(angle) Subtitle(string(angle)) } ImageSource("tiny.png", start=0, end=360, fps=60.0) ConvertToRGB32() Animate(0, 360, "MyRotate", last,0, last,360)
Rotate each circle in a different direction and speed in a loop, however, I can't even make the transparency work right, If I try a single image it rotates just fine but with a big white square in the background even though the png has transparency:
Code:function MyRotate(clip c, float angle) { c.Rotate(angle) } ImageSource("circle1.png", start=0, end=360, fps=60.0) ConvertToRGB32() Animate(0, 360, "MyRotate", last,0, last,360)
This is my failing attempt:
Could some one give me some light on this?Code:function MyRotate(clip c, float angle) { c.Rotate(angle) } c3=ImageSource("circle3.png", start=0, end=360, fps=60.0) c2=ImageSource("circle2.png", start=360, end=0, fps=30.0) c1=ImageSource("circle1.png", start=0, end=360, fps=15.0) Overlay(c1+c2+c3, mode="blend", opacity=1)
Thanks.
+ Reply to Thread
Results 1 to 6 of 6
-
Last edited by pokoloko; 8th Aug 2023 at 16:52.
-
Fine tune to your liking:
Code:function MyRotate(clip c, float angle) { c.Rotate(angle) } c1=ImageSource("circle1.png", start=0, end=360, fps=60.0, pixel_type="RGB32") c2=ImageSource("circle2.png", start=0, end=360, fps=60.0, pixel_type="RGB32") c3=ImageSource("circle3.png", start=0, end=360, fps=60.0, pixel_type="RGB32") c1 = Animate(0, 360, "MyRotate", c1,0, c1,360) c2 = Animate(0, 360, "MyRotate", c2,0, c2,-360) c3 = Animate(0, 360, "MyRotate", c3,0, c3,180) BlankClip(c1, color=color_white) Overlay(last, c1, mask=c1.ShowAlpha) Overlay(last, c2, x=(last.width-c2.width)/2, y=(last.height-c2.height)/2, mask=c2.ShowAlpha) Overlay(last, c3, x=(last.width-c3.width)/2, y=(last.height-c3.height)/2, mask=c3.ShowAlpha) # you can leave these out if you can use RGB32 output Crop(0,0,-1,-1) # odd frame width not compliant with YV12 ConvertToYV12() # for x264 encoding
-
I did this change so 'circle3' complete the 360 rotation:
Code:function MyRotate(clip c, float angle) { c.Rotate(angle) } c1=ImageSource("circle1.png", start=0, end=360, fps=60.0, pixel_type="RGB32") c2=ImageSource("circle2.png", start=0, end=360, fps=60.0, pixel_type="RGB32") c3=ImageSource("circle3.png", start=0, end=360, fps=60.0, pixel_type="RGB32") c1 = Animate(0, 360, "MyRotate", c1,0, c1,360) c2 = Animate(0, 360, "MyRotate", c2,0, c2,-360) c3 = Animate(0, 360, "MyRotate", c3,0, c3,180*4) # or c3,360*2 BlankClip(c1, color=color_white) Overlay(last, c1, mask=c1.ShowAlpha) Overlay(last, c2, x=(last.width-c2.width)/2, y=(last.height-c2.height)/2, mask=c2.ShowAlpha) Overlay(last, c3, x=(last.width-c3.width)/2, y=(last.height-c3.height)/2, mask=c3.ShowAlpha) # add loop #loop() # you can leave these out if you can use RGB32 output Crop(0,0,-1,-1) # odd frame width not compliant with YV12 ConvertToYV12() # for x264 encoding
-
By the way, if you want a seamless sequence, trim away the last frame (which is a duplicate of the first frame).
-
Yes, now it runs perfectly.
Thank you!
Code:function MyRotate(clip c, float angle) { c.Rotate(angle) } c1=ImageSource("circle1.png", start=0, end=360, fps=60.0, pixel_type="RGB32") c2=ImageSource("circle2.png", start=0, end=360, fps=60.0, pixel_type="RGB32") c3=ImageSource("circle3.png", start=0, end=360, fps=60.0, pixel_type="RGB32") c1 = Animate(0, 360, "MyRotate", c1,0, c1,360) c2 = Animate(0, 360, "MyRotate", c2,0, c2,-360) c3 = Animate(0, 360, "MyRotate", c3,0, c3,180*4) # or c3,360*2 BlankClip(c1, color=color_white) Overlay(last, c1, mask=c1.ShowAlpha) Overlay(last, c2, x=(last.width-c2.width)/2, y=(last.height-c2.height)/2, mask=c2.ShowAlpha) Overlay(last, c3, x=(last.width-c3.width)/2, y=(last.height-c3.height)/2, mask=c3.ShowAlpha) # for a a seamless sequence Trim(0,359) # add loop #loop() # you can leave these out if you can use RGB32 output Crop(0,0,-1,-1) # odd frame width not compliant with YV12 ConvertToYV12() # for x264 encoding
Last edited by pokoloko; 8th Aug 2023 at 18:45.
Similar Threads
-
VirtualDub animate filter on screen
By VidNoob123 in forum Newbie / General discussionsReplies: 3Last Post: 11th Jun 2023, 08:50 -
How do I animate portions of a picture
By rbk01 in forum Newbie / General discussionsReplies: 0Last Post: 13th Dec 2022, 12:10 -
Avisynth's Animate doesn't work as expected
By CoralMan in forum EditingReplies: 7Last Post: 20th Dec 2020, 09:30 -
How to animate highlights on Dvd Architect or A. Encore?
By Sunshining in forum User guidesReplies: 7Last Post: 25th Mar 2020, 15:14 -
Animate Overlay
By johnny27depp in forum Newbie / General discussionsReplies: 16Last Post: 12th Feb 2020, 07:26