Skip to content

Commit cf1a224

Browse files
committed
cells partial fixe
1 parent 894a38d commit cf1a224

38 files changed

+149
-37
lines changed

.DS_Store

0 Bytes
Binary file not shown.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ main("input/im1.jpg", "output/out1.jpg", iterations=6, live=False)
2020
| Original | Processed |
2121
|----------|-----------|
2222
| ![](input/im1.jpg) | ![](output/out1.jpg) |
23-
| ![](input/im2.jpg) | ![](output/out2.jpg) |
24-
| ![](input/im3.jpg) | ![](output/out3.jpg) |
23+
| ![](input/time1.jpg) | ![](output/time1out.jpg) |
24+
| ![](input/im12.jpg) | ![](output/out12.jpg) |
-487 Bytes
Binary file not shown.
1.54 KB
Binary file not shown.

imgtools.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@ def get_mean_color(img, cell):
3131
b = int(b/((cell[1]-cell[0])*(cell[3]-cell[2])))
3232
return (r,g,b)
3333

34-
def put_stroke(img, position, color):
35-
xs = position[0]
36-
xf = position[1]
37-
ys = position[2]
38-
yf = position[3]
39-
40-
percent1 = 3
41-
percent2 = 5
34+
def put_stroke(img, position_ori, color):
35+
xs = position_ori[0] - int((position_ori[0]/100)*2)
36+
xf = position_ori[1] + int((position_ori[0]/100)*2)
37+
ys = position_ori[2] - int((position_ori[0]/100)*2)
38+
yf = position_ori[3] + int((position_ori[0]/100)*2)
39+
#print(f"position: ({xs}:{xf}, {ys}:{yf})")
40+
41+
#percent1 = 5
42+
#percent2 = 5
4243

43-
if position[0] - int((position[0]/100)*percent1) > 0:
44+
'''if position[0] - int((position[0]/100)*percent1) > 0:
4445
xs = position[0] - int((position[0]/100)*percent1)
4546
else:
4647
if position[0] - int((position[0]/100)*percent2) > 0:
@@ -63,8 +64,8 @@ def put_stroke(img, position, color):
6364
else:
6465
if position[3] + int((position[3]/100)*percent2) < img.shape[1]:
6566
yf = position[3] + int((position[3]/100)*percent2)
66-
67-
67+
'''
68+
position = []
6869
position = [xs, xf, ys, yf]
6970
x = (position[1]-position[0])
7071
y = (position[3]-position[2])
@@ -108,12 +109,14 @@ def get_4cell(cell):
108109
[sx+int(x/2), fx, sy, sy+int(y/2)],
109110
[sx+int(x/2), fx, sy+int(y/2), fy],
110111
]
112+
113+
#print(cells[0])
111114
return cells
112115

113116

114117
def get_random_brush():
115118
brushes = [ "brushes/brush2.png", "brushes/brush3.png", "brushes/brush4.png", "brushes/brush6.png", "brushes/brush7.png"]
116-
#brushes = ["brushes/brush4.png", "brushes/brush6.png", "brushes/brush7.png"]
119+
#brushes = ["brushes/brush4.png", "brushes/brush6.png", "brushes/brush7.png", "brushes/brush3.png", "brushes/brush4.png",]
117120
#brushes = ["brushes/brush2.png"]
118121
return random.choice(brushes)
119122

input/cartoon_mela.jpg

81.9 KB
Loading

input/im10.jpg

70.6 KB
Loading

input/im11.jpg

599 KB
Loading

input/im12.jpg

795 KB
Loading

input/im4.jpg

289 KB
Loading

0 commit comments

Comments
 (0)