Canvas Sprite Mask Keeps the Mask Color? Check destination-in
Use the same colored sprite and white circular mask to see which layer each Canvas compositing operator retains.


Your circular mask leaves a white disc where the colored sprite should be. Check which layer the compositor keeps. In Canvas, the source is the draw you are issuing and the destination is what was already on the canvas.
Keep draw order fixed
Start with two empty 64 by 64 canvases. Draw the same fully opaque colored square on each. Make a matching mask bitmap with a white circle and fully transparent pixels outside. In A, set destination-in and draw the entire mask. In B, keep the same order but use source-in.
Sample the center and corners
A should retain the original sprite color at the center. B should show the incoming white mask color. The corners should be transparent in both. Their result alpha is the product of the two alpha values, which matters for partial edge pixels. Sample away from the antialiasing region first.
Restore source-over after masking, or use save and restore around the operation. If the mask cuts out the scene background too, isolate the sprite on its own transparent canvas before combining it with the scene. Prepare a sample sprite in the sprite cutter and verify the compositing sequence in your own export pipeline.
Recommended tools

Automatic Sprite Slicing and ZIP Export: A Faster Way to Prepare 2D Game Assets
Learn how automatic sprite slicing and one-click ZIP export can help indie game developers turn character sheets, icon collections, and AI-generated 2D artwork into organized PNG assets faster.

From AI Sprite Cutter to Sprite Sheet Maker: A Complete 2D Asset Workflow
A practical workflow guide for turning raw 2D images into sliced PNG files, downloading them as a ZIP package, and using those files to create sprite sheets for Unity, Cocos, Godot, and custom game engines.

AI Sprite Cutter: How Indie Game Developers Can Split 2D Game Assets Faster
A practical guide for indie game developers, 2D artists, and prototype teams. Learn how an AI sprite cutter can split character sheets, UI icons, white-background assets, and AI-generated artwork into clean PNG files for Unity, Cocos, Godot, and sprite sheet workflows.
Ready to try "Canvas Sprite Mask Keeps the Mask Color? Check destination-in"?
Use our online tools to apply this tutorial to your indie game project right away.
