def METHOD_NAME(img, fraction=2, bilinear=False):
    if bilinear:
        img = BilinImage(img.width, img.height, data=img.data)
    else:
        img = NNImage(img.width, img.height, data=img.data)
    out = Image(img.width, img.height, data=img.data[:])
    maxr = img.height / (fraction + 1)
    for y in range(int(img.height / 2 - maxr), int(img.height / 2 + maxr)):
        for x in range(int(img.width / 2 - maxr), int(img.width / 2 + maxr)):
            dx, dy = x - img.width / 2, y - img.height / 2
            a = atan2(dy, dx)
            r = sqrt(dx ** 2 + dy ** 2)
            if r < maxr:
                nr = r * r / maxr
                nx, ny = nr * cos(a), nr * sin(a)
                out[x,y] = min(int(img[nx + img.width / 2, ny + img.height / 2]), 255)
            else:
                out[x,y] = img[x,y]
    return out