title: Trying to put multiple images black and white, Python
body: <p>Im trying to put multiple images in black and white, but all the images are getting full black, i cant figure out where is the error:</p>
  <pre class="lang-py prettyprint-override"><code>def bw():
      #images = [cv2.imread(file) for file in glob.glob(&quot;C:/PythonProjects/*frame.jpg&quot;)]
      img_dir = &quot;C:/PythonProjects&quot;  # Directory of all images
      data_path = os.path.join(img_dir, '*frame.jpg')  #Filter becouse I only want some type of images
      files = glob.glob(data_path)
      data = []
  
      plus = Image.open(&quot;124frame.jpg&quot;)           #getting the image just to get his size for the FOR cycle
  
  
      for j in files:
          img = cv2.imread(j)
          data.append(img)         #Save the images into a list
  
  
      for i in range(0, 130):      #128 are the numbers of images I want to work with
          img_data = data[i]               #Select image by image from the list
         
  
          # Run the image
          lst = []
          for j in img_data:
              lst.append(j[0] * 0.2125 + j[1] * 0.7169 + j[2] * 0.0689)     #Black and White algorithm
                                                                            #Using the pixels then saving them to a List
          #New Image
          new_image = Image.new(&quot;L&quot;, plus.size)
          new_image.putdata(lst)                            #Put the data from the list to the new image
  
          new_image = numpy.array(new_image)
          #Save the image
          cv2.imwrite(&quot;bwframe%d.jpg&quot; % i, new_image)
  </code></pre>