Title: [Bug]: I give an RGB image to imsave but I don't have the right color map! · Issue #29183 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: I give an RGB image to imsave but I don't have the right color map! · Issue #29183 · matplotlib/matplotlib
X Title: [Bug]: I give an RGB image to imsave but I don't have the right color map! · Issue #29183 · matplotlib/matplotlib
Description: Bug summary When I give an RGB image as a list of list of list to imsave, I don't have the right colormap and there is no rgb colormap! Code for reproduction import matplotlib.pyplot as plt I = plt.imread("notre-dame.jpg") m,n,p = I.shap...
Open Graph Description: Bug summary When I give an RGB image as a list of list of list to imsave, I don't have the right colormap and there is no rgb colormap! Code for reproduction import matplotlib.pyplot as plt I = plt...
X Description: Bug summary When I give an RGB image as a list of list of list to imsave, I don't have the right colormap and there is no rgb colormap! Code for reproduction import matplotlib.pyplot as plt I =...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29183
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: I give an RGB image to imsave but I don't have the right color map!","articleBody":"### Bug summary\r\n\r\nWhen I give an RGB image as a list of list of list to imsave, I don't have the right colormap and there is no rgb colormap!\r\n\r\n### Code for reproduction\r\n\r\n```Python\r\nimport matplotlib.pyplot as plt\r\nI = plt.imread(\"notre-dame.jpg\")\r\nm,n,p = I.shape #m=largeur, n=hauteur, p=uplet\r\nJ=[[[0 for d in range(p)] for e in range(n)] for f in range(m)]\r\nK=[[[0 for d in range(p)] for e in range(n)] for f in range(m)]\r\nL=[[[0 for d in range(p)] for e in range(n)] for f in range(m)]\r\nfor i in range(m) :\r\n for j in range(n) :\r\n J[i][j]=[int(I[i][j][0]),0,0]\r\n K[i][j]=[0,int(I[i][j][1]),0]\r\n L[i][j]=[0,0,int(I[i][j][2])]\r\nfig, ax=plt.subplots(4,figsize=(28,10))\r\nax[0].imshow(I)\r\nax[1].imshow(J)\r\nax[2].imshow(K)\r\nax[3].imshow(L)\r\nax[0].set_axis_off()\r\nax[1].set_axis_off()\r\nax[2].set_axis_off()\r\nax[3].set_axis_off()\r\nax[0].set_title('Image complete')\r\nax[1].set_title('Composante rouge')\r\nax[2].set_title('Composante bleue')\r\nax[3].set_title('Composante verte')\r\nfig.suptitle(\"Image de Notre-Dame\", x=0.51,y=.93)\r\nplt.imsave(\"Notre-Dame_rouge.png\",J) #The problem is here!\r\nplt.savefig(\"Notre-Dame_composante_ex1.png\",dpi=750,bbox_inches=\"tight\")\r\nplt.savefig(\"Notre-Dame_composante_ex1.pdf\",dpi=750,bbox_inches=\"tight\")\r\nplt.show()\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n\r\n\r\n\r\n### Expected outcome\r\n\r\n\r\nThe red one in a png image!\r\n\r\n### Additional information\r\n\r\n\r\nThe original image\r\n\r\n### Operating system\r\n\r\nWin 11\r\n\r\n### Matplotlib Version\r\n\r\n3.9.2\r\n\r\n### Matplotlib Backend\r\n\r\nmodule://matplotlib_inline.backend_inline\r\n\r\n### Python version\r\n\r\n3.11.10\r\n\r\n### Jupyter version\r\n\r\n_No response_\r\n\r\n### Installation\r\n\r\nconda","author":{"url":"https://github.com/zef126","@type":"Person","name":"zef126"},"datePublished":"2024-11-24T23:04:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":28},"url":"https://github.com/29183/matplotlib/issues/29183"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:03aac21e-48dd-af58-5278-65c779755a72 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95CE:163E89:B1156E:F02536:6A5208B6 |
| html-safe-nonce | 77cf42afbe0f9e16269b61411ef2f646faa612f93e66b8e28c5d8843452d9e67 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUNFOjE2M0U4OTpCMTE1NkU6RjAyNTM2OjZBNTIwOEI2IiwidmlzaXRvcl9pZCI6IjQ5OTYwOTcxMTIzMDU0MzY4NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8c945905a288867fda985ba609fb541b292592dfd411e8ddb66f69f49580f931 |
| hovercard-subject-tag | issue:2688574957 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/29183/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e980e5196a19bd0516e331f40df1c3f805be7eb59a65d10c34b166ef7376de96/matplotlib/matplotlib/issues/29183 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e980e5196a19bd0516e331f40df1c3f805be7eb59a65d10c34b166ef7376de96/matplotlib/matplotlib/issues/29183 |
| og:image:alt | Bug summary When I give an RGB image as a list of list of list to imsave, I don't have the right colormap and there is no rgb colormap! Code for reproduction import matplotlib.pyplot as plt I = plt... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zef126 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width