Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <canvas id=c width=512 height=256 style=width:100%;image-rendering:-moz-crisp-edges;image-rendering:pixelated>
Right click on the image to save.

Sprites are aligned to a 16x16 pixel grid with a transparent background.

Reload for a new sheet, or set the seed to whatever you want! ✌️😄




                // Tiny Sprite Sheet Generator - Frank Force 2020 - MIT License

'use strict'
let seed, x, R, i, j, pass, s, X, Y;

seed =;    // seed for random generaton, can be replaced with hardcoded value
x = c.getContext`2d`; // 2d canvas context
x.lineWidth = 2;      // set 2 pixel wide line width to make the black outline
R = ()=> (Math.sin(++s + i*i) + 1)*1e9 % 256 | 0; // get a seeded random integer between 0-256

for(i = 32 * 16; i--;)                          // for each sprite (32 rows x 16 columns)
for(pass = 4; pass--;)                          // 4 passes, outline left/right and fill left/right
for(s = seed, j = R()/5 + 50|0; j--;)           // set seed, randomize max sprite pixels, 50-101
  X = j&7, Y = j>>3,                            // X & Y pixel index in sprite
  R() < 19 ?                                    // small chance of new color
    x.fillStyle = `rgb(${R()},${R()},${R()})` : // randomize color
    R()**2 / 2e3 > X*X + (Y-5)**2 &&            // distance from center vs random number
      x[pass&2 ? 'strokeRect' : 'fillRect'](    // stroke first for outline then fill with color
          7 + i%32*16 - pass%2*2*X + X,         // x pos, flipped if pass is even
          2 + (i>>5)*16 + Y,                    // y pos
          1, 1);                                // 1 pixel size