Add a way to discard EditableImage buffer after it’s no longer being edited

It’s currently too difficult to manage memory efficiently when using EditableImage for things that only need to be drawn once and then displayed.

Right now, if I write to an EditableImage using WritePixelsBuffer(), that full uncompressed buffer (~1MB for a 512x512 image) stays in memory even if I’m just showing the result in a UI and never editing it again. If there’s multiple of these displaying (like in a drawing game, or a shared canvas system), that adds up really fast (20 images = 20MB+ of memory just sitting there doing nothing).

This is especially frustrating because there’s no way to tell Roblox, “I’m done editing this. You can throw away the pixel buffer now.” It forces me to either live with the memory cost or build a workaround using external image storage or rebuilding the image manually into something like a Decal, which defeats the point of using EditableImage in the first place.

This would make it way easier to use EditableImage in scalable systems where visuals are generated once and then displayed repeatedly, without having to constantly worry about memory usage ballooning for no reason.

Use cases:

  • Drawing games where players create one-time canvases
  • Multiplayer whiteboards or shared sketchpads
  • UIs that generate and show custom icons or previews using pixel data
  • Any system where images are created dynamically but only viewed afterward

(Optional solution)

Something like EditableImage:Compress() or EditableImage:DiscardPixelBuffer() would solve it. Just a one-time call that tells Roblox to drop the editable backing data once writing is done. I don’t even need to edit it again, just want it to act like a static texture after.

7 Likes