{
  "id": 37169,
  "title": "mask file dimensions  and gif format",
  "url": "/competitions/carvana-image-masking-challenge/discussion/37169",
  "author_name": "",
  "post_date": "2017-07-28T06:06:15.881596900Z",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Is there any  specific reason behind using gif format for mask files? Does having 4 channels provide any additional information?</p>\n\n<pre><code>import matplotlib.pyplot as plt\nmask = plt.imread('../input/train_masks/42a3297ccd4b_03_mask.gif')\nmask.shape\n</code></pre>\n\n<p>(1280, 1918, 4)</p>\n\n<p>I can understand the train image dimensions as height, width and 3 channels for RGB.</p>\n\n<pre><code> img = plt.imread('../input/train/42a3297ccd4b_03.jpg')\n img.shape\n</code></pre>\n\n<p>(1280, 1918, 3)</p>\n\n<p>What could have lost if the mask files where png files?</p>",
  "messages": [
    {
      "id": "207996",
      "postDate": "07/28/2017 06:06:15",
      "content": "<p>Is there any  specific reason behind using gif format for mask files? Does having 4 channels provide any additional information?</p>\n\n<pre><code>import matplotlib.pyplot as plt\nmask = plt.imread('../input/train_masks/42a3297ccd4b_03_mask.gif')\nmask.shape\n</code></pre>\n\n<p>(1280, 1918, 4)</p>\n\n<p>I can understand the train image dimensions as height, width and 3 channels for RGB.</p>\n\n<pre><code> img = plt.imread('../input/train/42a3297ccd4b_03.jpg')\n img.shape\n</code></pre>\n\n<p>(1280, 1918, 3)</p>\n\n<p>What could have lost if the mask files where png files?</p>",
      "rawMarkdown": "Is there any  specific reason behind using gif format for mask files? Does having 4 channels provide any additional information?\n\n    import matplotlib.pyplot as plt\n    mask = plt.imread('../input/train_masks/42a3297ccd4b_03_mask.gif')\n    mask.shape\n\n(1280, 1918, 4)\n\nI can understand the train image dimensions as height, width and 3 channels for RGB.\n   \n\n     img = plt.imread('../input/train/42a3297ccd4b_03.jpg')\n     img.shape\n\n(1280, 1918, 3)\n\nWhat could have lost if the mask files where png files?",
      "votes": null
    },
    {
      "id": "208017",
      "postDate": "07/28/2017 07:42:34",
      "content": "<p>We used 1-bit depth gif files to reduce file size. Either gif or png would give us lossless masks, while jpg lets us compress the rgb data.</p>",
      "rawMarkdown": "We used 1-bit depth gif files to reduce file size. Either gif or png would give us lossless masks, while jpg lets us compress the rgb data.",
      "votes": null
    },
    {
      "id": "208071",
      "postDate": "07/28/2017 12:53:56",
      "content": "",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "208072",
      "postDate": "07/28/2017 12:55:17",
      "content": "<p>Why not use a binary .bmp?</p>",
      "rawMarkdown": "Why not use a binary .bmp?",
      "votes": null
    },
    {
      "id": "208079",
      "postDate": "07/28/2017 13:05:28",
      "content": "<p>bmp didn't win the coin flip</p>",
      "rawMarkdown": "bmp didn't win the coin flip",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 208017,
      "author_name": "brianshaler",
      "author_url": "",
      "post_date": "07/28/2017 07:42:34",
      "content": "<p>We used 1-bit depth gif files to reduce file size. Either gif or png would give us lossless masks, while jpg lets us compress the rgb data.</p>",
      "votes": null,
      "replies": [
        {
          "id": 208072,
          "author_name": "adizhol",
          "author_url": "",
          "post_date": "07/28/2017 12:55:17",
          "content": "<p>Why not use a binary .bmp?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 208079,
          "author_name": "brianshaler",
          "author_url": "",
          "post_date": "07/28/2017 13:05:28",
          "content": "<p>bmp didn't win the coin flip</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 208071,
      "author_name": "adizhol",
      "author_url": "",
      "post_date": "07/28/2017 12:53:56",
      "content": "",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "207996": "Is there any  specific reason behind using gif format for mask files? Does having 4 channels provide any additional information?\n\n    import matplotlib.pyplot as plt\n    mask = plt.imread('../input/train_masks/42a3297ccd4b_03_mask.gif')\n    mask.shape\n\n(1280, 1918, 4)\n\nI can understand the train image dimensions as height, width and 3 channels for RGB.\n   \n\n     img = plt.imread('../input/train/42a3297ccd4b_03.jpg')\n     img.shape\n\n(1280, 1918, 3)\n\nWhat could have lost if the mask files where png files?",
    "208017": "We used 1-bit depth gif files to reduce file size. Either gif or png would give us lossless masks, while jpg lets us compress the rgb data.",
    "208071": "",
    "208072": "Why not use a binary .bmp?",
    "208079": "bmp didn't win the coin flip"
  },
  "source": "meta"
}