sprite sheet maker
Keep a Preview Sprite Alive After the Loading Function Returns
A fresh preview can show a sprite correctly while the function that created it is still running. If the only reference to the image goes out of scope after that function returns, the visible sprite may vanish even though the canvas element has not been deleted.
Test ownership over the whole preview lifecycle
Create the image inside a loader function and return control to the editor. After a garbage-collection pass, verify that the canvas element’s configured image still exists and renders one recognizable color. Repeat with a preview controller that holds the active image. The second version should keep the art after the loader’s local variables disappear.
Release ownership when the preview closes
Switch between clips with distinctive first poses and make sure the old clip cannot reappear. On close, release unneeded images and confirm the preview does not grow its retained image collection after repeated sessions. Keeping everything forever can mask the original disappearing-image bug while creating another problem.
FrameSprite’s technical guide and test fixture uses CPython and native Tk to distinguish a living Canvas item from an image removed from Tk’s registry. Turn that distinction into checks for both visibility and cleanup.
Prepared by the FrameSprite Workflow Team with AI assistance. Illustrative examples are labeled in the text.