From a full-size image to a usable Arcade sprite
Make a photo or drawing small enough to become game art. This image converter for MakeCode Arcade resizes the whole image and maps it to the default palette. The preview, PNG and TypeScript all use the same indexed pixels, so you can inspect the result before pasting it into a project.
Choose a size before judging the colors
A 16-pixel sprite favors a bold silhouette: a fruit, icon or small prop. A 32-pixel sprite gives a character more room. At 64 pixels you can retain larger features, but a photo still loses fine texture. The chosen value is the longest edge; the other edge follows the original aspect ratio, with no crop or stretched pixels.
The preview is deliberately enlarged with crisp edges. Judge whether the subject is recognizable when it is small. If the eyes or outline disappear, try a tighter source crop before increasing the output size.
Understand 15 colors and transparent index 0
MakeCode Arcade stores image pixels as palette indices. Index 0 is transparent; the default palette has 15 visible color entries. This converter maps opaque pixels to those visible entries, including opaque black at index f. It uses a transparent dot only where the source alpha is below 128.
A white photograph background remains visible white. If you need a cut-out character, prepare a transparent PNG first. Changing your project palette later changes how the same indices appear, so a custom-palette project should be checked against the default palette or converted with a matching palette tool.
Move the exported image into your project
Copy img code for an image expression you can place inside your own sprite call. Download TypeScript for a small example that creates mySprite as SpriteKind.Player. Paste into MakeCode Arcade’s JavaScript editor, keeping only one declaration with that variable name.
Open the sprite image editor or simulator and check the width, height, transparency and colors. A background image has a different role from a player sprite; use the image expression with the appropriate API for your project. The downloadable PNG is useful for reviewing the same indexed result outside the editor.
Fix an unrecognizable sprite
Reduce background clutter, crop to the subject and favor a clear outline. Flat lighting and distinct large color regions usually survive palette reduction better than small highlights or patterned clothing. Dark colors can merge; try a brighter source with more separation around the subject.
This workflow targets the default MakeCode Arcade palette and img syntax. For monochrome Arduino or ESP displays, use Image to C Array instead. For an existing pixel-art image that needs larger square pixels, use an editor with nearest-neighbor scaling. These are different output formats and should be chosen by the receiving project.
Questions about MakeCode images
Does it work with MakeCode Arcade?
The exported expression uses Arcade img syntax and its default 15 visible colors plus transparent index 0. Paste it into an Arcade JavaScript project and check it in the simulator.
Can I use JPG, PNG or WebP?
Yes, up to 10 MiB and 24 megapixels. Use PNG for source transparency. Each export contains one static image.
Can it make a sprite sheet?
Each export represents one image. For sheets with multiple frames, use the official Arcade asset-import workflow linked below.
Why are the colors different?
The source is reduced to the default Arcade palette. A project with a custom palette can display different colors for those indices.
How is transparency handled?
Pixels with alpha below 128 become index 0. Other pixels become opaque palette colors. JPG has no transparent pixels.
Will it crop my photo?
The whole image is fitted to the selected longest edge. The aspect ratio is retained, with rounding to whole pixels. Crop the source first when you want a tighter subject.
What is inside the TypeScript file?
An img expression assigned to picture and a sprites.create call that makes mySprite. Rename variables when your project already uses those names.
Does this use AI credits?
No. Resize, palette mapping, code generation and PNG export run locally in your browser.