Title: Issues with `imshow` and RGBA values · Issue #3343 · matplotlib/matplotlib · GitHub
Open Graph Title: Issues with `imshow` and RGBA values · Issue #3343 · matplotlib/matplotlib
X Title: Issues with `imshow` and RGBA values · Issue #3343 · matplotlib/matplotlib
Description: Raised at https://stackoverflow.com/questions/25089068/how-does-imshow-handle-the-alpha-channel-with-an-m-x-n-x-4-input by @mwaskom import numpy as np import matplotlib.pyplot as plt d = np.ones((100, 100, 4), dtype=np.uint8)*255 d[:, :,...
Open Graph Description: Raised at https://stackoverflow.com/questions/25089068/how-does-imshow-handle-the-alpha-channel-with-an-m-x-n-x-4-input by @mwaskom import numpy as np import matplotlib.pyplot as plt d = np.ones((1...
X Description: Raised at https://stackoverflow.com/questions/25089068/how-does-imshow-handle-the-alpha-channel-with-an-m-x-n-x-4-input by @mwaskom import numpy as np import matplotlib.pyplot as plt d = np.ones((1...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/3343
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Issues with `imshow` and RGBA values","articleBody":"Raised at https://stackoverflow.com/questions/25089068/how-does-imshow-handle-the-alpha-channel-with-an-m-x-n-x-4-input by @mwaskom\n\n```\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nd = np.ones((100, 100, 4), dtype=np.uint8)*255\nd[:, :, 3] = np.linspace(0, 255, num=100)\nplt.imshow(d, interpolation='none')\nplt.show()\n```\n\nOne might expect the image to be completely white (as semi-transparent white over white should still be white), but is instead gray in the middle due to pre-multiplying of the alpha (1, 1, 1, .5) -\u003e (.5, .5, .5) which is then composited with the background as an opaque layer, hence the gray.\n\nPreviously (related) discussion:\n- https://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg22377.html\n- PR #545\n","author":{"url":"https://github.com/tacaswell","@type":"Person","name":"tacaswell"},"datePublished":"2014-08-04T23:16:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/3343/matplotlib/issues/3343"}
| 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:0e1e93e7-ef6a-ba16-b35d-936444e29cd9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF36:2F0FE8:AC6FE6:E389BB:6A531D22 |
| html-safe-nonce | 77ad4a0e8b57aacd5013be81575421488a08c3e0a2433867d55030e38bd0c125 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjM2OjJGMEZFODpBQzZGRTY6RTM4OUJCOjZBNTMxRDIyIiwidmlzaXRvcl9pZCI6IjE5OTc3Mzc5OTE1MTExNTM5NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7d7ee4447362c0b1585ed39a9e1bb596f6eeb804ac8776cf544b64b98468f4e1 |
| hovercard-subject-tag | issue:39470770 |
| 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/3343/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4d7fd59c4311bf46c10ae19e3b5d27d10818be20d8188365cfc3cba4b5bf5fe7/matplotlib/matplotlib/issues/3343 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4d7fd59c4311bf46c10ae19e3b5d27d10818be20d8188365cfc3cba4b5bf5fe7/matplotlib/matplotlib/issues/3343 |
| og:image:alt | Raised at https://stackoverflow.com/questions/25089068/how-does-imshow-handle-the-alpha-channel-with-an-m-x-n-x-4-input by @mwaskom import numpy as np import matplotlib.pyplot as plt d = np.ones((1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tacaswell |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width