BrushCue Example: Glitch Filter Animation¶
You can use this tool online at https://www.brushcue.com/tools/glitch-filter-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
cyan_ghost_offset_base_2 = brushcue.transform2_identity()
red_ghost_offset_base_3 = brushcue.transform2_identity()
rgba_color_constant_4 = brushcue.r_g_b_a_color_constant(0, 0, 0, 1)
composition_color_profile_5 = brushcue.composition_color_profile(input_image_1)
composition_size_6 = brushcue.composition_size(input_image_1)
jitter_base_identity_7 = brushcue.transform2_identity()
float_multiply_8 = brushcue.float_multiply(0.0, 2.2)
float_multiply_9 = brushcue.float_multiply(0.0, 40.0)
float_multiply_10 = brushcue.float_multiply(0.0, 2.2)
float_multiply_11 = brushcue.float_multiply(0.0, 2.2)
float_multiply_12 = brushcue.float_multiply(0.0, 36.0)
float_multiply_13 = brushcue.float_multiply(0.0, 91.0)
float_multiply_14 = brushcue.float_multiply(0.0, 86.0)
float_multiply_15 = brushcue.float_multiply(0.0, 14.0)
float_multiply_16 = brushcue.float_multiply(0.0, 66.0)
float_multiply_17 = brushcue.float_multiply(0.0, 2.2)
float_multiply_18 = brushcue.float_multiply(0.0, 2.2)
float_multiply_19 = brushcue.float_multiply(0.0, 2.2)
float_multiply_20 = brushcue.float_multiply(0.0, 2.2)
float_multiply_21 = brushcue.float_multiply(0.0, 2.2)
float_multiply_22 = brushcue.float_multiply(0.0, 24.0)
float_multiply_23 = brushcue.float_multiply(0.0, 18.0)
background_color_and_size_24 = brushcue.composition_color_rect(rgba_color_constant_4, composition_color_profile_5, composition_size_6)
float_sine_25 = brushcue.float_sin(float_multiply_8)
float_cosine_26 = brushcue.float_cos(float_multiply_9)
float_sine_27 = brushcue.float_sin(float_multiply_10)
float_sine_28 = brushcue.float_sin(float_multiply_11)
float_sine_29 = brushcue.float_sin(float_multiply_12)
float_sine_30 = brushcue.float_sin(float_multiply_13)
float_sine_31 = brushcue.float_sin(float_multiply_14)
float_sine_32 = brushcue.float_sin(float_multiply_15)
float_cosine_33 = brushcue.float_cos(float_multiply_16)
float_sine_34 = brushcue.float_sin(float_multiply_17)
float_sine_35 = brushcue.float_sin(float_multiply_18)
float_sine_36 = brushcue.float_sin(float_multiply_19)
float_sine_37 = brushcue.float_sin(float_multiply_20)
float_sine_38 = brushcue.float_sin(float_multiply_21)
float_sine_39 = brushcue.float_sin(float_multiply_22)
float_cosine_40 = brushcue.float_cos(float_multiply_23)
float_subtract_41 = brushcue.float_subtract(float_sine_25, 0.6)
float_subtract_42 = brushcue.float_subtract(float_sine_27, 0.6)
float_subtract_43 = brushcue.float_subtract(float_sine_28, 0.6)
float_multiply_44 = brushcue.float_multiply(float_sine_29, 0.012)
float_multiply_45 = brushcue.float_multiply(float_sine_30, 0.004)
float_multiply_46 = brushcue.float_multiply(float_sine_31, 10.0)
float_multiply_47 = brushcue.float_multiply(float_sine_32, 3.0)
float_multiply_48 = brushcue.float_multiply(float_cosine_33, 2.0)
float_subtract_49 = brushcue.float_subtract(float_sine_34, 0.6)
float_subtract_50 = brushcue.float_subtract(float_sine_35, 0.6)
float_subtract_51 = brushcue.float_subtract(float_sine_36, 0.6)
float_subtract_52 = brushcue.float_subtract(float_sine_37, 0.6)
float_subtract_53 = brushcue.float_subtract(float_sine_38, 0.6)
float_multiply_54 = brushcue.float_multiply(float_sine_39, 3.0)
float_multiply_55 = brushcue.float_multiply(float_cosine_40, 3.0)
float_max_56 = brushcue.float_max(0.0, float_subtract_41)
float_max_57 = brushcue.float_max(0.0, float_subtract_42)
float_max_58 = brushcue.float_max(0.0, float_subtract_43)
float_add_59 = brushcue.float_add(float_multiply_44, float_multiply_45)
float_max_60 = brushcue.float_max(0.0, float_subtract_49)
float_max_61 = brushcue.float_max(0.0, float_subtract_50)
float_max_62 = brushcue.float_max(0.0, float_subtract_51)
float_max_63 = brushcue.float_max(0.0, float_subtract_52)
float_max_64 = brushcue.float_max(0.0, float_subtract_53)
float_round_to_int_65 = brushcue.float_round_to_int(float_multiply_54)
float_round_to_int_66 = brushcue.float_round_to_int(float_multiply_55)
float_multiply_67 = brushcue.float_multiply(float_max_56, 2.5)
float_multiply_68 = brushcue.float_multiply(float_max_57, 2.5)
float_multiply_69 = brushcue.float_multiply(float_max_58, 2.5)
float_multiply_70 = brushcue.float_multiply(float_max_60, 2.5)
float_multiply_71 = brushcue.float_multiply(float_max_61, 2.5)
float_multiply_72 = brushcue.float_multiply(float_max_62, 2.5)
float_multiply_73 = brushcue.float_multiply(float_max_63, 2.5)
float_multiply_74 = brushcue.float_multiply(float_max_64, 2.5)
int_greater_than_75 = brushcue.int_greater_than(float_round_to_int_65, 1)
int_less_than_76 = brushcue.int_less_than(float_round_to_int_66, -2)
float_multiply_77 = brushcue.float_multiply(float_multiply_67, 0.72)
float_multiply_78 = brushcue.float_multiply(float_multiply_68, 0.72)
float_multiply_79 = brushcue.float_multiply(float_multiply_69, -20.0)
float_multiply_80 = brushcue.float_multiply(float_multiply_70, 20.0)
float_multiply_81 = brushcue.float_multiply(float_multiply_71, float_add_59)
float_multiply_82 = brushcue.float_multiply(float_multiply_74, float_cosine_26)
float_if_83 = brushcue.float_if(int_greater_than_75, float_multiply_46, float_multiply_47)
float_if_84 = brushcue.float_if(int_less_than_76, float_multiply_48, 0.0)
vector_2_float_from_components_85 = brushcue.vector2f_from_components(float_multiply_79, 0.0)
vector_2_float_from_components_86 = brushcue.vector2f_from_components(float_multiply_80, 0.0)
float_multiply_87 = brushcue.float_multiply(float_multiply_82, 0.01)
float_multiply_88 = brushcue.float_multiply(float_multiply_72, float_if_83)
float_multiply_89 = brushcue.float_multiply(float_multiply_73, float_if_84)
cyan_ghost_offset_90 = brushcue.transform2_translation(cyan_ghost_offset_base_2, vector_2_float_from_components_85)
red_ghost_offset_91 = brushcue.transform2_translation(red_ghost_offset_base_3, vector_2_float_from_components_86)
vector_2_float_from_components_92 = brushcue.vector2f_from_components(float_multiply_81, float_multiply_87)
vector_2_float_from_components_93 = brushcue.vector2f_from_components(float_multiply_88, float_multiply_89)
rgb_split_offset_94 = brushcue.composition_chroma_offset(input_image_1, vector_2_float_from_components_92)
animated_horizontal_glitch_jitter_95 = brushcue.transform2_translation(jitter_base_identity_7, vector_2_float_from_components_93)
blend_example_image_over_background_96 = brushcue.composition_blend_alpha(rgb_split_offset_94, background_color_and_size_24, animated_horizontal_glitch_jitter_95)
red_ghost_tint_97 = brushcue.composition_linear_transform(blend_example_image_over_background_96, 0.85, 0.08, 0.08, 0.0, 0.12, 0.04, 0.04, 0.0, 0.1, 0.04, 0.04, 0.0, 0.0, 0.0, 0.0, float_multiply_78)
composition_size_98 = brushcue.composition_size(blend_example_image_over_background_96)
composition_size_99 = brushcue.composition_size(blend_example_image_over_background_96)
cyan_ghost_tint_100 = brushcue.composition_linear_transform(blend_example_image_over_background_96, 0.04, 0.02, 0.02, 0.0, 0.12, 0.75, 0.12, 0.0, 0.1, 0.12, 0.85, 0.0, 0.0, 0.0, 0.0, float_multiply_77)
alpha_blend_red_ghost_copy_101 = brushcue.composition_blend_alpha(red_ghost_tint_97, blend_example_image_over_background_96, red_ghost_offset_91)
vector_2_int_get_x_102 = brushcue.vector2i_x(composition_size_98)
vector_2_int_get_y_103 = brushcue.vector2i_y(composition_size_99)
alpha_blend_cyan_ghost_copy_104 = brushcue.composition_blend_alpha(cyan_ghost_tint_100, alpha_blend_red_ghost_copy_101, cyan_ghost_offset_90)
int_subtract_105 = brushcue.int_subtract(vector_2_int_get_x_102, 56)
int_subtract_106 = brushcue.int_subtract(vector_2_int_get_y_103, 24)
bounds_2d_int_from_x_y_width_height_107 = brushcue.bounds2i_from_x_y_width_height(28, 12, int_subtract_105, int_subtract_106)
safe_edge_crop_108 = brushcue.composition_crop(alpha_blend_cyan_ghost_copy_104, bounds_2d_int_from_x_y_width_height_107)
result_animation_109 = brushcue.sequence_graph(3.0, 0.0, safe_edge_crop_108)
ctx = brushcue.Context()
result = result_animation_109.execute(ctx)
result = result.as_sequence()
# You can render the result to an video file