BrushCue Example: Pixelate Reveal Animation¶

Open In Colab

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

In [ ]:
!pip install brushcue
In [1]:
import brushcue
import io

input_image_1 = brushcue.composition_monet_women_with_parasol() # insert your own image here
duration_2 = brushcue.float_passthrough(5.0)
time_3 = brushcue.float_passthrough(0.0)
int_to_float_4 = brushcue.int_to_float(69)
float_divide_5 = brushcue.float_divide(time_3, duration_2)
composition_bounds_6 = brushcue.composition_bounds(input_image_1)
float_subtract_7 = brushcue.float_subtract(1.0, float_divide_5)
bounds2f_width_8 = brushcue.bounds2f_width(composition_bounds_6)
bounds2f_height_9 = brushcue.bounds2f_height(composition_bounds_6)
float_round_to_int_10 = brushcue.float_round_to_int(bounds2f_width_8)
float_round_to_int_11 = brushcue.float_round_to_int(bounds2f_height_9)
vector_2_int_from_components_12 = brushcue.vector2i_from_components(float_round_to_int_10, float_round_to_int_11)
image_width_13 = brushcue.vector2i_x(vector_2_int_from_components_12)
int_to_float_14 = brushcue.int_to_float(image_width_13)
float_divide_15 = brushcue.float_divide(int_to_float_14, int_to_float_4)
float_multiply_16 = brushcue.float_multiply(float_divide_15, float_subtract_7)
float_add_17 = brushcue.float_add(float_multiply_16, 1.0)
float_round_to_int_18 = brushcue.float_round_to_int(float_add_17)
int_max_19 = brushcue.int_max(1, float_round_to_int_18)
pixelate_20 = brushcue.composition_pixelate(input_image_1, int_max_19)
sequence_graph_21 = brushcue.sequence_graph(duration_2, time_3, pixelate_20)

ctx = brushcue.Context()
result = sequence_graph_21.execute(ctx)
result = result.as_sequence()
# You can render the result to an video file