0

this is my option list, it will not output the question asked and skips directly to the next cell. For my header I have this,I have a bit more to add to this ,that's why I have many import. the name of the image file,

from PIL import Image, ImageFilter
import numpy as np
from PIL import ImageColor
from PIL.ImageFilter import (
   BLUR, CONTOUR, DETAIL, EDGE_ENHANCE, EDGE_ENHANCE_MORE,
   EMBOSS, FIND_EDGES, SMOOTH, SMOOTH_MORE, SHARPEN)
import PIL.ImageOps 
f=Image.open('/Users/harrysingh/Downloads/zeus.jpg')
x=input("what would you like to with this picture of a dog? (select 1 through 8 )")
if x==1:
    f1=f.filter(BLUR)
    f1.show()
elif x==2:
    f2=f.filter(CONTOUR)
    f2.show()
elif x==3:
    f3=f.filter(DETAIL)
    f3.show()
elif x==4:
    f4=f.filter(EDGE_ENHANCE)
    f4.show()
elif x==5:
    f5=f.filter(EMBOSS)
    f5.show()
elif x==6:
    f6=f.filter(FIND_EDGES)
    f6.show()
elif x==7:
    f7=f.filter(SMOOTH)
    f7.show()
elif x==8:
    f8=f.filter(SHARPEN)
    f8.show()```

1 Answers1

0

x is a string in your code, but you are checking for an integer. So "1" will never be equal to 1.

If you use:

x=int(input("what would you like to with this picture of a dog? (select 1 through 8 )"))

this problem will be gone.

Dornteufel
  • 103
  • 1
  • 6