<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Joan Bernier</title>
    <description>The latest articles on DEV Community by Joan Bernier (@joanbernier).</description>
    <link>https://dev.to/joanbernier</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4251986%2F17fd6815-adc0-4349-a103-9a30f7157bda.jpg</url>
      <title>DEV Community: Joan Bernier</title>
      <link>https://dev.to/joanbernier</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joanbernier"/>
    <language>en</language>
    <item>
      <title>A Checklist to Invert Image Screenshots for Dark-Mode Docs</title>
      <dc:creator>Joan Bernier</dc:creator>
      <pubDate>Wed, 18 Nov 2026 15:41:37 +0000</pubDate>
      <link>https://dev.to/joanbernier/a-checklist-to-invert-image-screenshots-for-dark-mode-docs-3ooo</link>
      <guid>https://dev.to/joanbernier/a-checklist-to-invert-image-screenshots-for-dark-mode-docs-3ooo</guid>
      <description>&lt;p&gt;When a docs site gets a dark theme, the screenshots are the part nobody wants to touch. Light-theme images on a dark page glow like a flashlight, and the quick fix is to invert image files so the page and the pictures agree. If you have ever had to invert image files by hand for a whole docs folder, this is the checklist I would write down first.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flztn2o6nzxe1ik27c0a1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flztn2o6nzxe1ik27c0a1.jpg" alt="Laptop on a desk at night showing a dark-themed editor beside a warm lamp" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It assumes your screenshots are mostly flat UI: white panels, grey text, a few accent colors. Photos are a different story and I cover that near the end. The same steps work whether you invert image files one at a time or in a batch.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Decide which screenshots should flip at all.&lt;/strong&gt;&lt;br&gt;
Not every image needs it, so do not invert image files just because they are in the folder. A terminal capture is already dark. A screenshot of a chart with meaningful colors should keep them. Make a list before you touch a single file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Keep the originals in their own folder.&lt;/strong&gt;&lt;br&gt;
Inversion is easy to undo, but re-encoding is not free. If you save a JPEG over a JPEG you lose a little each round. Keep the untouched files and write the results next to them with a suffix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Pick the output format on purpose.&lt;/strong&gt;&lt;br&gt;
For flat UI, PNG is the safe default because it is lossless and keeps transparency. JPEG puts transparent areas over white, which looks wrong on a dark page. WebP can keep transparency too if your site serves it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Invert image pixels without uploading them.&lt;/strong&gt;&lt;br&gt;
Some of our screenshots show internal dashboards, so I did not want them going to a random server. I use an in-browser tool where local files are processed on the device. When I need to invert image files like that, &lt;a href="https://invertimage.app/" rel="noopener noreferrer"&gt;invert image&lt;/a&gt; works for me because the page states that nothing from a local file is uploaded and that it needs no account or watermark.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Use the strength slider for harsh whites.&lt;/strong&gt;&lt;br&gt;
A full flip turns a white panel into pure black, which can feel heavy. Pulling the strength below 100% gives you a softer dark grey and leaves a bit of the original color in. Compare both sides with the before/after handle before you commit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Check the accent colors.&lt;/strong&gt;&lt;br&gt;
Full inversion swaps every color for its opposite. A blue button becomes amber, a green success badge turns magenta. If the colors carry meaning, either keep that screenshot as is or accept that the dark version will look different and add a note in the docs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Check the output size.&lt;/strong&gt;&lt;br&gt;
The result keeps the original width and height, which is what you want. File size can change because the image is encoded again, so look at your biggest screenshots and confirm nothing grew unexpectedly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Name files so the theme switch is trivial.&lt;/strong&gt;&lt;br&gt;
Something like &lt;code&gt;settings-light.png&lt;/code&gt; and &lt;code&gt;settings-dark.png&lt;/code&gt; lets a simple &lt;code&gt;&amp;lt;picture&amp;gt;&lt;/code&gt; element pick the right one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;picture&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;srcset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"settings-dark.png"&lt;/span&gt; &lt;span class="na"&gt;media&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"(prefers-color-scheme: dark)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"settings-light.png"&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Settings page"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/picture&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When a plain flip is the wrong tool
&lt;/h2&gt;

&lt;p&gt;Inversion changes colors and keeps shapes. That is great for UI with flat fills. It is bad for screenshots that contain a photo, a map, or an avatar, because skin and sky go strange and nobody will believe it is a real picture.&lt;/p&gt;

