db.test.findOne({$or:
[
{'count.day.s': {$gt: 0}},
{'count.day.g': {$gt: 0}}
]
})
from PIL import Image
im = Image.open("original.png")
h, w = im.size
scale = 99 / max(h, w)
im.resize((int(h * scale), int(w * scale)), Image.ANTIALIAS).save("resized.png")
from PIL import Image
tailset = Image.open("tailset.png")
for y in range(0, tailset.height, 16): # или 17, если пробел отдельно
for x in range(0, tailset.width, 16):
tailset.crop((y, x, y + 16, x + 16)).save("%02d%02d.png" % (y // 16, x // 16))