Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Solved
    • Unsolved
    • Search
    1. Home
    2. Tags
    3. animation
    Log in to post

    • ywpsdj

      how to code a gif that gradually transform one picture into another
      General Discussion • animation image gif • • ywpsdj  

      2
      0
      Votes
      2
      Posts
      31
      Views

      eduairet

      Hi, hope this helps: # Get your gif routes gifsFolder = '.' # Your gifs directory gifs = ['gif1.gif', 'gif2.gif'] # These are the files I'll use gifPaths = [f'{gifsFolder}/{gif}' for gif in gifs] # Create the paths for your with string formattingx # Create a function to interpolate between gifs def scaleFactor(path, pageNumber, canvasSize): # Get a scale factor to match the canvas size you want gifw, gifh = imageSize(path, pageNumber=pageNumber) factorMeasure = gifw if gifw > gifh: factorMeasure = gifh return canvasSize / factorMeasure def gifTransition(path1, path2): # Canvas and images dimensions w, h = 200, 200 # Canvas size # Define your frames introFrames = numberOfPages(path1) endingFrames = numberOfPages(path2) crossfadeFrames = 12 # Change this value for a longer transition totalFrames = int( (introFrames - crossfadeFrames/2)+(endingFrames - crossfadeFrames/2) ) # Get the total frames by merging the crossfade in the middle # Make a loop for the animation gif1Frames, gif2Frames = 0, 0 gif1alpha, gif2alpha = 1, 0 for frame in range(1, totalFrames+1): newPage(w, h) fill(1) rect(0, 0, w, h) with savedState(): scale(scaleFactor(path1, gif1Frames, w)) image(path1, (0, 0), pageNumber=gif1Frames, alpha=gif1alpha) if gif1Frames < introFrames: gif1Frames += 1 if frame > introFrames - crossfadeFrames/2: # Run the second gif with savedState(): scale(scaleFactor(path2, gif2Frames, w)) image(path2, (0, 0), pageNumber=gif2Frames, alpha=gif2alpha) gif2Frames += 1 if gif1alpha >= 0 or gif2alpha <= 1: # Crossfade transparency gif1alpha -= 1 / crossfadeFrames gif2alpha += 1 / crossfadeFrames gifTransition(gifPaths[0], gifPaths[1]) # Call the function saveImage('~/Desktop/gifCrossfade.gif') # Save your gif
    • ywpsdj

      How to code a gif that make the text flash
      General Discussion • animation text gif • • ywpsdj  

      4
      0
      Votes
      4
      Posts
      18
      Views

      monomonnik

    • ywpsdj

      how to code a gif making a picture transform from small to large and rotate
      General Discussion • animation gif • • ywpsdj  

      3
      0
      Votes
      3
      Posts
      29
      Views

      ywpsdj

      @frederik it works!thanks!!!
    • paul

      SOLVED Variable Font Animation Jiggle
      Bugs • animation variable fonts • • paul  

      4
      0
      Votes
      4
      Posts
      59
      Views

      ryan

      Hi @gferreira, this workaround is really helpful in making variable font animations not so jittery (run into that a lot). However, when using BezierPath, one loses selecting fill within some words of the FormattedString. Is it possible not flatten it all to one color with BezierPath?
    • monomonnik

      SOLVED Delay after drawing
      General Discussion • animation performance saving • • monomonnik  

      4
      0
      Votes
      4
      Posts
      24
      Views

      frederik

      DrawBot has an abstract stack of "actions" which can be applied on different contexts. One context is your output: an animated gif. And there is always a drawBot context to create the preview pdf data. Using drawBot from the module helps in this case as @gferreira suggested.
    • eduairet

      SOLVED Radial animation
      Tutorials • animation • • eduairet  

      5
      0
      Votes
      5
      Posts
      461
      Views

      eduairet

      @gferreira wow, this is huge!!! thank you again
    • FutureDays

      SOLVED Entering Font Properties into Existing Python Code
      General Discussion • animation text • • FutureDays  

      3
      0
      Votes
      3
      Posts
      462
      Views

      FutureDays

      Hello, Once again, thank you for being so helpful. Enjoy the day. Best. Robert
    • FutureDays

      SOLVED Changing Squares to Five Point Stars with JVR Code
      General Discussion • animation geometry • • FutureDays  

      6
      0
      Votes
      6
      Posts
      707
      Views

      FutureDays

      @gferreira Hello gferreira, Thank you so much the reply has been very helpful. I can see that I was thinking too much about modifying all areas of the code instead of changing a small component. Enjoy the day. Best. Robert
    • MishaHeesakkers

      SOLVED When exporting a large amount of frames is there a possibility to track the duration of this process?
      General Discussion • animation • • MishaHeesakkers  

      5
      0
      Votes
      5
      Posts
      633
      Views

      frederik

      oh, there is indeed no progress callback on saveImage(..) Doing some googling on 'progress' and 'ffmpeg' does not results in a clear solution. DrawBot has a small wrapper around ffmpeg to generate movies: see https://github.com/typemytype/drawbot/blob/master/drawBot/context/tools/mp4Tools.py
    • robstenson

      Animation pipeline, from DrawBot to AfterEffects
      Tutorials • animation variable fonts • • robstenson  

      2
      1
      Votes
      2
      Posts
      722
      Views

      frederik

      The tutorial is awesome! Really cool to see the usage of DrawBot from the perspective of an animator!
    • fooness

      SOLVED Animate in Drawbot, without exporting .gif …
      General Discussion • animation • • fooness  

      7
      0
      Votes
      7
      Posts
      1077
      Views

      andyclymer

      While I'm working on an animation I run the script once to save the .gif file to the disk, then I select the file and hit the space bar to open it in Quick Look to preview the animation. I leave this preview window open in the Finder while I continue to work on editing the script in DrawBot — every time the file gets updated with a newly saved .gif it will automatically start previewing the new version. Kind of a strange technique but it works!
    • Patricia

      SOLVED Making a book
      General Discussion • animation book • • Patricia  

      5
      0
      Votes
      5
      Posts
      1214
      Views

      Patricia

      @gferreira Thanks so much!
    • jo

      More variable fonts nonsense
      Code snippets • animation variable fonts • • jo  

      9
      4
      Votes
      9
      Posts
      1673
      Views

      Christine

      Hoi I’m using OS 10.13.6, Drawbot says ModuleNotFoundError: No module named 'helper_functions' ––– ah, sorry, I just saw that there’s an extra file with the helper functions.
    • jo

      Animated Müller-Lyer illusion
      Code snippets • animation recreations • • jo  

      7
      3
      Votes
      7
      Posts
      2181
      Views

      jo

      ok, one more. very similar to the previous one. page_s = 500 cell_amount = 12 rhythm = [1, 0, 0, 1, 0, 1, 1, 0] cell_s = page_s / cell_amount corner_s = cell_s/4 newPage(page_s, page_s) translate(-cell_s/2, -cell_s/2) def lozenge(pos, s): x, y = pos polygon((x, y), (x + s/2, y + s/2), (x + s, y), (x + s/2, y - s/2)) for x in range(cell_amount+1): for y in range(cell_amount+1): pos_x, pos_y = x * cell_s, y * cell_s fill(0.5) if (x+y) % 2 == 0 else fill(1) rect(pos_x, pos_y, cell_s, cell_s) fill(1) lozenge((pos_x - corner_s, pos_y), corner_s*2) fill(0) shift = (x + y) % len(rhythm) if rhythm[ shift ]: lozenge((pos_x - corner_s, pos_y), corner_s) lozenge((pos_x, pos_y), corner_s) else: lozenge((pos_x - corner_s/2, pos_y + corner_s/2), corner_s) lozenge((pos_x - corner_s/2, pos_y - corner_s/2), corner_s)
    • MauriceMeilleur

      SOLVED Generate animated .gifs, .pdfs similar to generateMP4()?
      General Discussion • animation animated gif • • MauriceMeilleur  

      5
      0
      Votes
      5
      Posts
      1337
      Views

      frederik

      not really... but this is not so hard with a PDFDocument
    • Mattipa

      SOLVED Tutorial request: how to animate a variable font
      Tutorials • animation variable fonts • • Mattipa  

      28
      0
      Votes
      28
      Posts
      11657
      Views

      jo

      @hzinn not sure how best to improve this more frames and higher resolution might be a start and maybe adding a background.
    • MauriceMeilleur

      SOLVED Saving large videos
      General Discussion • animation performance saving • • MauriceMeilleur  

      3
      0
      Votes
      3
      Posts
      1216
      Views

      justvanrossum

      @mauricemeilleur Right, sorry, I didn't notice that earlier thread before. http://forum.drawbot.com/topic/36/drawbot-on-something-more-powerful-than-desktops-and-laptops
    • MauriceMeilleur

      SOLVED Drawbot on something more powerful than desktops and laptops?
      General Discussion • animation performance • • MauriceMeilleur  

      5
      0
      Votes
      5
      Posts
      1728
      Views

      MauriceMeilleur

      Thanks—I'll have a chance to try this for myself later today.
    • agyei

      Blobs 101?
      Code snippets • bezierpath animation pens qcurve • • agyei  

      8
      1
      Votes
      8
      Posts
      3084
      Views

      MauriceMeilleur

      I mean to do so at some point—probably on GitHub, probably this summer when I can take a little time to clean up code and organize the sketches.
    • JeremieHornus

      WildyLoopyThing
      Code snippets • animation perlin noise • • JeremieHornus  

      7
      1
      Votes
      7
      Posts
      2558
      Views

      frederik

      well done! achievement unlock!