Tom Larrow on Nostr: Today's #CreativeCoding is some inset rectangle packing. Rather than storing all ...
Today's #CreativeCoding is some inset rectangle packing. Rather than storing all these as objects as in a traditional packing algorithm, it is evaluating the pixel array as a numpy array, and then comparing the values and making sure they are all the same value
This is really inefficient, and takes more than an hour to generate an image, but this was more my way of learning more #Numpy functions and deepening my #python understanding #py5
Code:
https://codeberg.org/TomLarrow/creative-coding-experiments/src/branch/main/x_0095
Published at
2023-08-12 22:34:29Event JSON
{
"id": "2a6e049eabcece5ff03771a0798af1cb23f51c3e8aa0a0a914d8a839f26c05ff",
"pubkey": "1337780af5edc933fa93e3cfe258f4a0b646b3c011d1fdb60c540f632a5db412",
"created_at": 1691879669,
"kind": 1,
"tags": [
[
"t",
"creativecoding"
],
[
"t",
"py5"
],
[
"t",
"python"
],
[
"t",
"numpy"
],
[
"proxy",
"https://vis.social/users/TomLarrow/statuses/110879026003734979",
"activitypub"
]
],
"content": "Today's #CreativeCoding is some inset rectangle packing. Rather than storing all these as objects as in a traditional packing algorithm, it is evaluating the pixel array as a numpy array, and then comparing the values and making sure they are all the same value\n\nThis is really inefficient, and takes more than an hour to generate an image, but this was more my way of learning more #Numpy functions and deepening my #python understanding #py5 \n\nCode: https://codeberg.org/TomLarrow/creative-coding-experiments/src/branch/main/x_0095\n\nhttps://cdn.masto.host/vissocial/media_attachments/files/110/879/017/199/245/835/original/56ae865b732e41bd.png\n\nhttps://cdn.masto.host/vissocial/media_attachments/files/110/879/017/187/366/000/original/360d7a1ae9ef0c4e.png",
"sig": "0319ea9d58a1ed6c8807716d0cdb9497b49c6064ba03bad3f6b1d8dbf0f32ba4b76426e175eccfff53a93a3e1ef42916cd526ef4c2d2f571a16bf4d779e5f5cd"
}