Skip to content

Fix p5.Image copy method to mark image as modified#8846

Closed
Chessing234 wants to merge 2 commits into
processing:mainfrom
Chessing234:fix/image-copy-modified-2
Closed

Fix p5.Image copy method to mark image as modified#8846
Chessing234 wants to merge 2 commits into
processing:mainfrom
Chessing234:fix/image-copy-modified-2

Conversation

@Chessing234
Copy link
Copy Markdown

Bug: Copying pixels into a p5.Image using the copy() method does not mark the image as modified. This causes issues when using the image as a WEBGL texture immediately after, as the new pixels are not uploaded to the GPU.
Root Cause: The copy() method in p5.Image delegates to p5.prototype.copy but fails to call this.setModified(true) on itself afterward.
Why fix is correct: Adding this.setModified(true) explicitly marks the image as modified so downstream consumers (like WEBGL textures) know to update their data from the image.

@Chessing234 Chessing234 closed this by deleting the head repository May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant