{
  "id": 167160,
  "title": "How to apply colormaps to gray images? (saving the color in the image)",
  "url": "/competitions/osic-pulmonary-fibrosis-progression/discussion/167160",
  "author_name": "",
  "post_date": "2020-07-15T12:48:39.900671800Z",
  "votes": 1,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Hi to everyone,</p>\n\n<p>how can I <strong>change</strong> images from gray to colormaps?\nI mean changing, not plotting. \nPlotting images with the cmap is easy.\nBut how can I apply this new color in the image.\nSo that I get a colorimage back instead of only havin a plot?</p>\n\n<p>best regards\nFred</p>",
  "messages": [
    {
      "id": "930412",
      "postDate": "07/15/2020 12:48:39",
      "content": "<p>Hi to everyone,</p>\n\n<p>how can I <strong>change</strong> images from gray to colormaps?\nI mean changing, not plotting. \nPlotting images with the cmap is easy.\nBut how can I apply this new color in the image.\nSo that I get a colorimage back instead of only havin a plot?</p>\n\n<p>best regards\nFred</p>",
      "rawMarkdown": "Hi to everyone,\n\nhow can I **change** images from gray to colormaps?\nI mean changing, not plotting. \nPlotting images with the cmap is easy.\nBut how can I apply this new color in the image.\nSo that I get a colorimage back instead of only havin a plot?\n\nbest regards\nFred",
      "votes": null
    },
    {
      "id": "930431",
      "postDate": "07/15/2020 13:04:08",
      "content": "<p>I think something like that should work: <a href=\"https://stackoverflow.com/questions/10965417/how-to-convert-a-numpy-array-to-pil-image-applying-matplotlib-colormap\">https://stackoverflow.com/questions/10965417/how-to-convert-a-numpy-array-to-pil-image-applying-matplotlib-colormap</a></p>",
      "rawMarkdown": "I think something like that should work: https://stackoverflow.com/questions/10965417/how-to-convert-a-numpy-array-to-pil-image-applying-matplotlib-colormap",
      "votes": null
    },
    {
      "id": "930445",
      "postDate": "07/15/2020 13:17:52",
      "content": "<p>GREAT!\nThank You.\nThis is what I was looking for.</p>",
      "rawMarkdown": "GREAT!\nThank You.\nThis is what I was looking for.",
      "votes": null
    },
    {
      "id": "932143",
      "postDate": "07/16/2020 18:33:59",
      "content": "<p>If you want to use them in neural network, you don't even need to convert them to color, you just need to use \nx = Conv2D(3,(3,3),padding='same')(input_tensor) </p>",
      "rawMarkdown": "If you want to use them in neural network, you don't even need to convert them to color, you just need to use \nx = Conv2D(3,(3,3),padding='same')(input_tensor)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 930431,
      "author_name": "ahmedhshahin",
      "author_url": "",
      "post_date": "07/15/2020 13:04:08",
      "content": "<p>I think something like that should work: <a href=\"https://stackoverflow.com/questions/10965417/how-to-convert-a-numpy-array-to-pil-image-applying-matplotlib-colormap\">https://stackoverflow.com/questions/10965417/how-to-convert-a-numpy-array-to-pil-image-applying-matplotlib-colormap</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 930445,
      "author_name": "fkarchdd",
      "author_url": "",
      "post_date": "07/15/2020 13:17:52",
      "content": "<p>GREAT!\nThank You.\nThis is what I was looking for.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 932143,
      "author_name": "eladwar",
      "author_url": "",
      "post_date": "07/16/2020 18:33:59",
      "content": "<p>If you want to use them in neural network, you don't even need to convert them to color, you just need to use \nx = Conv2D(3,(3,3),padding='same')(input_tensor) </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "930412": "Hi to everyone,\n\nhow can I **change** images from gray to colormaps?\nI mean changing, not plotting. \nPlotting images with the cmap is easy.\nBut how can I apply this new color in the image.\nSo that I get a colorimage back instead of only havin a plot?\n\nbest regards\nFred",
    "930431": "I think something like that should work: https://stackoverflow.com/questions/10965417/how-to-convert-a-numpy-array-to-pil-image-applying-matplotlib-colormap",
    "930445": "GREAT!\nThank You.\nThis is what I was looking for.",
    "932143": "If you want to use them in neural network, you don't even need to convert them to color, you just need to use \nx = Conv2D(3,(3,3),padding='same')(input_tensor)"
  },
  "source": "meta"
}