title: while trying to make list of pixels from an image getting error 'list' object is not callable ,
body: <p>I am trying to extract pixel values from an image as a list:</p>
  
  <pre><code>from PIL import Image
  
  im = Image.open('exp.jpg','r')
  pix_val = list(im.getdata())
  pix_val_flat = [x for sets in pix_val for x in sets]
  print(pix_val_flat)
  
  Error: 
    File "C:/Users/anupa/Desktop/All Files/LZW/Code/image.py", line 4, in &lt;module&gt;
      pix_val = list(im.getdata())
  
  TypeError: 'list' object is not callable
  </code></pre>
  
  <p>But I am getting this error. Can anyone please help me?</p>