kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
3ad38f69b6
commit
042b7dfa16
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
version="1.0"
|
||||
viewBox="0 0 29 29"
|
||||
id="svg1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1" />
|
||||
<path
|
||||
d="m 0,5.9994379 2.9997,-1.9998 14.9985,3.9996 6.9993,-6.99930004 a 2.1211082,2.1211082 0 0 1 2.9997,2.99970004 l -6.9993,6.9993001 3.9996,14.9985 -1.9998,2.9997 -6.9993,-12.9987 -4.9995,4.9995 v 3.9996 l -1.9998,1.9998 -1.9998,-4.9995 -4.9995,-1.9998 1.9998,-1.9998 h 3.9996 l 4.9995,-4.9995 z"
|
||||
id="path1"
|
||||
style="stroke-width:0.9999" />
|
||||
</svg>
|
||||
|
Po Szerokość: | Wysokość: | Rozmiar: 589 B |
Plik binarny nie jest wyświetlany.
|
Po Szerokość: | Wysokość: | Rozmiar: 14 KiB |
|
|
@ -0,0 +1,42 @@
|
|||
import py5
|
||||
|
||||
S = 10 # scale factor
|
||||
|
||||
def setup():
|
||||
global osb, svg, mask
|
||||
py5.size(500, 500)
|
||||
py5.color_mode(py5.CMAP, py5.mpl_cmaps.VIRIDIS_R, 255)
|
||||
w, h = 500 * S, 500 * S
|
||||
osb = py5.create_graphics(w, h)
|
||||
py5.no_loop()
|
||||
|
||||
svg = py5.load_shape('Aiga_departingflights.svg')
|
||||
svg.disable_style()
|
||||
mask = py5.create_graphics(w, h)
|
||||
mask.begin_draw()
|
||||
mask.no_stroke()
|
||||
mask.shape(svg, w * 0.05, h * 0.05, w * 0.9, h * 0.9)
|
||||
mask.end_draw()
|
||||
osb.no_smooth() # before begin_draw!
|
||||
osb.begin_draw()
|
||||
osb.stroke_cap(py5.SQUARE)
|
||||
osb.background(py5.color(0))
|
||||
osb.scale(S)
|
||||
for _ in range(200):
|
||||
x = py5.random_int(-255, 500 + 255)
|
||||
y = py5.random_int(-255, 500 + 255)
|
||||
for i in range(255):
|
||||
if py5.random_int(1, 10) > 5:
|
||||
# you need to use py5.color() with Py5Graphics attributes
|
||||
osb.stroke(py5.color(i))
|
||||
else:
|
||||
osb.stroke(0, 0)
|
||||
osb.line(x + i, y, x + i, y + 255)
|
||||
osb.end_draw()
|
||||
osb.mask(mask)
|
||||
py5.background('black')
|
||||
py5.image(osb, 0, 0, py5.width, py5.height)
|
||||
osb.save('out.png', drop_alpha=False) # necessary for the masking!
|
||||
|
||||
|
||||
py5.run_sketch(block=False)
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
import py5
|
||||
|
||||
S = 2 # scale factor
|
||||
|
||||
def setup():
|
||||
global osb, svg, mask
|
||||
py5.size(500, 500)
|
||||
w, h = 500 * S, 500 * S
|
||||
osb = py5.create_graphics(w, h)
|
||||
mask = py5.create_graphics(w, h)
|
||||
mask.begin_draw()
|
||||
mask.no_stroke()
|
||||
mask.circle(w / 2, h / 2, w)
|
||||
mask.end_draw()
|
||||
osb.begin_draw()
|
||||
osb.background(py5.color(0))
|
||||
osb.scale(S)
|
||||
for x in range(0, py5.width, 10):
|
||||
osb.stroke('white')
|
||||
osb.line(x, 0, x, py5.height)
|
||||
osb.end_draw()
|
||||
osb.mask(mask)
|
||||
py5.image(osb, 0, 0, py5.width, py5.height)
|
||||
osb.save('out.png', drop_alpha=False)
|
||||
|
||||
py5.run_sketch(block=False)
|
||||
|
|
@ -26,6 +26,16 @@ If you appreciate what I have been doing, you may also support my artistic work,
|
|||
<!-- SKETCHES_START -->
|
||||
|
||||
|
||||
---
|
||||
|
||||
### sketch_2025_09_14
|
||||
|
||||

|
||||
|
||||
[sketch_2025_09_14](https://github.com/villares/sketch-a-day/tree/main/2025/sketch_2025_09_14) [[py5](https://py5coding.org/)]
|
||||
|
||||
I like the public domain AIGA pictogram for departures :)
|
||||
|
||||
---
|
||||
|
||||
### sketch_2025_09_13
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue