Skip to content

Commit

Permalink
7
Browse files Browse the repository at this point in the history
  • Loading branch information
villares committed Dec 8, 2024
1 parent da8b425 commit 662688b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Binary file added 2024/sketch_2024_12_07/sketch_2024_12_07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions 2024/sketch_2024_12_07/sketch_2024_12_07.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import numpy as np
import py5
from skimage import measure
from skimage.segmentation import slic
from skimage.data import astronaut
from skimage.color import label2rgb

astronaut_image = astronaut()
astronaut_segments = slic(astronaut_image,
n_segments=100,
compactness=10) * 10 % 255

def setup():
global img
py5.size(512, 512)
py5.color_mode(py5.HSB)
img = py5.create_image_from_numpy(astronaut_segments, 'L')

#def draw():
py5.image(img, 0, 0)
t = py5.mouse_x / py5.width * 255
py5.image(img, 0, 0)
py5.save('out.png')

py5.run_sketch(block=False)

0 comments on commit 662688b

Please sign in to comment.