Skip to content

Commit 481d3b3

Browse files
committed
Minor fixes
1 parent e3b3279 commit 481d3b3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GEN TILES CONFS
22

3-
# number of divisions per color (R, G and B)
3+
# number of divisions per channel (R, G and B)
44
# DEPTH = 4 -> 4 * 4 * 4 = 64 colors
55
DEPTH = 4
66
# list of rotations, in degrees, to apply over the original image
@@ -12,7 +12,8 @@
1212

1313
# TILER CONFS
1414

15-
# number of colors per image
15+
# number of divisions per channel
16+
# (COLOR_DEPTH = 32 -> 32 * 32 * 32 = 32768 colors)
1617
COLOR_DEPTH = 32
1718
# tiles scales (1 = default resolution)
1819
RESIZING_SCALES = [0.5, 0.4, 0.3, 0.2, 0.1]

tiler.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ def resize_image(img, ratio):
4444

4545

4646
# the most frequent color in an image and its relative frequency
47-
def mode_color(img, ingore_alpha=False):
47+
def mode_color(img, ignore_alpha=False):
4848
counter = defaultdict(int)
4949
total = 0
5050
for y in img:
5151
for x in y:
52-
if len(x) < 4 or ingore_alpha or x[3] != 0:
52+
if len(x) < 4 or ignore_alpha or x[3] != 0:
5353
counter[tuple(x[:3])] += 1
5454
else:
5555
counter[(-1,-1,-1)] += 1
@@ -83,7 +83,7 @@ def load_tiles(paths):
8383
if os.path.isdir(path):
8484
for tile_name in tqdm(os.listdir(path)):
8585
tile = read_image(os.path.join(path, tile_name))
86-
mode, rel_freq = mode_color(tile, ingore_alpha=True)
86+
mode, rel_freq = mode_color(tile, ignore_alpha=True)
8787
if mode is not None:
8888
for scale in RESIZING_SCALES:
8989
t = resize_image(tile, scale)

0 commit comments

Comments
 (0)