py5coding on Nostr: #py5 lets you manipulate pixels with `np_pixels[]`, a #numpy array with 3 dimensions, ...
#py5 lets you manipulate pixels with `np_pixels[]`, a #numpy array with 3 dimensions, much like how you'd work with pixels using other Python tools.
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()
#genuary #genuary4 #processing
Published at
2024-01-04 20:56:46Event JSON
{
"id": "c682e4412fcc7fc883cdb0c14cf8442c93699fa932d622992b4a96829264be21",
"pubkey": "84ee38e8a3fd005f79ad54ce399885a0a0493f3345fcfcdd92353994b25bc89b",
"created_at": 1704401806,
"kind": 1,
"tags": [
[
"t",
"py5"
],
[
"t",
"numpy"
],
[
"t",
"GENUARY"
],
[
"t",
"genuary4"
],
[
"t",
"processing"
],
[
"proxy",
"https://fosstodon.org/users/py5coding/statuses/111699676783095268",
"activitypub"
]
],
"content": "#py5 lets you manipulate pixels with `np_pixels[]`, a #numpy array with 3 dimensions, much like how you'd work with pixels using other Python tools.\n\nsize(999,999)\nbackground('w')\nload_np_pixels()\nfor _ in range(99):\n x,y,c=random_int(900), random_int(900), random_int(1,3)\n np_pixels[x:x+99,y:y+99,c]=0\nupdate_np_pixels()\n\n#genuary #genuary4 #processing\n\nhttps://cdn.fosstodon.org/media_attachments/files/111/699/668/026/039/483/original/59230b445d337b45.png",
"sig": "576effff376c5bcf7bad4d5ee2651ef5bb524acbfa68eb9ecf9bb9e39f52bbf1e064a248a4f2f1e2376be2063fed592eac424e758571939e1b1ddd8e91327c04"
}