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 • 4 Jan 2021, 07:18 • ywpsdj   4 Jan 2021, 23:29

      2
      0
      Votes
      2
      Posts
      31
      Views

      eduairet 4 Jan 2021, 23:29

      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 • 30 Dec 2020, 07:40 • ywpsdj   30 Dec 2020, 20:15

      4
      0
      Votes
      4
      Posts
      18
      Views

      monomonnik 30 Dec 2020, 20:15

    • ywpsdj

      how to code a gif making a picture transform from small to large and rotate
      General Discussion • animation gif • 26 Dec 2020, 07:39 • ywpsdj   30 Dec 2020, 07:45

      3
      0
      Votes
      3
      Posts
      29
      Views

      ywpsdj 30 Dec 2020, 07:45

      @frederik it works!thanks!!!
    • paul

      SOLVED Variable Font Animation Jiggle
      Bugs • animation variable fonts • 3 Dec 2020, 12:56 • paul   19 Feb 2021, 01:40

      4
      0
      Votes
      4
      Posts
      59
      Views

      ryan 19 Feb 2021, 01:40

      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 • 8 Mar 2020, 17:31 • monomonnik   9 Mar 2020, 08:30

      4
      0
      Votes
      4
      Posts
      24
      Views

      frederik 9 Mar 2020, 08:30

      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 • 4 Oct 2019, 03:50 • eduairet   16 Oct 2019, 02:18

      5
      0
      Votes
      5
      Posts
      461
      Views

      eduairet 16 Oct 2019, 02:18

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

      SOLVED Entering Font Properties into Existing Python Code
      General Discussion • animation text • 14 Apr 2019, 19:34 • FutureDays   28 Apr 2019, 03:25

      3
      0
      Votes
      3
      Posts
      462
      Views

      FutureDays 28 Apr 2019, 03:25

      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 • 24 Mar 2019, 00:45 • FutureDays   1 Apr 2019, 23:14

      6
      0
      Votes
      6
      Posts
      707
      Views

      FutureDays 1 Apr 2019, 23:14

      @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 • 9 Mar 2019, 18:49 • MishaHeesakkers   13 Mar 2019, 10:02

      5
      0
      Votes
      5
      Posts
      633
      Views

      frederik 13 Mar 2019, 10:02

      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 • 19 Feb 2019, 15:58 • robstenson   19 Feb 2019, 20:37

      2
      1
      Votes
      2
      Posts
      722
      Views

      frederik 19 Feb 2019, 20:37

      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 • 4 Feb 2019, 08:26 • fooness   8 Apr 2019, 17:11

      7
      0
      Votes
      7
      Posts
      1.1k
      Views

      andyclymer 8 Apr 2019, 17:11

      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 • 16 Dec 2018, 23:46 • Patricia   27 Dec 2018, 19:08

      5
      0
      Votes
      5
      Posts
      1.2k
      Views

      Patricia 27 Dec 2018, 19:08

      @gferreira Thanks so much!
    • jo

      More variable fonts nonsense
      Code snippets • animation variable fonts • 7 Dec 2018, 17:31 • jo   23 Jul 2019, 19:34

      9
      4
      Votes
      9
      Posts
      1.7k
      Views

      Christine 23 Jul 2019, 19:34

      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 • 2 Nov 2018, 21:23 • jo   3 Nov 2018, 14:18

      7
      3
      Votes
      7
      Posts
      2.2k
      Views

      jo 3 Nov 2018, 14:18

      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 • 10 Jun 2018, 14:37 • MauriceMeilleur   11 Jun 2018, 14:36

      5
      0
      Votes
      5
      Posts
      1.3k
      Views

      frederik 11 Jun 2018, 14:36

      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 • 27 Mar 2018, 12:15 • Mattipa   8 Apr 2020, 13:48

      28
      0
      Votes
      28
      Posts
      11.7k
      Views

      jo 8 Apr 2020, 13:48

      @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 • 19 Feb 2018, 11:08 • MauriceMeilleur   19 Feb 2018, 11:10

      3
      0
      Votes
      3
      Posts
      1.2k
      Views

      justvanrossum 19 Feb 2018, 11:10

      @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 • 16 Feb 2018, 20:15 • MauriceMeilleur   19 Feb 2018, 11:49

      5
      0
      Votes
      5
      Posts
      1.7k
      Views

      MauriceMeilleur 19 Feb 2018, 11:49

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

      Blobs 101?
      Code snippets • bezierpath animation pens qcurve • 22 Jan 2018, 23:01 • agyei   25 Jan 2018, 11:46

      8
      1
      Votes
      8
      Posts
      3.1k
      Views

      MauriceMeilleur 25 Jan 2018, 11:46

      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 • 8 Jan 2018, 14:43 • JeremieHornus   30 Aug 2018, 19:56

      7
      1
      Votes
      7
      Posts
      2.6k
      Views

      frederik 30 Aug 2018, 19:56

      well done! achievement unlock!
    Drawing With Python