I could not reproduce your error. On my platform (debian), only the Pillow plug is available, so if you are using the old PIL package, this may be the reason.
Image.point() . , , python.
def change_contrast(img, level):
factor = (259 * (level + 255)) / (255 * (259 - level))
def contrast(c):
return 128 + factor * (c - 128)
return img.point(contrast)
change_contrast(Image.open('barry.png'), 100)

: (). , . level 259, . - , , .
def change_contrast_multi(img, steps):
width, height = img.size
canvas = Image.new('RGB', (width * len(steps), height))
for n, level in enumerate(steps):
img_filtered = change_contrast(img, level)
canvas.paste(img_filtered, (width * n, 0))
return canvas
change_contrast_multi(Image.open('barry.png'), [-100, 0, 100, 200, 300])

, , [0-255], , , , - .
def change_contrast(img, level):
factor = (259 * (level + 255)) / (255 * (259 - level))
def contrast(c):
value = 128 + factor * (c - 128)
return max(0, min(255, value))
return img.point(contrast)