{
  "id": 68295,
  "title": "Is every image loaded as RGB?",
  "url": "/competitions/human-protein-atlas-image-classification/discussion/68295",
  "author_name": "",
  "post_date": "2018-10-11T07:00:08.019173800Z",
  "votes": 1,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Hi, I started loading the images and I basically expected to load 4 grayscale images resulting in a size of 512x512x4. But I noticed that they are all RGB so my starting size is 512x512x12 instead. Is anyone loading them as grayscale?</p>",
  "messages": [
    {
      "id": "402083",
      "postDate": "10/11/2018 07:00:08",
      "content": "<p>Hi, I started loading the images and I basically expected to load 4 grayscale images resulting in a size of 512x512x4. But I noticed that they are all RGB so my starting size is 512x512x12 instead. Is anyone loading them as grayscale?</p>",
      "rawMarkdown": "Hi, I started loading the images and I basically expected to load 4 grayscale images resulting in a size of 512x512x4. But I noticed that they are all RGB so my starting size is 512x512x12 instead. Is anyone loading them as grayscale?",
      "votes": null
    },
    {
      "id": "402139",
      "postDate": "10/11/2018 08:15:25",
      "content": "<p>What method of loading the image do you use?</p>\n\n<p>I tried reproducing the issue using both Scipy.ndimage, skimage, and Pillow and get the images as single channel grayscale.</p>",
      "rawMarkdown": "What method of loading the image do you use?\n\nI tried reproducing the issue using both Scipy.ndimage, skimage, and Pillow and get the images as single channel grayscale.",
      "votes": null
    },
    {
      "id": "402249",
      "postDate": "10/11/2018 12:15:57",
      "content": "<p>Hi, I am using cv2.imread. I guess the default format is RGB, I will check again. But my question is, are they supposed to be grayscale or will I lose information if I load them as grayscale?</p>",
      "rawMarkdown": "Hi, I am using cv2.imread. I guess the default format is RGB, I will check again. But my question is, are they supposed to be grayscale or will I lose information if I load them as grayscale?",
      "votes": null
    },
    {
      "id": "402282",
      "postDate": "10/11/2018 13:03:00",
      "content": "<p>Each of the individual 4 channels are grayscale so you should not lose any information by loading them as such.</p>\n\n<p>I took a look at the documentation for <code>cv2.imread</code>. It seems like RGB is the default mode and loading the file with the flag <code>cv2.IMREAD_GRAYSCALE</code> should give you the grayscale image.</p>",
      "rawMarkdown": "Each of the individual 4 channels are grayscale so you should not lose any information by loading them as such.\n\nI took a look at the documentation for `cv2.imread`. It seems like RGB is the default mode and loading the file with the flag `cv2.IMREAD_GRAYSCALE` should give you the grayscale image.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 402139,
      "author_name": "cwinsnes",
      "author_url": "",
      "post_date": "10/11/2018 08:15:25",
      "content": "<p>What method of loading the image do you use?</p>\n\n<p>I tried reproducing the issue using both Scipy.ndimage, skimage, and Pillow and get the images as single channel grayscale.</p>",
      "votes": null,
      "replies": [
        {
          "id": 402249,
          "author_name": "kostaspapastamos",
          "author_url": "",
          "post_date": "10/11/2018 12:15:57",
          "content": "<p>Hi, I am using cv2.imread. I guess the default format is RGB, I will check again. But my question is, are they supposed to be grayscale or will I lose information if I load them as grayscale?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 402282,
          "author_name": "cwinsnes",
          "author_url": "",
          "post_date": "10/11/2018 13:03:00",
          "content": "<p>Each of the individual 4 channels are grayscale so you should not lose any information by loading them as such.</p>\n\n<p>I took a look at the documentation for <code>cv2.imread</code>. It seems like RGB is the default mode and loading the file with the flag <code>cv2.IMREAD_GRAYSCALE</code> should give you the grayscale image.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "402083": "Hi, I started loading the images and I basically expected to load 4 grayscale images resulting in a size of 512x512x4. But I noticed that they are all RGB so my starting size is 512x512x12 instead. Is anyone loading them as grayscale?",
    "402139": "What method of loading the image do you use?\n\nI tried reproducing the issue using both Scipy.ndimage, skimage, and Pillow and get the images as single channel grayscale.",
    "402249": "Hi, I am using cv2.imread. I guess the default format is RGB, I will check again. But my question is, are they supposed to be grayscale or will I lose information if I load them as grayscale?",
    "402282": "Each of the individual 4 channels are grayscale so you should not lose any information by loading them as such.\n\nI took a look at the documentation for `cv2.imread`. It seems like RGB is the default mode and loading the file with the flag `cv2.IMREAD_GRAYSCALE` should give you the grayscale image."
  },
  "source": "meta"
}