
#py5 is a new version of Processing for Python 3.9+. This library connects the #Processing Java libraries to #Python using #JPype. @py5coding@fosstodon.org
Earth
Joined June 2021
- Tweets363
- Following21
- Followers857
- Likes411
Everyone! Here is the recording of the #py5 presentation delivered at #pycon2024 a few months ago in Pittsburgh, PA (USA):
youtu.be/pNVn3FPi5PU
It was a thrill to share py5 with the Python community at #pycon ! Please give the video a thumbs up!
Creating 10K of something is easy with #py5's vectorized methods:
size(999,999,P2D)
color_mode(CMAP,"hot")
stroke_weight(32)
s=create_shape()
with s.begin_shape(POINTS):
s.vertices(999*np.random.rand(N:=10000,2))
s.set_strokes(color(x/N,64)for x in range(N))
shape(s)
#genuary16
#py5's new to_pil() method returns the frame as a PIL Image, making it easy to implement a Droste effect with a loop:
size(1024,1024)
background('w')
image(Image.open('logo.png'),512,512)
for _ in range(9):
image(to_pil().resize((595,595)),0,0)
#genuary #genuary3
This week's #py5 release added a new color mode based on @matplotlib's colormaps, adding to the RGB and HSB modes:
size(999,999)
color_mode(CMAP,mpl.colormaps['jet'])
stroke_weight(99)
for _ in range(999):
stroke(random(),99)
point(random(999),random(999))
#genuary #processing
A spin on @shiffman's Flocking #processing Sketch: make calls from #java to #python to use @scikit_learn's KMeans algo to cluster the Boids, & they only influence their own cluster. This is #py5's new Processing Mode, making the Python ecosystem available to @ProcessingOrg users
Happy Holidays from #py5! Wishing everyone all the best in the New Year!
#plottertwitter #genart #genartclub #axidraw #processing
Here's a quick demo of how you can combine #py5 with @matplotlib in an animation. Gets a solid 60fps.
Code: gist.github.com/hx2A/200b851…
Happy to help you, @jkantel! I was able to get #py5's kernels working in #Jupyter Desktop by changing it's #python environment to one that had the kernels installed. See github.com/jupyterlab/jupyte… Also, I didn't know about Jupyter Desktop, thanks for mentioning it!
This Post is from an account that no longer exists. Learn more
Replying to @villares @falbriard
#matplotlib color gradients work great with #py5.
Something like:
size(999,999)
from matplotlib import cm
color_mode(RGB,1,1,1,1)
for _ in range(2000):
x=random(width)
y=random(height)
fill(*cm.viridis(x/width))
square(x,y,10)
#つぶやきProcessing
#つぶやきProcessing of a new #py5 feature: use #matplotlib colors if it is installed
size(999,999)
background('w')
text_size(99)
for i,c in enumerate('r,m,blue,plum,turquoise,darkviolet,firebrick,xkcd:ugly brown,chartreuse,tab:olive'.split(',')):
fill(c);text(c,z:=(1+i)*25,4*z)














