Change contrast of image in PIL

后端 未结 2 933
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 06:53

I have a program that\'s supposed to change the contrast, but I feel like it\'s not really changing the contrast.It changes some areas to red whereas I don\'t want it to. If

2条回答
  •  独厮守ぢ
    2020-12-30 07:03

    There's already built a class called contrast in PIL module. You can simply use it.

    from PIL import Image, ImageEnhance
    image = Image.open(':\\Users\\omar\\Desktop\\Site\\Images\\obama.png')
    scale_value=scale1.get()
    image = ImageEnhance.Contrast(image).enhance(scale_value)
    image.show()
    

提交回复
热议问题