title: How to read the mask of an image using opencv in python
body: <p>I am working on this challenge called Carvana Segmentation in kaggle. The dataset consists of 5088 images, for each image there is a mask. For eg, the below is a single image (.jpg file) and its corresponding mask (.gif file).</p>
  
  <p><img src="https://i.stack.imgur.com/SZXFU.jpg" alt="enter image description here"> <img src="https://i.stack.imgur.com/BNSNB.gif" alt="enter image description here"></p>
  
  <p>I was able to read .jpg files using cv2, but not the .gif files. The syntax i used to read .gif file is </p>
  
  <pre><code> &gt;&gt;&gt; image = cv2.imread('filename.gif',cv2.IMREAD_GRAYSCALE)
  </code></pre>
  
  <p>When I try to print the image, returns None</p>
  
  <pre><code> &gt;&gt;&gt; print(image) -&gt; None
  </code></pre>
  
  <p>Can someone suggest any other method, please </p>