Title: Drawing low-alpha graphics over an opaque background alters the resulting alpha in a PGraphics with P2D/P3D · Issue #2807 · processing/processing · GitHub
Open Graph Title: Drawing low-alpha graphics over an opaque background alters the resulting alpha in a PGraphics with P2D/P3D · Issue #2807 · processing/processing
X Title: Drawing low-alpha graphics over an opaque background alters the resulting alpha in a PGraphics with P2D/P3D · Issue #2807 · processing/processing
Description: A PGraphics object and the way it handles alpha is behaving differently in the default renderer versus the P2D/P3D renderers. Example code and screencaps below. In the example code, a PGraphics object is created, filled with opaque red, ...
Open Graph Description: A PGraphics object and the way it handles alpha is behaving differently in the default renderer versus the P2D/P3D renderers. Example code and screencaps below. In the example code, a PGraphics obj...
X Description: A PGraphics object and the way it handles alpha is behaving differently in the default renderer versus the P2D/P3D renderers. Example code and screencaps below. In the example code, a PGraphics obj...
Opengraph URL: https://github.com/processing/processing/issues/2807
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Drawing low-alpha graphics over an opaque background alters the resulting alpha in a PGraphics with P2D/P3D","articleBody":"A PGraphics object and the way it handles alpha is behaving differently in the default renderer versus the P2D/P3D renderers. Example code and screencaps below.\n\nIn the example code, a PGraphics object is created, filled with opaque red, then low-alpha black lines are drawn over this. One should expect the result to be a completely opaque image (because of the initial red fill), with gray lines over a red background. When this PGraphics object is shown on the screen with image(), one can see that the alpha of the PGraphics image has actually been altered by drawing these lines over the top of the red. In the default renderer, the PGraphics image is completely opaque as expected.\n\nSo I believe the problem is that (in P2D/P3d) drawing low-alpha graphics in a PGraphics object is altering the alpha channel when it should be blending.\n\n``` java\nPGraphics pg;\n\nvoid setup() {\n size(200,200,P2D);\n pg = createGraphics(100,100,P2D);\n\n //drawing an opaque red background, then random low-alpha black lines over the top.\n pg.beginDraw();\n pg.fill(0xFFFF0000);\n pg.noStroke();\n pg.rect(0,0,100,100);\n pg.stroke(0x10000000);\n pg.strokeWeight(2);\n pg.noFill();\n for(int i = 0; i \u003c 1000; i++) {\n pg.line(random(100),random(100),random(100),random(100));\n }\n pg.endDraw();\n\n background(0xFF0088FF);\n image(pg, 50, 50);\n}\n```\n\nHere is the screencap for the above sketch - note how the blue background is showing through:\n\n\n\nHere is the screencap for the sketch when the default renderer is used by omitting the P2D variable in both size() and createGraphics() - note the lines are now low-alpha black as expected:\n\n\n","author":{"url":"https://github.com/RectangleWorld","@type":"Person","name":"RectangleWorld"},"datePublished":"2014-08-20T04:25:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2807/processing/issues/2807"}
| 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:79fe6d2c-bb63-43b0-fa47-9d2357621c69 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E808:C8498:1411E7A:1C09235:6970CDC9 |
| html-safe-nonce | c85c40119dfdb000b6464f399f07d8d7ad2e52c94d88300885bd3fd19c3e2091 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODA4OkM4NDk4OjE0MTFFN0E6MUMwOTIzNTo2OTcwQ0RDOSIsInZpc2l0b3JfaWQiOiIzODI0NjI5MzI0NzE5Mzc3ODY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4bfd7920da7c9c8580d339b319cf5702822f7dcdee639c74fb096a69aa9d7358 |
| hovercard-subject-tag | issue:40662351 |
| 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/processing/processing/2807/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a236eb7a7ea1c771a0fa5fa43f4aa055ed897e8c735ce93545d85c7e4cc8458f/processing/processing/issues/2807 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a236eb7a7ea1c771a0fa5fa43f4aa055ed897e8c735ce93545d85c7e4cc8458f/processing/processing/issues/2807 |
| og:image:alt | A PGraphics object and the way it handles alpha is behaving differently in the default renderer versus the P2D/P3D renderers. Example code and screencaps below. In the example code, a PGraphics obj... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RectangleWorld |
| hostname | github.com |
| expected-hostname | github.com |
| None | 721764876e433c894814212f8100f6610f1dde78a987acc2e385d8be8e170e9c |
| turbo-cache-control | no-preview |
| go-import | github.com/processing/processing git https://github.com/processing/processing.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 7807399 |
| octolytics-dimension-repository_nwo | processing/processing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7807399 |
| octolytics-dimension-repository_network_root_nwo | processing/processing |
| 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 | 6ff3d08f4ee1c3f89ebedf4df8fc8fe851190294 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width