&lt;p&gt;For those, I keep the original and crop the photo region out of the dark variant, or I leave the whole screenshot light with a thin border. If you have a lot of images in the same state, a batch option helps: the site's &lt;a href="https://invertimage.app/" rel="noopener noreferrer"&gt;batch color inverter&lt;/a&gt; takes up to 30 images per batch at 20 MB each and lets you export a ZIP, so you can run a folder in a couple of rounds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you merge
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open the page in dark mode and scroll slowly. Look for images that feel brighter than the text around them.&lt;/li&gt;
&lt;li&gt;Zoom to 200% on one dark screenshot, the one you were least sure about when you decided to invert image output for it, and check thin lines and small text. If they look soft, re-export as PNG.&lt;/li&gt;
&lt;li&gt;Open the page on a phone. If a screenshot was a tall image, it still needs to be readable at that width.&lt;/li&gt;
&lt;li&gt;Open one flipped file in an image viewer outside the browser to confirm the dimensions match the original.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the whole routine for anyone who has to invert image sets for a docs theme. The part that saves the most time is step 1: deciding what not to flip.&lt;/p&gt;

&lt;p&gt;If you have a different way of handling light screenshots in a dark docs theme, I would like to hear it in the comments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>documentation</category>
      <category>design</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Pixel Art for a Game Jam: My 16x16 Coin Sprite Sheet Workflow</title>
      <dc:creator>Joan Bernier</dc:creator>
      <pubDate>Wed, 18 Nov 2026 13:30:48 +0000</pubDate>
      <link>https://dev.to/joanbernier/pixel-art-for-a-game-jam-my-16x16-coin-sprite-sheet-workflow-4g6h</link>
      <guid>https://dev.to/joanbernier/pixel-art-for-a-game-jam-my-16x16-coin-sprite-sheet-workflow-4g6h</guid>
      <description>&lt;p&gt;At my last game jam I lost almost two hours on one spinning coin. The code was fine. The art wasn't. This time I wrote the process down while doing it: a 16×16 pixel art coin, four frames, exported as a sprite sheet and loaded into Phaser with crisp edges. Every step below fits into one evening.&lt;/p&gt;

&lt;p&gt;What you'll end up with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one 16×16 coin with 4 animation frames&lt;/li&gt;
&lt;li&gt;a transparent PNG sprite sheet&lt;/li&gt;
&lt;li&gt;a few lines of Phaser 3 that play it without blur&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F12hmesbtn4dej90r5mf9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F12hmesbtn4dej90r5mf9.jpg" alt="A small robot hopping between floating grassy platforms on a purple alien planet, collecting spinning gold coins in a retro pixel art game scene" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You don't need drawing skills for pixel art this small. You need a grid, a short palette, and patience for 256 cells per frame.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 0: Pick a grid size you can finish
&lt;/h2&gt;

&lt;p&gt;I drew this &lt;a href="https://pixoffline.com/pixel-art-editor/" rel="noopener noreferrer"&gt;Pixel Art&lt;/a&gt; coin in a browser-based editor because I didn't want to install anything on the jam laptop. It runs in the browser, nothing gets uploaded, and the work auto-saves to IndexedDB on that machine.&lt;/p&gt;

&lt;p&gt;A new canvas starts at 32×32. I switched it to 16×16 under canvas size.&lt;/p&gt;

&lt;p&gt;Why 16? A coin is a pickup. In my game it sits on screen at 4× zoom, so 16 cells is plenty, and in pixel art a small grid is the difference between finishing and fiddling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Lock the palette before you draw
&lt;/h2&gt;

&lt;p&gt;The default palette is PICO-8, which happens to be great for retro pixel art. I picked four colours from it and refused to touch anything else:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;brown for the outline&lt;/li&gt;
&lt;li&gt;orange for the body&lt;/li&gt;
&lt;li&gt;yellow for the face&lt;/li&gt;
&lt;li&gt;white for one highlight&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My rule now: if I think I need a fifth colour, I usually need a better shape instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Draw frame 1 with ellipse + mirror
&lt;/h2&gt;

&lt;p&gt;I used two layers. Layer 1 is a rough sketch, layer 2 is the clean version on top. You can stack up to 16, but two is all a coin needs.&lt;/p&gt;

&lt;p&gt;On the sketch layer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Drag the ellipse tool to make a circle about 12 cells wide and 14 tall, centred.&lt;/li&gt;
&lt;li&gt;Turn on mirror so whatever I fix on the left side shows up on the right.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On a 16×16 grid the ellipse comes out a bit lumpy. That's normal in pixel art: curves are really stairs. On the clean layer I traced it with the pencil and evened out the steps, so each curve goes 3-2-1 cells instead of 3-1-2.&lt;/p&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fill the inside with orange using the fill tool.&lt;/li&gt;
&lt;li&gt;Pencil a smaller yellow oval inside it, two cells in from the outline.&lt;/li&gt;
&lt;li&gt;Add a 2-cell white highlight near the top left.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Leave the corners alone. Cells you never paint stay transparent in a PNG export, which is exactly what a sprite wants.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: The "spin" is mostly width
&lt;/h2&gt;

