BrushCue Example: Zoom Out Reveal Animation¶

Open In Colab

You can use this tool online at https://www.brushcue.com/tools/zoom-out-reveal-animation

In [ ]:
!pip install brushcue
In [1]:
import brushcue as bc

initial_zoom = 6.0
duration = 2.0
input_image = bc.Composition.monet_women_with_parasol()
bounds = input_image.bounds()


@bc.brushcue_fn
def frame(time):
    scale = bc.Float.pow(initial_zoom, (1.0 - bc.Float.min(1.0, (time / duration))))
    return input_image.transform(
        bc.Transform2.identity()
        .scale(bc.Vector2f.from_components(scale, scale))
        .translation(
            bc.Vector2f.from_components(
                ((bounds.width() * (1.0 - scale)) / 2.0),
                ((bounds.height() * (1.0 - scale)) / 2.0),
            )
        )
    ).crop(bounds)


graph = bc.Sequence.graph(duration, frame)

ctx = bc.Context()
sequence = graph.execute(ctx)
# Render `sequence` to a video file as needed.
[wgpu] using backend Vulkan — adapter 'NVIDIA GeForce RTX 5070' (DiscreteGpu), driver 'NVIDIA'