Title: PImage.mask() broken · Issue #1065 · processing/processing4 · GitHub
Open Graph Title: PImage.mask() broken · Issue #1065 · processing/processing4
X Title: PImage.mask() broken · Issue #1065 · processing/processing4
Description: Most appropriate sub-area of Processing 4? Image, Core/Environment/Rendering Processing version 4.4.3 Operating system macOS Steps to reproduce this Run the following snippet. Using mask() to mask an image leads to mask() can only be use...
Open Graph Description: Most appropriate sub-area of Processing 4? Image, Core/Environment/Rendering Processing version 4.4.3 Operating system macOS Steps to reproduce this Run the following snippet. Using mask() to mask ...
X Description: Most appropriate sub-area of Processing 4? Image, Core/Environment/Rendering Processing version 4.4.3 Operating system macOS Steps to reproduce this Run the following snippet. Using mask() to mask ...
Opengraph URL: https://github.com/processing/processing4/issues/1065
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PImage.mask() broken","articleBody":"### Most appropriate sub-area of Processing 4?\n\nImage, Core/Environment/Rendering\n\n### Processing version\n\n4.4.3\n\n### Operating system\n\nmacOS\n\n### Steps to reproduce this\n\nRun the following snippet.\n\nUsing `mask()` to mask an image leads to `mask() can only be used with an image that's the same size.` though both images are created with same size. Worked until 4.4.2.\n\n### snippet\n\n```processing\nPImage img;\n\nvoid setup() {\n size(150, 150);\n setupHexagon(50);\n hexagon(75, 75, 50);\n}\n\nvoid draw() {\n}\n\nprivate void setupHexagon(int radius) {\n noiseSeed(1004);\n img = createImage(radius*2, radius*2, RGB);\n for (int px = 0; px \u003c img.width; px++) {\n for (int py = 0; py \u003c img.height; py++) {\n float n = noise(px/(float)img.width, py/(float)img.height);\n img.pixels[px+py*img.width] = color(n*255);\n }\n }\n img.updatePixels();\n\n PShape s = createShape();\n s.beginShape();\n s.fill(255);\n for (int i=0; i\u003c6; i++)\n s.vertex(cos(PI/3*i) * radius, sin(PI/3*i) * radius);\n s.endShape(CLOSE);\n PGraphics maskImage;\n maskImage = createGraphics(img.width, img.height);\n maskImage.beginDraw();\n maskImage.shape(s, img.width/2., img.height/2.);\n maskImage.endDraw();\n img.mask(maskImage);\n}\n\nprivate void hexagon(float x, float y, float radius) {\n imageMode(CENTER);\n image(img, x, y, 2*radius, 2*radius);\n}\n```\n\n\n### Additional context\n\nSnippet draws a hexagon with noisy pattern.\n\n### Would you like to work on the issue?\n\nassign to someone else, please","author":{"url":"https://github.com/hkiel","@type":"Person","name":"hkiel"},"datePublished":"2025-04-28T14:25:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/1065/processing4/issues/1065"}
| 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:378a4675-c051-3d9b-d462-7670cf0b3833 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8058:2BFBB8:14B0A26:1C7CC7D:696AA511 |
| html-safe-nonce | 45ebc4d3ef70694623bde4c8f771bb039f27255111099299da2e064f57671963 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDU4OjJCRkJCODoxNEIwQTI2OjFDN0NDN0Q6Njk2QUE1MTEiLCJ2aXNpdG9yX2lkIjoiNjUxNDQ2NzQyNDA4NDYwMDA4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9c605718808f20fc67305e2f314c3e22771a66aafab7c22b6ea625cd5454a7a8 |
| hovercard-subject-tag | issue:3025125915 |
| 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/processing4/1065/issue_layout |
| twitter:image | https://opengraph.githubassets.com/126414f7a2031878f8c807a2226d6c899ed4b6d2ee1b21db2724cdac3d2f08c1/processing/processing4/issues/1065 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/126414f7a2031878f8c807a2226d6c899ed4b6d2ee1b21db2724cdac3d2f08c1/processing/processing4/issues/1065 |
| og:image:alt | Most appropriate sub-area of Processing 4? Image, Core/Environment/Rendering Processing version 4.4.3 Operating system macOS Steps to reproduce this Run the following snippet. Using mask() to mask ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hkiel |
| hostname | github.com |
| expected-hostname | github.com |
| None | a51f97dbb9326f71c08ecb61577457d543c602124d1a2672871258ef37ac5261 |
| turbo-cache-control | no-preview |
| go-import | github.com/processing/processing4 git https://github.com/processing/processing4.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 844382769 |
| octolytics-dimension-repository_nwo | processing/processing4 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 844382769 |
| octolytics-dimension-repository_network_root_nwo | processing/processing4 |
| 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 | 4bd0eac606c70914085176ef312ebdcd97a8cdf1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width