p5 is a Python package based on the core ideas of Processing.
Full Changelog: https://github.com/p5py/p5/compare/v0.8.3...v0.8.4
pyopengl-accelarate
upstream issue was fixed and we can install the package now on Linux.preload
bugFull Changelog: https://github.com/p5py/p5/compare/v0.8.1...v0.8.3
We are happy to announce the final developmental release under the summer fellowship at The Processing Foundation The project was supervised by Mark Zhang. This release adds on to the experimental 2D renderer using Skia.
- p5py now support all types of fonts as found in other processing ports
- 5x efficiency in font sketches as compared to vispy renderer
- create_grahpics is now available in p5py's skia renderer
- Please see the attached note below
This release includes contributions from @tushar5526, @ziyaointl, and @Mr-Sunglasses, Thank you!
PS: There are a lot of good open issues that currently need help and we would love your contributions!
pyopengl-accelarate
is omitted from the requirements.txt
temporarily. See #397 for more information about this. If you are looking for better 3D performance you can install it from the requirements.txt
file.
benchmark | with pyopengl-accelerate | without pyopengl-accelerate | change |
---|---|---|---|
arcs | 8.944169 | 9.764988 | 9.18% |
arm | 2.612446 | 2.611884 | -0.02% |
basic_shapes | 2.629553 | 2.688781 | 2.25% |
begin_contour | 2.684205 | 2.711441 | 1.01% |
curves | 4.766132 | 4.962305 | 4.12% |
custom_shapes | 4.643741 | 4.754362 | 2.38% |
custom_shapes2 | 3.75905 | 3.791483 | 0.86% |
point_demo | 2.880713 | 2.939999 | 2.06% |
primitives | 3.651718 | 3.717032 | 1.79% |
spinning-cone_p3d | 9.417307 | 9.437273 | 0.21% |
tetrahedron_p3d | 8.114283 | 8.203861 | 1.10% |
triangle_strip | 3.228278 | 3.228012 | -0.01% |
world_p3d | 26.883501 | 26.991062 | 0.40% |
We are happy to announce another developmental release under the summer fellowship at The Processing Foundation. The project was supervised by Mark Zhang. This release comes with an experimental 2D renderer using Skia. The skia 2D renderer shows significant improvements in both rendering and efficiency of the sketches.
You can use the new 2D renderer by using the renderer
argument in run
function run(renderer='skia')
frame_rate
{.interpreted-text role="any"} sets frame rate for a sketch (only for skia)rect
{.interpreted-text role="any"} now supports border radius (only for skia)CORNERS
{.interpreted-text role="any"} CORNERS mode added (only for skia)focussed
{.interpreted-text role="any"} holds whether the current window is in focus or not (only for skia)
All the API previously present are supported as well in skia.
Here are some profiling results comparing the time taken to draw 100 frames for different sketches
Name | Skia | Vispy |
---|---|---|
arcs | 2.11s | 10.06s |
custom_shapes | 1.84s | 5.00s |
triangle_strip | 2.55s | 3.33s |
curves | 1.76s | 5.41s |
primitives | 1.73s | 3.9s |
This release includes contributions from @tushar5526, @niklasr22, @ziyaointl, @nakul-shahdadpuri, @andreasWallner, @janbehrens, @yogeshhk, @cuppajoeman, @willtryagain, @parsoyaarihant, @Kartik-byte, @Andy-Python-Programmer, @Mr-Sunglasses Thank you!
We are happy to announce another developmental release from Google Summer of Code 2020! This is the final release for GSOC this year and includes API refactors, additions, and bug fixes with compatibility and stability as foci.
fract
calculates the fractional part of a number. Contributed by @tushar5526http_get
and http_post
makes HTTP requests to the web. Contrbuted by @nakul-shahdadpuripop_matrix
and pop_style
are alternatives to the context manager syntax used by previous version. Accordingly, push_matrix
and pop_matrix
can now both act as context managers and be directly called like in Processing or p5.jsThe following additional signatures are added for compatibility with other Processing dialects
line(x1, y1, x2, y2)
line(x1, y1, z1, x2, y2, z2)
ellipse(a, b, c, d, mode=None)
circle(x, y, radius, mode=None)
arc(x, y, width, height, start_angle, stop_angle, mode=None, ellipse_mode=None)
image(img, x, y)
image(img, x, y, w, h)
triangle(x1, y1, x2, y2, x3, y3)
quad(x1, y1, x2, y2, x3, y3, x4, y4)
rect(x, y, w, h)
square(x, y, side_length)
bezier(x1, y1, x2, y2, x3, y3, x4, y4)
bezier(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4)
curve(x1, y1, x2, y2, x3, y3, x4, y4)
curve(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4)
camera(position_x, position_y, position_z, target_x, target_y, target_z, up_x, up_y, up_z)
camera(position, target_position, up_vector)
text(text_string, x, y)
text(text_string, x, y, z)
The following functions can now take floats and tuples of arbitrary length
bezier_point
bezier_tangent
curve_point
curve_tangent
quadratic_point
This release includes contributions from @nakul-shahdadpuri, @tushar5526, and @parsoyaarihant. Thank you!
We are happy to announce another developmental release from Google Summer of Code! This release includes bug fixes, a refactored rendering pipeline with improved performance, new 3D capabilities, and new example code.
normal_material
assigns a color to a pixel solely based on the normal vector of the fragment being rendered. Useful for debuggingbasic_material
returns a uniform color.blinn_phong_material
is a material based on the Blinn-Phong reflection model. This is the most “realistic” material in p5py. Parameters to adjust it include
ambient
is the color that interacts with ambient_lights
diffuse/emissive
is the surface color that interacts with point_light
s and directional_light
sspecular
is the highlight color that interacts with point_light
s and directional_light
sshininess
determines how glossy a surface islights
creates default lightsambient_light
is a light that's uniform everywheredirectional_light
comes from one direction: it is stronger when hitting a surface squarely, and weaker if it hits at a gentle angle.point_light
comes from one location and emits to all directions.light_specular
controls the color of the specular highlightlight_falloff
controls how fast a light fades with distanceThis release also includes contributions from @parsoyaarihant, @jeremydouglass, @tushar5526, @Hansimov, @ReneTC, @Andy-Python-Programmer, and @galaxyproduction. Thank you!
p5 version 0.5.0 is the final release for the Google Summer of Code 2018 project by Abhik Pal The project was supervised by Manindra Mohrarna of the Processing Foundation. The goal of the project were:
We met all of these goals completely. The first was covered by a release from earlier in the summer. These release notes summarize our later two goals. In addition to the stated goals we were also able to add minimal typography support and port some tutorials from Processing to p5:
The p5.PShape
class is equivalent to PShape in Processing. This allows creation of arbitrary user defined polygons that can have their own style (fill, stroke, etc) and transform (rotation, translation) attributes.
The p5.PImage
class allows for manipulating images in p5. Most of the API is similar to that of Processing's. Each image object "pretends" to be a 2D array and hence operations for cropping, copying, and pasting data can have implemented as indexing operations on the image. For instance, given some image img
with dimensions 800 × 600, img[400:, :300]
gives a new image with the required region. Individual pixels can be set / read as p5.Color
objects though indices into the image. The class also includes functionality to apply filters and blend two images together.
The p5.load_image
and p5.image
function allow, respectively, loading and displaying images on the screen.
The p5.image_mode
function controls how parameters to p5.image
are interpreted.
p5.tint
and the related p5.no_tint
function allow for setting and disabling tinting of images that are drawn on the screen.
The p5.load_pixels
context manager loads the current display as a global pixels
PImage object. This combines functionality of Processing's loadPixels()
and updatePixels()
.
p5.save
and p5.save_frame
methods allow users to either save the current state of the sketch or the final rendered frame as an image.
This release also introduces some basic typography functions like p5.text
for displaying text on screen. The p5.load_font
and p5.create_font
allow loading font files to change the display typeface using text_font
. As of now, only TrueType (ttf) and bitmap fonts are sup
We're happy to announce a developmental release from this Google Summer of Code 2019 project! This release includes addition of new APIs. In addition to the new APIs, many examples and tutorials are added for p5 modules (the details can be found on the p5 documentation website).
Typography methods p5.text_align
, p5.text_leading
and p5.text_size
allows the user to control different position and size attributes of the text. Methods p5.text_ascent
, p5.text_descent
and p5.text_width
can be used to obtain different dimensional attributes of text.
p5.load_shape
function allows the user to load an SVG file which can be rendered on the screen. The SVG shape is converted into PShape primitives and rendered on the screen using p5.shape
method.
The methods p5.begin_shape
and p5.end_shape
can be used to make custom shapes defined by different vertex types (p5.vertex
, p5.curve_vertex
, p5.bezier_vertex
, p5.quadratic_vertex
). Contours inside a shape can also be created using p5.begin_contour
and p5.end_contour
methods.
Stroke methods allows the user to control the stroke width and styles:
p5.stroke_weight
: allows for specifying the width of strokep5.stroke_cap
: allows the user to set the style of line endingsp5.stroke_join
: allows the user to set the style of joints which connect the line segmentsThis release introduces limited 3D support. New functions for :
p5.camera
allows for specifying the camera coordinates in 3D spacep5.ortho
and p5.perspective
allow the user to control the type of projection system being used to render 3D objects on the screenp5.box
, p5.plane
, p5.sphere
, p5.ellipsoid
, p5.cylinder
, p5.cone
, p5.torus
This release also includes contributions from @edurojasr, @abhikpal and @jeremydouglass. Thanks :)
We're happy to announce a developmental release from this year's Google Summer of Code project! While we haven't changed the public API much, the whole backend has been re-written to use vispy. This has allowed us to remove many platform specific issues. In particular, this release closes the following pending issues and pull requests:
background()
inside setup()
behaves strangelyThis release also includes contributions from @parsoyaarihant, @Devrim-Celik, @hx2A, and @antiboredom. Thank you : )
Head over to the installation page for getting started with the new p5 version! The documentation is hosted on p5.rtfd.io and we have many example sketches in a separate repository.
We're excited to hear what you have to say!