&lt;p&gt;A spinning coin in pixel art is a fake 3D effect. You only squash the width and keep the height. Here's what I used:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Frame&lt;/th&gt;
&lt;th&gt;Coin width (cells)&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;full face, highlight visible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;face narrower, highlight shifts right&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;just the edge, outline + one orange column&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;same as frame 2, flipped&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fykgt0svtt9z07sn6cf9j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fykgt0svtt9z07sn6cf9j.png" alt="Four-frame 16x16 coin sprite sheet, the coin narrowing from full face to a thin edge and back" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add frames on the timeline (it allows up to 200, you need 4). Duplicate-and-edit is faster than redrawing, but I redrew frame 3 because the edge view barely resembles the others.&lt;/p&gt;

&lt;p&gt;Turn on onion skin here. It shows the neighbouring frames faintly while you draw, which makes the next step much easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Kill the wobble
&lt;/h2&gt;

&lt;p&gt;My first loop wobbled. The coin looked like it was hopping by one pixel.&lt;/p&gt;

&lt;p&gt;The cause: frame 2's top row sat one cell lower than frame 1's. With onion skin on, you can see it immediately.&lt;/p&gt;

&lt;p&gt;The fix is boring but it works. Keep the top row and the bottom row at the same y on all four frames. Only the left and right edges move.&lt;/p&gt;

&lt;p&gt;For a quick check I exported the timeline as a GIF and dropped it into the jam Discord. Two teammates said it looked fine at 8 fps, so I moved on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Export the sheet (and one big PNG)
&lt;/h2&gt;

&lt;p&gt;I exported two files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A sprite sheet&lt;/strong&gt; for the engine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A PNG at 8×&lt;/strong&gt; for the itch.io page, so the pixel art shows up as sharp blocks in screenshots instead of a tiny smudge.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PNG scale only changes the display size. The pixel art itself stays 16×16 even when you download it bigger.&lt;/p&gt;

&lt;p&gt;Before writing any code, open the sheet and check its pixel dimensions. Note the size of one frame and how the frames are laid out. You'll need that number in the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Load it in Phaser without blur
&lt;/h2&gt;

&lt;p&gt;Here's the minimal scene I used with Phaser 3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Phaser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;AUTO&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;320&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;180&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;zoom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;pixelArt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// nearest-neighbour scaling, no smoothing&lt;/span&gt;
  &lt;span class="n"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;preload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;preload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// frameWidth/frameHeight = size of ONE frame in your exported sheet&lt;/span&gt;
  &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;load&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;spritesheet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'coin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'assets/coin-sheet.png'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;frameWidth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;frameHeight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;anims&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'spin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;frames&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;anims&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateFrameNumbers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'coin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;frameRate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;repeat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sprite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;160&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'coin'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;play&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'spin'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Phaser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Game&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;pixelArt: true&lt;/code&gt; is the line that matters. Without it, the browser smooths the upscaled sprite and your hard edges turn soft.&lt;/p&gt;

&lt;p&gt;If your sheet came out at a bigger scale than 1×, set &lt;code&gt;frameWidth&lt;/code&gt; and &lt;code&gt;frameHeight&lt;/code&gt; to the real frame size you measured, not 16.&lt;/p&gt;

&lt;p&gt;Not using Phaser? Same idea elsewhere:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;plain canvas: &lt;code&gt;ctx.imageSmoothingEnabled = false;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;CSS on an &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt;: &lt;code&gt;image-rendering: pixelated;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My pre-commit checklist for pixel art sprites
&lt;/h2&gt;

&lt;p&gt;I keep this in the repo README now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] all frames share the same top and bottom row&lt;/li&gt;
&lt;li&gt;[ ] background cells are unpainted (transparent), not white&lt;/li&gt;
&lt;li&gt;[ ] 4 colours or fewer for small pickups&lt;/li&gt;
&lt;li&gt;[ ] sheet dimensions checked and frame size written in the loader&lt;/li&gt;
&lt;li&gt;[ ] source file exported and committed, not just living in the browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last one matters. Browser auto-save is local to that browser. If someone clears site data on the jam laptop, the drawing goes with it. I commit the PNG and GIF next to the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd change next time
&lt;/h2&gt;

&lt;p&gt;Three frames might read just as well at this size. Frame 4 is almost a copy of frame 2, so dropping it would save a few minutes per pickup when I have ten of them.&lt;/p&gt;

&lt;p&gt;Next up is a 6-frame pixel art walk cycle using the same setup. If you try the coin, tell me in the comments which frame rate looked right in your game. 8 fps worked for mine, but I'm not sure it's universal.&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>pixelart</category>
      <category>tutorial</category>
      <category>phaser</category>
    </item>
  </channel>
</rss>
