def get_map_area(x, y, z, size=15, scale=8, crosshair=True):
    'Gets a minimap picture of a map area\n\n    size refers to the radius of the image in actual tibia sqm\n    scale is how much the image will be streched (1 = 1 sqm = 1 pixel)'
    c = tibiaDatabase.cursor()
    c.execute('SELECT * FROM WorldMap WHERE z LIKE ?', (z,))
    result = c.fetchone()
    im = Image.open(io.BytesIO(bytearray(result['image'])))
    im = im.crop(((x - size), (y - size), (x + size), (y + size)))
    im = im.resize(((size * scale), (size * scale)))
    if crosshair:
        draw = ImageDraw.Draw(im)
        (width, height) = im.size
        draw.line((0, (height / 2), width, (height / 2)), fill=128)
        draw.line(((width / 2), 0, (width / 2), height), fill=128)
    img_byte_arr = io.BytesIO()
    im.save(img_byte_arr, format='png')
    img_byte_arr = img_byte_arr.getvalue()
    return img_byte_arr
Gets a minimap picture of a map area

size refers to the radius of the image in actual tibia sqm
scale is how much the image will be streched (1 = 1 sqm = 1 pixel)
def get_map_area(x, y, z, size=15, scale=8, crosshair=True):
    'Gets a minimap picture of a map area\n\n    size refers to the radius of the image in actual tibia sqm\n    scale is how much the image will be streched (1 = 1 sqm = 1 pixel)'
    c = tibiaDatabase.cursor()
    c.execute('SELECT * FROM WorldMap WHERE z LIKE ?', (z,))
    result = c.fetchone()
    im = Image.open(io.BytesIO(bytearray(result['image'])))
    im = im.crop(((x - size), (y - size), (x + size), (y + size)))
    im = im.resize(((size * scale), (size * scale)))
    if crosshair:
        draw = ImageDraw.Draw(im)
        (width, height) = im.size
        draw.line((0, (height / 2), width, (height / 2)), fill=128)
        draw.line(((width / 2), 0, (width / 2), height), fill=128)
    img_byte_arr = io.BytesIO()
    im.save(img_byte_arr, format='png')
    img_byte_arr = img_byte_arr.getvalue()
    return img_byte_arr