#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
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!
2
5
673
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
1
3
450
The latest version of #py5 works w/ #shapely objects, implicitly converting to Py5Shape objects & drawing to the screen: size(999,999) stroke_weight(19) p=Polygon([[9,9],[9,990],[990,990],[990,9]]) for _ in range(8): shape(p:=p.buffer(-50,single_sided=True)) #genuary #genuary5
1
2
340
#py5 lets you manipulate pixels with `np_pixels[]`, a #numpy array w/ 3 dimensions: size(999,999) background('w') load_np_pixels() for _ in range(99): x,y,c=random_int(900), random_int(900),random_int(1,3) np_pixels[x:x+99,y:y+99,c]=0 update_np_pixels() #genuary4 #genuary
3
274
#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
2
5
810
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
3
5
439
Happy Holidays, from #py5! Made with #py5 & #axidraw
1
2
15
1,619
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
1
3
24
3,320
Happy Holidays from #py5! Wishing everyone all the best in the New Year! #plottertwitter #genart #genartclub #axidraw #processing
2
1
11
1,301
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…
4
2
29