Skip to main content
Back to top
Ctrl
+
K
Welcome to py5!
About py5
What is py5?
py5 Community
How To Contribute
py5 maintainer's blog
Getting Started
Install py5
Tips for Processing Java Users
Special Notes for macOS Users
The Five py5 Modes
User Functions
Hybrid Programming
Processing Mode
Importing py5 Code
Live Coding
Tutorials
intro to py5 and python
drawing basic elements
storing data in py5 with variables
complex custom shapes in py5
strings and text in py5
conditional statements
iteration
randomness
animation
transformations and matrices
trigonometry for animation
lists
dictionaries
reading external data
mouse and keyboard interaction in py5
functions in py5
object-oriented programming (OOP)
vector movement and Py5vector
physics simulations
three-dimensional graphics in py5
“Writing py5 tutorials…” project
Python Ecosystem Integrations
All About Colors
Images and Pillow
Charts, Plots, and Matplotlib
Numpy, Arrays, and Images
2D Shapes and Shapely
3D Shapes and Trimesh
SVG Images and Cairo
Cached Conversion
Custom Integrations
Using Jupyter Notebooks
Introducing py5bot
Render Helper Tools
Notebook Magic and Special Features
How To...
Use Camera3D
Generate Noise Values
Py5Vector Class
Create PyInstaller Packages
Reference
py5 Reference Summary
Sketch
acos()
alpha()
ambient()
ambient_light()
apply_filter()
apply_matrix()
arc()
asin()
atan()
atan2()
background()
begin_camera()
begin_closed_shape()
begin_contour()
begin_raw()
begin_record()
begin_shape()
bezier()
bezier_detail()
bezier_point()
bezier_tangent()
bezier_vertex()
bezier_vertices()
blend()
blend_mode()
blue()
box()
brightness()
camera()
ceil()
circle()
clear()
clip()
color()
color_mode()
constrain()
convert_cached_image()
convert_cached_shape()
convert_image()
convert_shape()
copy()
cos()
create_font()
create_graphics()
create_image()
create_image_from_numpy()
create_shape()
cursor()
curve()
curve_detail()
curve_point()
curve_tangent()
curve_tightness()
curve_vertex()
curve_vertices()
day()
degrees()
directional_light()
display_density()
display_height
display_width
dist()
ellipse()
ellipse_mode()
emissive()
end_camera()
end_contour()
end_raw()
end_record()
end_shape()
exit_sketch()
exp()
fill()
finished
floor()
flush()
focused
frame_count
frame_rate()
frustum()
full_screen()
g
get_frame_rate()
get_graphics()
get_matrix()
get_np_pixels()
get_pixels()
get_surface()
green()
has_thread()
height
hex_color()
hint()
hot_reload_draw()
hour()
hue()
image()
image_mode()
is_dead
is_dead_from_error
is_key_pressed
is_mouse_pressed
is_ready
is_running
java_platform
java_version_name
join_thread()
key
key_code
launch_promise_thread()
launch_repeating_thread()
launch_thread()
lerp()
lerp_color()
light_falloff()
light_specular()
lights()
line()
lines()
list_threads()
load_bytes()
load_font()
load_image()
load_json()
load_np_pixels()
load_pickle()
load_pixels()
load_shader()
load_shape()
load_strings()
log()
loop()
mag()
millis()
minute()
model_x()
model_y()
model_z()
month()
mouse_button
mouse_x
mouse_y
no_clip()
no_cursor()
no_fill()
no_lights()
no_loop()
no_smooth()
no_stroke()
no_tint()
noise()
noise_detail()
noise_seed()
norm()
normal()
np_pixels[]
np_random
ortho()
os_noise()
os_noise_seed()
pargs
parse_json()
perspective()
pixel_density()
pixel_height
pixel_width
pixels[]
pmouse_x
pmouse_y
point()
point_light()
points()
pop()
pop_matrix()
pop_style()
print_camera()
print_line_profiler_stats()
print_matrix()
print_projection()
println()
profile_draw()
profile_functions()
push()
push_matrix()
push_style()
quad()
quadratic_vertex()
quadratic_vertices()
radians()
random()
random_choice()
random_gaussian()
random_int()
random_sample()
random_seed()
ratio_left
ratio_scale
ratio_top
rect()
rect_mode()
red()
redraw()
remap()
request_image()
reset_matrix()
reset_shader()
rheight
rmouse_x
rmouse_y
rotate()
rotate_x()
rotate_y()
rotate_z()
run_sketch()
rwidth
saturation()
save()
save_bytes()
save_frame()
save_json()
save_pickle()
save_strings()
scale()
screen_x()
screen_y()
screen_z()
second()
select_folder()
select_input()
select_output()
set_matrix()
set_np_pixels()
set_pixels()
set_println_stream()
shader()
shape()
shape_mode()
shear_x()
shear_y()
shininess()
sin()
size()
sketch_path()
smooth()
specular()
sphere()
sphere_detail()
spot_light()
sq()
sqrt()
square()
stop_all_threads()
stop_thread()
stroke()
stroke_cap()
stroke_join()
stroke_weight()
tan()
text()
text_align()
text_ascent()
text_descent()
text_font()
text_leading()
text_mode()
text_size()
text_width()
texture()
texture_mode()
texture_wrap()
tint()
to_pil()
translate()
triangle()
update_np_pixels()
update_pixels()
vertex()
vertices()
width
window_move()
window_ratio()
window_resizable()
window_resize()
window_title()
window_x
window_y
year()
Py5Graphics
Py5Graphics.alpha()
Py5Graphics.ambient()
Py5Graphics.ambient_light()
Py5Graphics.apply_filter()
Py5Graphics.apply_matrix()
Py5Graphics.arc()
Py5Graphics.background()
Py5Graphics.begin_camera()
Py5Graphics.begin_closed_shape()
Py5Graphics.begin_contour()
Py5Graphics.begin_draw()
Py5Graphics.begin_raw()
Py5Graphics.begin_shape()
Py5Graphics.bezier()
Py5Graphics.bezier_detail()
Py5Graphics.bezier_point()
Py5Graphics.bezier_tangent()
Py5Graphics.bezier_vertex()
Py5Graphics.bezier_vertices()
Py5Graphics.blend()
Py5Graphics.blend_mode()
Py5Graphics.blue()
Py5Graphics.box()
Py5Graphics.brightness()
Py5Graphics.camera()
Py5Graphics.circle()
Py5Graphics.clear()
Py5Graphics.clip()
Py5Graphics.color()
Py5Graphics.color_mode()
Py5Graphics.copy()
Py5Graphics.create_shape()
Py5Graphics.curve()
Py5Graphics.curve_detail()
Py5Graphics.curve_point()
Py5Graphics.curve_tangent()
Py5Graphics.curve_tightness()
Py5Graphics.curve_vertex()
Py5Graphics.curve_vertices()
Py5Graphics.directional_light()
Py5Graphics.ellipse()
Py5Graphics.ellipse_mode()
Py5Graphics.emissive()
Py5Graphics.end_camera()
Py5Graphics.end_contour()
Py5Graphics.end_draw()
Py5Graphics.end_raw()
Py5Graphics.end_shape()
Py5Graphics.fill()
Py5Graphics.flush()
Py5Graphics.frustum()
Py5Graphics.get_matrix()
Py5Graphics.get_np_pixels()
Py5Graphics.get_pixels()
Py5Graphics.green()
Py5Graphics.height
Py5Graphics.hint()
Py5Graphics.hue()
Py5Graphics.image()
Py5Graphics.image_mode()
Py5Graphics.is3d()
Py5Graphics.lerp_color()
Py5Graphics.light_falloff()
Py5Graphics.light_specular()
Py5Graphics.lights()
Py5Graphics.line()
Py5Graphics.lines()
Py5Graphics.load_np_pixels()
Py5Graphics.load_pixels()
Py5Graphics.load_shader()
Py5Graphics.load_shape()
Py5Graphics.mask()
Py5Graphics.model_x()
Py5Graphics.model_y()
Py5Graphics.model_z()
Py5Graphics.next_page()
Py5Graphics.no_clip()
Py5Graphics.no_fill()
Py5Graphics.no_lights()
Py5Graphics.no_smooth()
Py5Graphics.no_stroke()
Py5Graphics.no_tint()
Py5Graphics.normal()
Py5Graphics.np_pixels[]
Py5Graphics.ortho()
Py5Graphics.perspective()
Py5Graphics.pixel_density
Py5Graphics.pixel_height
Py5Graphics.pixel_width
Py5Graphics.pixels[]
Py5Graphics.point()
Py5Graphics.point_light()
Py5Graphics.points()
Py5Graphics.pop()
Py5Graphics.pop_matrix()
Py5Graphics.pop_style()
Py5Graphics.print_camera()
Py5Graphics.print_matrix()
Py5Graphics.print_projection()
Py5Graphics.push()
Py5Graphics.push_matrix()
Py5Graphics.push_style()
Py5Graphics.quad()
Py5Graphics.quadratic_vertex()
Py5Graphics.quadratic_vertices()
Py5Graphics.rect()
Py5Graphics.rect_mode()
Py5Graphics.red()
Py5Graphics.reset_matrix()
Py5Graphics.reset_shader()
Py5Graphics.rotate()
Py5Graphics.rotate_x()
Py5Graphics.rotate_y()
Py5Graphics.rotate_z()
Py5Graphics.saturation()
Py5Graphics.save()
Py5Graphics.scale()
Py5Graphics.screen_x()
Py5Graphics.screen_y()
Py5Graphics.screen_z()
Py5Graphics.set_matrix()
Py5Graphics.set_np_pixels()
Py5Graphics.set_pixels()
Py5Graphics.shader()
Py5Graphics.shape()
Py5Graphics.shape_mode()
Py5Graphics.shear_x()
Py5Graphics.shear_y()
Py5Graphics.shininess()
Py5Graphics.smooth()
Py5Graphics.specular()
Py5Graphics.sphere()
Py5Graphics.sphere_detail()
Py5Graphics.spot_light()
Py5Graphics.square()
Py5Graphics.stroke()
Py5Graphics.stroke_cap()
Py5Graphics.stroke_join()
Py5Graphics.stroke_weight()
Py5Graphics.text()
Py5Graphics.text_align()
Py5Graphics.text_ascent()
Py5Graphics.text_descent()
Py5Graphics.text_font()
Py5Graphics.text_leading()
Py5Graphics.text_mode()
Py5Graphics.text_size()
Py5Graphics.text_width()
Py5Graphics.texture()
Py5Graphics.texture_mode()
Py5Graphics.texture_wrap()
Py5Graphics.tint()
Py5Graphics.to_pil()
Py5Graphics.translate()
Py5Graphics.triangle()
Py5Graphics.update_np_pixels()
Py5Graphics.update_pixels()
Py5Graphics.vertex()
Py5Graphics.vertices()
Py5Graphics.width
Py5Image
Py5Image.apply_filter()
Py5Image.blend()
Py5Image.copy()
Py5Image.get_np_pixels()
Py5Image.get_pixels()
Py5Image.height
Py5Image.load_np_pixels()
Py5Image.load_pixels()
Py5Image.mask()
Py5Image.np_pixels[]
Py5Image.pixel_density
Py5Image.pixel_height
Py5Image.pixel_width
Py5Image.pixels[]
Py5Image.save()
Py5Image.set_np_pixels()
Py5Image.set_pixels()
Py5Image.to_pil()
Py5Image.update_np_pixels()
Py5Image.update_pixels()
Py5Image.width
Py5Shape
Py5Shape.add_child()
Py5Shape.ambient()
Py5Shape.apply_matrix()
Py5Shape.begin_closed_shape()
Py5Shape.begin_contour()
Py5Shape.begin_shape()
Py5Shape.bezier_detail()
Py5Shape.bezier_vertex()
Py5Shape.bezier_vertices()
Py5Shape.color_mode()
Py5Shape.contains()
Py5Shape.curve_detail()
Py5Shape.curve_tightness()
Py5Shape.curve_vertex()
Py5Shape.curve_vertices()
Py5Shape.depth
Py5Shape.disable_style()
Py5Shape.emissive()
Py5Shape.enable_style()
Py5Shape.end_contour()
Py5Shape.end_shape()
Py5Shape.fill()
Py5Shape.find_child()
Py5Shape.get_ambient()
Py5Shape.get_child()
Py5Shape.get_child_count()
Py5Shape.get_child_index()
Py5Shape.get_children()
Py5Shape.get_depth()
Py5Shape.get_emissive()
Py5Shape.get_family()
Py5Shape.get_fill()
Py5Shape.get_height()
Py5Shape.get_kind()
Py5Shape.get_name()
Py5Shape.get_normal()
Py5Shape.get_normal_x()
Py5Shape.get_normal_y()
Py5Shape.get_normal_z()
Py5Shape.get_parent()
Py5Shape.get_shininess()
Py5Shape.get_specular()
Py5Shape.get_stroke()
Py5Shape.get_stroke_weight()
Py5Shape.get_texture_u()
Py5Shape.get_texture_v()
Py5Shape.get_tint()
Py5Shape.get_vertex()
Py5Shape.get_vertex_code()
Py5Shape.get_vertex_code_count()
Py5Shape.get_vertex_codes()
Py5Shape.get_vertex_count()
Py5Shape.get_vertex_x()
Py5Shape.get_vertex_y()
Py5Shape.get_vertex_z()
Py5Shape.get_width()
Py5Shape.height
Py5Shape.is2d()
Py5Shape.is3d()
Py5Shape.is_visible()
Py5Shape.no_fill()
Py5Shape.no_stroke()
Py5Shape.no_tint()
Py5Shape.normal()
Py5Shape.quadratic_vertex()
Py5Shape.quadratic_vertices()
Py5Shape.remove_child()
Py5Shape.reset_matrix()
Py5Shape.rotate()
Py5Shape.rotate_x()
Py5Shape.rotate_y()
Py5Shape.rotate_z()
Py5Shape.scale()
Py5Shape.set_ambient()
Py5Shape.set_emissive()
Py5Shape.set_fill()
Py5Shape.set_fills()
Py5Shape.set_name()
Py5Shape.set_path()
Py5Shape.set_shininess()
Py5Shape.set_specular()
Py5Shape.set_stroke()
Py5Shape.set_stroke_cap()
Py5Shape.set_stroke_join()
Py5Shape.set_stroke_weight()
Py5Shape.set_strokes()
Py5Shape.set_texture()
Py5Shape.set_texture_mode()
Py5Shape.set_texture_uv()
Py5Shape.set_tint()
Py5Shape.set_vertex()
Py5Shape.set_visible()
Py5Shape.shininess()
Py5Shape.specular()
Py5Shape.stroke()
Py5Shape.stroke_cap()
Py5Shape.stroke_join()
Py5Shape.stroke_weight()
Py5Shape.texture()
Py5Shape.texture_mode()
Py5Shape.tint()
Py5Shape.translate()
Py5Shape.vertex()
Py5Shape.vertices()
Py5Shape.width
Py5Shader
Py5Shader.set()
Py5Surface
Py5Surface.get_native()
Py5Surface.is_stopped()
Py5Surface.pause_thread()
Py5Surface.resume_thread()
Py5Surface.set_always_on_top()
Py5Surface.set_icon()
Py5Surface.set_location()
Py5Surface.set_resizable()
Py5Surface.set_size()
Py5Surface.set_title()
Py5Surface.set_visible()
Py5Surface.stop_thread()
Py5Font
Py5Font.ascent()
Py5Font.descent()
Py5Font.get_default_size()
Py5Font.get_glyph_count()
Py5Font.get_name()
Py5Font.get_post_script_name()
Py5Font.get_shape()
Py5Font.get_size()
Py5Font.is_smooth()
Py5Font.list()
Py5Font.width()
Py5MouseEvent
Py5MouseEvent.get_action()
Py5MouseEvent.get_button()
Py5MouseEvent.get_count()
Py5MouseEvent.get_millis()
Py5MouseEvent.get_modifiers()
Py5MouseEvent.get_native()
Py5MouseEvent.get_x()
Py5MouseEvent.get_y()
Py5MouseEvent.is_alt_down()
Py5MouseEvent.is_control_down()
Py5MouseEvent.is_meta_down()
Py5MouseEvent.is_shift_down()
Py5KeyEvent
Py5KeyEvent.get_action()
Py5KeyEvent.get_key()
Py5KeyEvent.get_key_code()
Py5KeyEvent.get_millis()
Py5KeyEvent.get_modifiers()
Py5KeyEvent.get_native()
Py5KeyEvent.is_alt_down()
Py5KeyEvent.is_auto_repeat()
Py5KeyEvent.is_control_down()
Py5KeyEvent.is_meta_down()
Py5KeyEvent.is_shift_down()
Py5Vector
Py5Vector.angle_between()
Py5Vector.astype()
Py5Vector.copy
Py5Vector.cross()
Py5Vector.data
Py5Vector.dim
Py5Vector.dist()
Py5Vector.dot()
Py5Vector.dtype
Py5Vector.from_heading()
Py5Vector.heading
Py5Vector.lerp()
Py5Vector.mag
Py5Vector.mag_sq
Py5Vector.norm
Py5Vector.normalize()
Py5Vector.random()
Py5Vector.rotate()
Py5Vector.rotate_around()
Py5Vector.set_heading()
Py5Vector.set_limit()
Py5Vector.set_mag()
Py5Vector.set_mag_sq()
Py5Vector.tolist()
Py5Vector.w
Py5Vector.x
Py5Vector.y
Py5Vector.z
Py5 Magics
%%py5bot
%%py5draw
%%py5drawdxf
%%py5drawpdf
%%py5drawsvg
Py5 Tools
py5_tools.add_classpath()
py5_tools.add_jars()
py5_tools.add_options()
py5_tools.animated_gif()
py5_tools.capture_frames()
py5_tools.get_classpath()
py5_tools.get_jvm_debug_info()
py5_tools.is_jvm_running()
py5_tools.live_coding.activate()
py5_tools.live_coding.copy_code()
py5_tools.live_coding.count()
py5_tools.live_coding.screenshot()
py5_tools.live_coding.snapshot()
py5_tools.offline_frame_processing()
py5_tools.register_processing_mode_key()
py5_tools.save_frames()
py5_tools.screenshot()
py5_tools.sketch_portal()
Py5 Functions
create_font_file()
get_current_sketch()
prune_tracebacks()
register_image_conversion()
register_shape_conversion()
@render()
render_frame()
render_frame_sequence()
@render_sequence()
reset_py5()
set_stackprinter_style()
Developer Information
How Does py5 Work?
Build Process
Repository
Open issue
Index