Skip to content

Releases: p5py/p5

Add support for python 3.11 and bug fixes

06 Dec 17:42
fcff509
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.8.3...v0.8.4

Stabilise skia renderer

17 Nov 11:34
d20215c
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.8.1...v0.8.3

Add pyopengl-accelarate back to dependencies

06 Dec 17:13
Compare
Choose a tag to compare
  • pyopengl-accelarate upstream issue was fixed and we can install the package now on Linux.
  • Fixed preload bug

Extending Skia2D renderer

15 Nov 06:37
ff54444
Compare
Choose a tag to compare

v0.8.1

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.

New Features

Typography support for skia #371

- p5py now support all types of fonts as found in other processing ports
- 5x efficiency in font sketches as compared to vispy renderer

Image APIs for "skia" #344

Support for Offscreen buffers #386

- create_grahpics is now available in p5py's skia renderer

Support for python 3.10 #395

- 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!

NOTE

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%

New experimental 2D renderer using skia

04 Aug 04:33
e349893
Compare
Choose a tag to compare

v0.8.0

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')

Bug Fixes

New Features

  • Along with the snake_case convention we support the camelCase
    convention for most Processing APIs #280
  • New experimental 2D renderer "skia" #344. Skia currently does not
    support typography and Image APIs, they will be implemented in
    further releases.

List of New APIs

  • 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!

Version 0.7.1

02 Sep 07:42
Compare
Choose a tag to compare

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.

List of New APIs

  • fract calculates the fractional part of a number. Contributed by @tushar5526
  • http_get and http_post makes HTTP requests to the web. Contrbuted by @nakul-shahdadpuri
  • pop_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.js

The 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

List of issues fixed in this release

  • #186 begin_shape('POINTS') does not draw points
  • #161 Cant use stroke_weight for points
  • #238 Point shape causing concatenate error
  • #171 Add support for pop syntax

This release includes contributions from @nakul-shahdadpuri, @tushar5526, and @parsoyaarihant. Thank you!

Version 0.7.0

30 Aug 07:27
Compare
Choose a tag to compare

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.

List of New APIs

  • New materials in P3D
    • normal_material assigns a color to a pixel solely based on the normal vector of the fragment being rendered. Useful for debugging
    • basic_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_lights and directional_lights
      • specular is the highlight color that interacts with point_lights and directional_lights
      • shininess determines how glossy a surface is
  • Lighting system in P3D
    • lights creates default lights
    • ambient_light is a light that's uniform everywhere
    • directional_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 highlight
    • light_falloff controls how fast a light fades with distance

List of issues fixed in this release

  • #31 Implement saveFrame()
  • #155 Output canvas to video or sequence of png's
  • #156 push_matrix() and pop_matrix() not working
  • #158 no_loop incorrectly allows an extra draw frame
  • #172 begin_contour and end_contour not working
  • #175 no_loop() when used in setup() don't call draw() but it should call draw() only once
  • #152 Occlusion of shapes in 3D Mode
  • #180 Tutorial wrong? pop_matrix() does nothing, but should be refered as reset_matrix() instead
  • #167 end_shape() is closing shapes without 'CLOSE'
  • #188 Inconsistent behavior for Arc
  • #195 Not able to create holes in a shape using begin and end contour
  • #201 remap map to remap
  • #141 AttributeError: 'Geometry' object has no attribute 'children'
  • #173 The quest for better tessellation
  • #183 Scalling with scale(1,0) does nothing. but scale(0,1) works
  • #217 Bug: Does not install or get the shaders directory
  • #213 Add support for renderer attribute in run() function
  • #222 Update installation scripts
  • #174 Add 3D material and lighting APIs
  • #66 VS Code + pylint integration with p5

This release also includes contributions from @parsoyaarihant, @jeremydouglass, @tushar5526, @Hansimov, @ReneTC, @Andy-Python-Programmer, and @galaxyproduction. Thank you!

Version 0.6.0

08 Apr 11:04
Compare
Choose a tag to compare

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).

List of new APIs

  • 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 stroke
    • p5.stroke_cap: allows the user to set the style of line endings
    • p5.stroke_join: allows the user to set the style of joints which connect the line segments
  • This release introduces limited 3D support. New functions for :

    • The p5.camera allows for specifying the camera coordinates in 3D space
    • The projection functions p5.ortho and p5.perspective allow the user to control the type of projection system being used to render 3D objects on the screen
    • New 3D shape primitives are added: p5.box, p5.plane, p5.sphere, p5.ellipsoid, p5.cylinder, p5.cone, p5.torus

List of issues fixed in this release

  • #129 millis() does not go beyond 1 second and gives microseconds()
  • #114 Rectangle not overlaying on line correctly
  • #91 Arc does not render correctly with transparency
  • #90 arc outline shows up as line in corner of window

This release also includes contributions from @edurojasr, @abhikpal and @jeremydouglass. Thanks :)

Version 0.5.0

14 Apr 07:39
54e7be3
Compare
Choose a tag to compare

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:

  1. Move the internal windowing and OpenGL framework to vispy
  2. Add support for user defined polygons
  3. Add image support

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:

  • Color by Daniel Shiffman
  • Vectors by Daniel Shiffman
  • Electronics by Hernando Berragán and Casey Reas

API Additions

  • 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

Version 0.4.0a1

18 Jul 12:03
Compare
Choose a tag to compare
Version 0.4.0a1 Pre-release
Pre-release

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:

  • #10: Sketch window stops refreshing on Mac.
  • #15: Blank sketch window on Mac
  • #16: Mouse_x and mouse_y returning negative values
  • #17: Set range limit on mouse_x and mouse_y values
  • #18: matmul operator doesn't work on Python 3.4 and less.
  • #22: Replaced @ with np.dot()
  • #23: Tuple unpacking incompatible with Python 3.4 and less.
  • #35: Removed pyglet.window.get_platform()
  • #36: Fixed distance() of class Vector by adding np.sqrt
  • #37: raise an error, when Vector.normalize() tries to normalize a "zero-vector"
  • #38: raise ValueError when Magnitude of Vector is 0
  • #39: background() inside setup() behaves strangely
  • #40: fix bug #23: Tuple unpacking incompatible with Python 3.4 and less
  • #41: matmul operator on Python version <= 3.4 (rel: #18)
  • #47: key variable not working
  • #49: Fix retina issues on the mac.
  • #50: #49 breaks the documentation auto generation
  • #9: Sketch does not cover the entire window on retina displays.

This 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!