<?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: Lam</title>
    <description>The latest articles on DEV Community by Lam (@hoanganhlam).</description>
    <link>https://dev.to/hoanganhlam</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%2F486887%2Fe66c748e-0a45-4a55-8c51-268e7e6ac269.jpeg</url>
      <title>DEV Community: Lam</title>
      <link>https://dev.to/hoanganhlam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hoanganhlam"/>
    <language>en</language>
    <item>
      <title>From pixel art tiles to a Godot 4 level: three workflows compared</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Mon, 23 Nov 2026 15:08:56 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/from-pixel-art-tiles-to-a-godot-4-level-three-workflows-compared-230c</link>
      <guid>https://dev.to/hoanganhlam/from-pixel-art-tiles-to-a-godot-4-level-three-workflows-compared-230c</guid>
      <description>&lt;p&gt;Drawing a tileset is the fun part. The part that eats an evening is turning it into a Godot 4 TileSet where the terrain brush actually works: every tile needs its terrain peering bits set, and a full blob set has 47 tiles with up to eight bits each.&lt;/p&gt;

&lt;p&gt;Here are three common ways to get from tiles to a playable Godot 4 level, and what each one leaves for you to do by hand. Disclosure: the third workflow uses &lt;a href="https://simplepixelart.com" rel="noopener noreferrer"&gt;SimplePixelArt&lt;/a&gt;, which I build. The first two are tools I'd recommend for plenty of other jobs.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick refresher: Wang 16 vs blob 47
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wang 16 (corner)&lt;/strong&gt;: each tile is defined by its four corners. 16 tiles cover every combination. Fast to draw, but inner corners and thin paths look a bit square. In Godot this is a terrain set in &lt;strong&gt;Match Corners&lt;/strong&gt; mode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blob 47&lt;/strong&gt;: each tile looks at all eight neighbours, so diagonals and thin strips are handled. 47 tiles to draw, much smoother results. In Godot this is &lt;strong&gt;Match Corners and Sides&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(I wrote a longer explainer on &lt;a href="https://comficker.hashnode.dev/wang-16-vs-blob-47-how-auto-tile-sets-actually-work-and-which-one-to-draw" rel="noopener noreferrer"&gt;how the two systems work&lt;/a&gt; if you want the details.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Workflow 1: Aseprite or Pixelorama → PNG → Godot TileSet editor
&lt;/h2&gt;

&lt;p&gt;The most common route.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Draw the tiles in Aseprite or Pixelorama on a grid.&lt;/li&gt;
&lt;li&gt;Export one PNG atlas.&lt;/li&gt;
&lt;li&gt;In Godot, create a TileSet, add the atlas, and let it create tiles.&lt;/li&gt;
&lt;li&gt;Add a terrain set, choose the mode, add a terrain.&lt;/li&gt;
&lt;li&gt;Paint the peering bits on every tile in the TileSet editor.&lt;/li&gt;
&lt;li&gt;Add collision polygons to the solid tiles.&lt;/li&gt;
&lt;li&gt;Paint the level with TileMapLayer nodes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;What's good:&lt;/strong&gt; you use the best drawing tools available, and you learn exactly how Godot's terrain system works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you do by hand:&lt;/strong&gt; steps 5 and 6. For Wang 16 that's quick; for blob 47 it's slow and easy to get wrong. One misplaced bit and the brush picks the wrong tile somewhere in the level, which you discover later. If you redraw the atlas layout, you do it again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Workflow 2: draw anywhere → Tiled → Godot
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Draw the tiles in any editor.&lt;/li&gt;
&lt;li&gt;Build a tileset in &lt;a href="https://www.mapeditor.org/" rel="noopener noreferrer"&gt;Tiled&lt;/a&gt;, set up a Wang set, and paint the map there.&lt;/li&gt;
&lt;li&gt;Bring the map into Godot with a community importer plugin.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;What's good:&lt;/strong&gt; Tiled is an excellent, mature map editor with object layers, custom properties and its own terrain tools. If your team already uses Tiled, this keeps everyone in one tool, and the same map works in other engines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you do by hand:&lt;/strong&gt; the Wang set is still set up manually in Tiled. You also depend on an importer plugin that has to keep up with Godot releases, and you have one more tool in the pipeline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Workflow 3: SimplePixelArt → &lt;code&gt;.tres&lt;/code&gt; and &lt;code&gt;.tscn&lt;/code&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Draw tiles in the &lt;a href="https://simplepixelart.com/editor" rel="noopener noreferrer"&gt;pixel art editor&lt;/a&gt;, or cut an existing sheet into tiles with the slicer.&lt;/li&gt;
&lt;li&gt;In the &lt;a href="https://simplepixelart.com/tilesets/editor" rel="noopener noreferrer"&gt;tileset editor&lt;/a&gt;, group tiles and generate a Wang 16 or blob 47 terrain.&lt;/li&gt;
&lt;li&gt;"Export for Godot 4": a &lt;code&gt;.tres&lt;/code&gt; TileSet with the packed atlas, terrain sets in the matching mode, collision on solid tiles (physics layer 1) and animated tiles.&lt;/li&gt;
&lt;li&gt;Optionally paint the level in the tilemap editor and export a zip with a ready &lt;code&gt;.tscn&lt;/code&gt;: ground layers become TileMapLayers, sprites become Sprite2D or AnimatedSprite2D nodes, object layers become Marker2D points.&lt;/li&gt;
&lt;li&gt;Copy the files into a Godot 4.3+ project and open the scene.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;What's good:&lt;/strong&gt; no peering bits to paint and no plugin. The terrain brush works the moment you open the TileSet, and it runs in the browser, free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you give up:&lt;/strong&gt; the drawing tools are simpler than Aseprite's or Pixelorama's, canvases top out at 128×128, and the export targets Godot 4.3+ only, not Godot 3. You can mix workflows, though: draw in Aseprite, export a PNG, and slice it into the tileset editor just for the terrain and export step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Side by side
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Aseprite / Pixelorama → Godot&lt;/th&gt;
&lt;th&gt;Tiled → Godot&lt;/th&gt;
&lt;th&gt;SimplePixelArt → Godot&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Drawing tools&lt;/td&gt;
&lt;td&gt;Best&lt;/td&gt;
&lt;td&gt;Bring your own&lt;/td&gt;
&lt;td&gt;Basic to solid&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Terrain setup&lt;/td&gt;
&lt;td&gt;By hand in Godot&lt;/td&gt;
&lt;td&gt;By hand in Tiled&lt;/td&gt;
&lt;td&gt;Generated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Collision&lt;/td&gt;
&lt;td&gt;By hand in Godot&lt;/td&gt;
&lt;td&gt;Set in Tiled, depends on importer&lt;/td&gt;
&lt;td&gt;Solid tiles, physics layer 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Level editing&lt;/td&gt;
&lt;td&gt;Godot TileMapLayer&lt;/td&gt;
&lt;td&gt;Tiled&lt;/td&gt;
&lt;td&gt;Built-in tilemap editor or Godot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extra plugin&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Aseprite paid, Pixelorama free&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Settings that matter whichever route you take
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Project Settings → Rendering → Textures → Default Texture Filter: Nearest&lt;/strong&gt;, or your pixels will blur.&lt;/li&gt;
&lt;li&gt;Keep camera zoom and window stretch at whole numbers (2×, 3×, 4×) so pixels stay square.&lt;/li&gt;
&lt;li&gt;Use Godot 4.3 or newer if you want TileMapLayer nodes instead of the older TileMap.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which one?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You already have a polished atlas and only need Wang 16 → &lt;strong&gt;workflow 1&lt;/strong&gt; is fine; the manual step is small.&lt;/li&gt;
&lt;li&gt;Your team lives in Tiled or targets several engines → &lt;strong&gt;workflow 2&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You want blob 47 terrains without painting 47 tiles' worth of bits, or a whole scene you can open straight away → &lt;strong&gt;workflow 3&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full step-by-step for the third route is on the &lt;a href="https://simplepixelart.com/pixel-art-for-godot" rel="noopener noreferrer"&gt;Pixel art for Godot 4&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;How do you handle terrains in your project: painted by hand, Tiled, or a script? I'd like to hear what breaks for people.&lt;/p&gt;

</description>
      <category>godot</category>
      <category>gamedev</category>
      <category>pixelart</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Aseprite, Piskel, Pixelorama or a browser editor? Picking a pixel art tool for a small game</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Mon, 23 Nov 2026 15:08:50 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/aseprite-piskel-pixelorama-or-a-browser-editor-picking-a-pixel-art-tool-for-a-small-game-2h4</link>
      <guid>https://dev.to/hoanganhlam/aseprite-piskel-pixelorama-or-a-browser-editor-picking-a-pixel-art-tool-for-a-small-game-2h4</guid>
      <description>&lt;p&gt;"Which pixel art editor should I use?" comes up every week in game dev communities, and the answers are usually a single name. The better answer depends on what you are making and where you are working.&lt;/p&gt;

&lt;p&gt;A disclosure first: I build &lt;a href="https://simplepixelart.com" rel="noopener noreferrer"&gt;SimplePixelArt&lt;/a&gt;, a free browser editor, and it is one of the four tools below. I've kept the other three in on their own terms and said where they are ahead. Details about the other tools come from their own documentation as of November 2026; check their sites for the latest releases.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Aseprite&lt;/th&gt;
&lt;th&gt;Piskel&lt;/th&gt;
&lt;th&gt;Pixelorama&lt;/th&gt;
&lt;th&gt;SimplePixelArt&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Price&lt;/td&gt;
&lt;td&gt;Paid license (about $20); source available to compile&lt;/td&gt;
&lt;td&gt;Free, open source (Apache 2.0)&lt;/td&gt;
&lt;td&gt;Free, open source (MIT)&lt;/td&gt;
&lt;td&gt;Free with ads, no paid tier on the web&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Runs on&lt;/td&gt;
&lt;td&gt;Windows, macOS, Linux&lt;/td&gt;
&lt;td&gt;Browser, plus a desktop app&lt;/td&gt;
&lt;td&gt;Windows, macOS, Linux, web&lt;/td&gt;
&lt;td&gt;Any modern browser, Android app&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Layers&lt;/td&gt;
&lt;td&gt;Groups, blend modes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Groups, blend modes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Animation&lt;/td&gt;
&lt;td&gt;Full timeline, tags, linked cels&lt;/td&gt;
&lt;td&gt;Frames, onion skin, live preview&lt;/td&gt;
&lt;td&gt;Timeline, tags, onion skin&lt;/td&gt;
&lt;td&gt;Frames, onion skin, tags, per-frame timing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tiles&lt;/td&gt;
&lt;td&gt;Tilemap layers with tilesets&lt;/td&gt;
&lt;td&gt;Not built in&lt;/td&gt;
&lt;td&gt;Tile mode for seamless patterns&lt;/td&gt;
&lt;td&gt;Tileset editor with Wang 16 / blob 47 autotile&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Engine export&lt;/td&gt;
&lt;td&gt;Sprite sheet + JSON; many engines read &lt;code&gt;.aseprite&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;PNG sprite sheet, GIF&lt;/td&gt;
&lt;td&gt;PNG, sprite sheets, GIF&lt;/td&gt;
&lt;td&gt;Godot 4 &lt;code&gt;.tres&lt;/code&gt; / &lt;code&gt;.tscn&lt;/code&gt;, Tiled &lt;code&gt;.tsx&lt;/code&gt; / &lt;code&gt;.tmj&lt;/code&gt;, sheet + JSON&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scripting&lt;/td&gt;
&lt;td&gt;Lua + command line&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Extensions&lt;/td&gt;
&lt;td&gt;No (has an MCP server for AI assistants)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Aseprite: the standard for a reason
&lt;/h2&gt;

&lt;p&gt;If you animate a lot, Aseprite is hard to beat. The timeline, linked cels and tag tools are deeper than anything else here, Lua scripting and a command-line interface let you batch-export from a build script, and the &lt;code&gt;.aseprite&lt;/code&gt; format is read by plugins for most engines.&lt;/p&gt;

&lt;p&gt;It costs money (or the effort of compiling it yourself), it has to be installed, and it is a drawing tool first: tilemap layers exist, but setting up autotile terrains for your engine is still on you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if:&lt;/strong&gt; animation is the core of your work, you want scripting in your pipeline, or you need large canvases and full offline work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Piskel: quick sprites and GIFs, no install
&lt;/h2&gt;

&lt;p&gt;Piskel has been the go-to free browser editor for years. The interface is minimal, the live animation preview is pleasant, and it exports GIFs and PNG sprite sheets without fuss. It is open source, so you can self-host or modify it, and there is a desktop build for offline use.&lt;/p&gt;

&lt;p&gt;It stops at sprites: there is no tileset or map tooling and no engine-specific export.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if:&lt;/strong&gt; you want quick animated GIFs or small sprites, like a simple interface, or need an open-source tool you can host yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pixelorama: open source with a full drawing toolset
&lt;/h2&gt;

&lt;p&gt;Pixelorama is built with the Godot engine, runs on desktop and in the browser, and is MIT-licensed. It has layer groups, blend modes, a timeline with tags and onion skin, and a tile mode for drawing seamless patterns. It is actively developed and extensible.&lt;/p&gt;

&lt;p&gt;Despite being made in Godot, it exports images (PNG, sprite sheets, GIF) rather than Godot resources, and there is no separate tilemap editor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if:&lt;/strong&gt; you want a free, open-source desktop app with a richer toolset than Piskel, or you want to contribute to the tool you use.&lt;/p&gt;

&lt;h2&gt;
  
  
  SimplePixelArt: the game-asset pipeline in a browser tab
&lt;/h2&gt;

&lt;p&gt;This is the one I make, so weigh this section accordingly. The focus is small game assets and getting them into an engine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;a href="https://simplepixelart.com/editor" rel="noopener noreferrer"&gt;pixel art editor&lt;/a&gt; with layers, frames, onion skin, frame tags and per-frame timing, exporting PNG, GIF, SVG, sprite sheets, or a sheet with JSON in the Aseprite format;&lt;/li&gt;
&lt;li&gt;a &lt;a href="https://simplepixelart.com/tilesets/editor" rel="noopener noreferrer"&gt;tileset editor&lt;/a&gt; that generates Wang 16 and blob 47 autotile terrains and exports a Godot 4 TileSet (&lt;code&gt;.tres&lt;/code&gt;) with terrains, collision and animated tiles already set up, or a Tiled tileset;&lt;/li&gt;
&lt;li&gt;a tilemap editor that exports a ready &lt;code&gt;.tscn&lt;/code&gt; scene or a Tiled map;&lt;/li&gt;
&lt;li&gt;a built-in &lt;a href="https://simplepixelart.com/converter" rel="noopener noreferrer"&gt;image to pixel art converter&lt;/a&gt;, and a public gallery where every piece opens in the editor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It runs in any browser, which matters on school or work machines where you can't install software. The limits are real: canvases go up to 128×128, there is no scripting, it can't open &lt;code&gt;.aseprite&lt;/code&gt; files, and it is a website rather than a guaranteed-offline desktop app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if:&lt;/strong&gt; you are making a 2D game and want tilesets that arrive in Godot 4 or Tiled ready to paint with, or you want to start now on any computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to choose in one minute
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mostly animation, big sprites, scripted exports&lt;/strong&gt; → Aseprite.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quick GIFs, minimal UI, open source&lt;/strong&gt; → Piskel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free desktop app with a full toolset, open source&lt;/strong&gt; → Pixelorama.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tilesets and levels for Godot or Tiled, nothing to install&lt;/strong&gt; → SimplePixelArt.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Mixing is normal. Plenty of people animate characters in Aseprite and build tilesets somewhere else; PNG and sprite sheets move between all four tools. SimplePixelArt can import a sprite strip as animation frames, so a sheet exported from any of the others loads straight in.&lt;/p&gt;

&lt;p&gt;If you want the longer, feature-by-feature versions, there are separate pages for &lt;a href="https://simplepixelart.com/compare/aseprite" rel="noopener noreferrer"&gt;SimplePixelArt vs Aseprite&lt;/a&gt;, &lt;a href="https://simplepixelart.com/compare/piskel" rel="noopener noreferrer"&gt;vs Piskel&lt;/a&gt; and &lt;a href="https://simplepixelart.com/compare/pixelorama" rel="noopener noreferrer"&gt;vs Pixelorama&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What do you use, and what would make you switch? I'm especially curious about tileset workflows, since that's where tools differ most.&lt;/p&gt;

</description>
      <category>pixelart</category>
      <category>gamedev</category>
      <category>godot</category>
      <category>tools</category>
    </item>
    <item>
      <title>Building a color-by-number Chrome extension with Manifest V3 (offline, no backend of its own)</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Mon, 09 Nov 2026 04:18:03 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/building-a-color-by-number-chrome-extension-with-manifest-v3-offline-no-backend-of-its-own-4fc4</link>
      <guid>https://dev.to/hoanganhlam/building-a-color-by-number-chrome-extension-with-manifest-v3-offline-no-backend-of-its-own-4fc4</guid>
      <description>&lt;p&gt;I wanted a small, calm coloring game that opens with one click and works on a train with no signal. The result is &lt;a href="https://chromewebstore.google.com/detail/hellpcacohmobfpileciocbpbojljpec" rel="noopener noreferrer"&gt;Pixel Art Color by Number&lt;/a&gt;, a Manifest V3 extension that colors the free pictures from &lt;a href="https://simplepixelart.com/color-by-number" rel="noopener noreferrer"&gt;SimplePixelArt.com&lt;/a&gt;. It's about 1,200 lines of TypeScript with no framework. A few parts were more interesting than I expected, so here they are.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. A tab, not a popup
&lt;/h2&gt;

&lt;p&gt;A popup is too small for a canvas you zoom and drag on. The service worker just opens the game page in a tab, both on toolbar click and on first install, so people see what they added:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onClicked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addListener&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tabs&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="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;src/app/index.html&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onInstalled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addListener&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;reason&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reason&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;install&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tabs&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="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;src/app/index.html&lt;/span&gt;&lt;span class="dl"&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="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Build setup is Vite + &lt;code&gt;@crxjs/vite-plugin&lt;/code&gt;: the manifest points at &lt;code&gt;.ts&lt;/code&gt; files and the plugin rewrites them. Permissions are just &lt;code&gt;storage&lt;/code&gt; plus a host permission for the read-only picture API. No &lt;code&gt;tabs&lt;/code&gt;, no content scripts, so the install prompt is short.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Offline with &lt;code&gt;chrome.storage.local&lt;/code&gt;, network first
&lt;/h2&gt;

&lt;p&gt;The pictures come from a public API. Every JSON response goes through one helper: try the network, save the good answer, fall back to the last saved copy when the fetch fails.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;cachedJson&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;cacheKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;keep&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;keep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;cacheKey&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;got&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;chrome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cacheKey&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;got&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;cacheKey&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;got&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;cacheKey&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;e&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;The &lt;code&gt;keep&lt;/code&gt; argument trims each picture to the fields the game needs (size, palette, number map) before it's stored, so the cache stays small. The first page of the gallery is cached the same way, which means the gallery and every picture you started still open offline.&lt;/p&gt;

&lt;p&gt;Progress is saved per picture as a list of &lt;code&gt;"x_y"&lt;/code&gt; keys, debounced by 300 ms so a fast drag doesn't write on every square.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Wrong squares stay empty
&lt;/h2&gt;

&lt;p&gt;The rule that makes it relaxing: you can't make a mistake. Each picture is a &lt;code&gt;map_numbers&lt;/code&gt; object (&lt;code&gt;"x_y" → color index&lt;/code&gt;). On open I flatten it into typed arrays once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;grid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Int16Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;// color per square, -1 = empty&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;filled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 0 = empty, else paint style + 1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Filling is then a filter: a square takes paint only if it carries the selected number and isn't painted yet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;squares&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;selected&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;filled&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;
  &lt;span class="nx"&gt;filled&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
  &lt;span class="c1"&gt;// paint it, count it&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since wrong squares are ignored, the brush can be big and sloppy (1, 3 or 5 squares wide), the bucket can flood a connected area and the "wand" can fill every square of one number. None of them can ruin the picture.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. No gaps on fast drags
&lt;/h2&gt;

&lt;p&gt;Pointer events don't arrive for every square you pass when you move fast. Two fixes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pointermove&lt;/code&gt; events are coalesced to one step per animation frame (&lt;code&gt;requestAnimationFrame&lt;/code&gt;), so drawing never falls behind the cursor.&lt;/li&gt;
&lt;li&gt;Each step walks a Bresenham line from the previous square to the current one and fills everything on it, so a quick swipe leaves no holes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only the touched rectangle is redrawn, not the whole canvas, which keeps a 48×48 picture smooth even at high zoom.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Brush strokes that stay inside the lines
&lt;/h2&gt;

&lt;p&gt;Flat fill is pixel-exact, but I also wanted watercolor, pencil, crayon and marker styles where you see the stroke. The trick is a &lt;code&gt;Path2D&lt;/code&gt; per color made of all that color's squares, used as a clip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;segment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;lctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="nx"&gt;lctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;clipFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="c1"&gt;// only this number's squares&lt;/span&gt;
  &lt;span class="nf"&gt;strokeSegment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;lctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;restore&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;The stroke follows your pointer but can never bleed into a neighbour with a different number. The paths are built once per color and cached. Strokes are saved too (capped at about 200 KB per picture, oldest first), so a picture looks the same when you come back.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Small things that mattered
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Find the last squares.&lt;/strong&gt; The last 3 squares of a 2,000-square picture are hard to spot, so a search button jumps to them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Export.&lt;/strong&gt; A finished picture downloads as a crisp PNG, or as a share image signed with your name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask for a rating late.&lt;/strong&gt; The review prompt shows only once, after the third finished picture, when people have actually enjoyed it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Chrome extension: &lt;a href="https://chromewebstore.google.com/detail/hellpcacohmobfpileciocbpbojljpec" rel="noopener noreferrer"&gt;Pixel Art Color by Number&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Same game in the browser, no install: &lt;a href="https://simplepixelart.com/color-by-number" rel="noopener noreferrer"&gt;simplepixelart.com/color-by-number&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No ads, no account. If you build extensions, I'd like to hear how you handle offline caching in MV3. &lt;code&gt;chrome.storage.local&lt;/code&gt; has been simpler than the Cache API for JSON-sized data.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I wrote this post with help from an AI assistant; the code and the decisions are mine.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>chromeextension</category>
      <category>javascript</category>
      <category>canvas</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>How to make pixel art: a beginner's workflow that actually works</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Tue, 03 Nov 2026 03:59:49 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/how-to-make-pixel-art-a-beginners-workflow-that-actually-works-11af</link>
      <guid>https://dev.to/hoanganhlam/how-to-make-pixel-art-a-beginners-workflow-that-actually-works-11af</guid>
      <description>&lt;p&gt;Most people who try pixel art for the first time open a 256x256 canvas, pick 40 colors and give up an hour later. The trick is the opposite: start smaller than feels reasonable and use fewer colors than feels possible.&lt;/p&gt;

&lt;p&gt;Below is the workflow I use for small game sprites, shown on an 18x18 cat I drew. It works the same for characters, items and icons.&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%2Fzbb2bn21oy75echk1bxh.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%2Fzbb2bn21oy75echk1bxh.png" alt="Four steps: silhouette, outline, flat colors, details" width="799" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Pick a tiny canvas
&lt;/h2&gt;

&lt;p&gt;Small canvases are easier, not harder. Every pixel is a clear decision and you finish before you lose motivation.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Good for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;8x8&lt;/td&gt;
&lt;td&gt;icons, tiny items, coins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16x16&lt;/td&gt;
&lt;td&gt;classic game characters, tiles&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24x24 – 32x32&lt;/td&gt;
&lt;td&gt;characters with more detail, portraits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64x64&lt;/td&gt;
&lt;td&gt;big sprites, small scenes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you're unsure, take 16x16. The cat above is 18x18 because its tail needed two more columns.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Limit your palette
&lt;/h2&gt;

&lt;p&gt;Pick 4 to 8 colors before you draw a single pixel. A limited palette forces the image to read clearly and keeps colors consistent across sprites.&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%2Fj5ee499hj6vkdubo4w3t.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%2Fj5ee499hj6vkdubo4w3t.png" alt="The six colors used for the cat" width="520" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The cat uses six: a near-black outline, the orange body, a cream belly, and three tiny accents (peach, pink, white) that only cover eleven pixels together. If you don't want to build a palette yourself, borrow one: PICO-8 (16 colors), Endesga 32 and Sweetie 16 are popular starting points.&lt;/p&gt;

&lt;p&gt;A tip that took me too long to learn: don't use pure black for outlines on colorful sprites. A very dark neutral (here &lt;code&gt;#171717&lt;/code&gt;) looks cleaner, and on soft styles a dark version of the body color looks even better.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Block in the silhouette
&lt;/h2&gt;

&lt;p&gt;Fill the whole shape with one color. No outline, no details. You're only checking one thing: &lt;strong&gt;is it recognizable as a single flat shape?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the silhouette doesn't read, no amount of shading will fix it later. Squint at it, or zoom out to 1x. For the cat, the two ear bumps and the tail are what make it read as a cat, so I made sure they stick out clearly.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Add the outline
&lt;/h2&gt;

&lt;p&gt;Draw the outline on top of the silhouette. Two rules keep it clean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Avoid "doubles"&lt;/strong&gt;: in a diagonal line, each step should touch the next only at a corner. An L-shaped clump of three pixels makes the line look thick and jagged.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep steps even&lt;/strong&gt;: a curve made of steps like 3-2-1-1 looks smooth; 3-1-2-1 looks wobbly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inner lines (the eyes, the mouth) come in this step too. On a small sprite a single pixel is a face feature, so place them carefully. Here the eyes are two short dashes and the nose is one pixel.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Flat colors
&lt;/h2&gt;

&lt;p&gt;Now fill each area with its base color: body orange, belly cream. Still no shading. This is where you check that the colors work together and that areas are big enough to read.&lt;/p&gt;

&lt;p&gt;Small areas (1–2 pixels wide) often become noise. If a stripe or a patch doesn't read at 1x, remove it or make it bigger.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Details and shading
&lt;/h2&gt;

&lt;p&gt;Last, add the small things that make it feel alive: pink inside the ears, a hint of paws, a highlight. On a sprite this small, &lt;strong&gt;fewer details are better&lt;/strong&gt;. The cat has no real shading at all, just color areas, and it still reads well as a game icon.&lt;/p&gt;

&lt;p&gt;When you do shade bigger sprites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pick one light source (top-left is the classic choice) and stick to it.&lt;/li&gt;
&lt;li&gt;Use 2–3 tones per color: base, shadow, highlight.&lt;/li&gt;
&lt;li&gt;Shift the hue a little, not just the brightness: shadows slightly cooler or more saturated, highlights slightly warmer. It looks far less muddy than plain darker/lighter versions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  7. Export without blur
&lt;/h2&gt;

&lt;p&gt;Pixel art is drawn at 1x and scaled up with &lt;strong&gt;nearest-neighbor&lt;/strong&gt; scaling, in whole numbers (2x, 3x, 4x…). Any smoothing turns crisp pixels into mush:&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%2Flu2sdxatv1cdf698hedb.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%2Flu2sdxatv1cdf698hedb.png" alt="Same sprite scaled with smoothing vs nearest neighbor" width="450" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save as &lt;strong&gt;PNG&lt;/strong&gt;, never JPG, which adds color noise.&lt;/li&gt;
&lt;li&gt;Scale by whole numbers only. 2.5x makes some pixels wider than others.&lt;/li&gt;
&lt;li&gt;In game engines, turn off texture filtering (in Godot: Default Texture Filter = Nearest; in Unity: Filter Mode = Point).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tools
&lt;/h2&gt;

&lt;p&gt;You don't need anything expensive. Aseprite is the standard paid tool, and LibreSprite is a free fork of an older version. Piskel and Lospec's editor run in the browser. I draw in SimplePixelArt, a free browser &lt;a href="https://simplepixelart.com/editor" rel="noopener noreferrer"&gt;pixel art editor&lt;/a&gt; I build, which has palettes, a grid and nearest-neighbor export built in. Any of these will do. The workflow matters more than the tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practice ideas
&lt;/h2&gt;

&lt;p&gt;The fastest way to improve is many small finished sprites, not one big unfinished one. A few to try, each in 16x16 with at most 8 colors:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A potion bottle (simple shape, good for practicing highlights)&lt;/li&gt;
&lt;li&gt;A slime (silhouette practice)&lt;/li&gt;
&lt;li&gt;A sword (diagonal lines without doubles)&lt;/li&gt;
&lt;li&gt;A cat or a frog (readable face in a few pixels)&lt;/li&gt;
&lt;li&gt;A heart, coin and key set (consistent palette across items)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want references, browse what others drew at the same size on the &lt;a href="https://simplepixelart.com/" rel="noopener noreferrer"&gt;pixel art&lt;/a&gt; gallery at SimplePixelArt and look at how they place single pixels for eyes and highlights.&lt;/p&gt;

&lt;p&gt;Happy pixeling!&lt;/p&gt;

</description>
      <category>pixelart</category>
      <category>gamedev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Pixel art 9-slice UI panels in Godot 4 (without blurry or fat borders)</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Mon, 02 Nov 2026 07:29:26 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/pixel-art-9-slice-ui-panels-in-godot-4-without-blurry-or-fat-borders-ma</link>
      <guid>https://dev.to/hoanganhlam/pixel-art-9-slice-ui-panels-in-godot-4-without-blurry-or-fat-borders-ma</guid>
      <description>&lt;p&gt;Every game UI needs boxes: dialogue windows, inventory slots, buttons, tooltips. Drawing a new box for every size is a waste of time, and scaling one box up ruins it. The fix is &lt;strong&gt;9-slice&lt;/strong&gt; (Godot calls it nine-patch): draw one small panel, tell the engine where the borders are, and let it stretch only the parts that can stretch.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with plain scaling
&lt;/h2&gt;

&lt;p&gt;Take a 24x24 panel with a 6 px border and scale it to a wide dialogue box. The border scales with it, so it gets fat on one axis and thin on the other, and the bevel looks wrong.&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%2Fuxqxhr3kgkc5ltwcv5xh.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%2Fuxqxhr3kgkc5ltwcv5xh.png" alt="Plain scale vs 9-slice" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How 9-slice works
&lt;/h2&gt;

&lt;p&gt;Two vertical and two horizontal cut lines split the source into nine pieces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;4 corners&lt;/strong&gt;: never stretched.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4 edges&lt;/strong&gt;: stretched along one axis only (top and bottom horizontally, left and right vertically).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1 center&lt;/strong&gt;: stretched both ways (or tiled).&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%2Fokm1ivhp8d86vvnq7rem.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%2Fokm1ivhp8d86vvnq7rem.png" alt="9-slice cut lines and result" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The cut lines are just four numbers, the margins from each side. For the panel above they are all 6.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drawing a panel that slices well
&lt;/h2&gt;

&lt;p&gt;A few rules that save a round trip back to the editor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep the border the same width all round&lt;/strong&gt; unless you really want different margins. Equal margins mean one number in Godot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the edges uniform.&lt;/strong&gt; Anything in the edge strip gets stretched, so a rivet or a notch in the middle of the top edge will smear. Put details in the corners.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the center flat&lt;/strong&gt; (or a pattern that tiles cleanly). A gradient in the center will stretch into a blur.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Draw at the size it will be used, not bigger.&lt;/strong&gt; For a 320x180 game, a 24x24 or 32x32 panel is plenty.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I draw mine in a free browser &lt;a href="https://simplepixelart.com/editor" rel="noopener noreferrer"&gt;pixel art editor&lt;/a&gt; and export a PNG; any editor works as long as it saves without anti-aliasing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making it crisp in Godot 4
&lt;/h2&gt;

&lt;p&gt;Before slicing, make sure Godot isn't filtering your pixels:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Project Settings → Rendering → Textures → Canvas Textures → Default Texture Filter = Nearest.&lt;/strong&gt; Without this every UI texture is blurred.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Display → Window → Stretch → Mode = canvas_items&lt;/strong&gt; (or &lt;code&gt;viewport&lt;/code&gt;) with your base resolution, and &lt;strong&gt;Scale Mode = integer&lt;/strong&gt; so the whole UI scales by whole numbers.&lt;/li&gt;
&lt;li&gt;If text or panels jitter when moving, enable &lt;strong&gt;Rendering → 2D → Snap 2D Transforms to Pixel&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Option 1: NinePatchRect
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;NinePatchRect&lt;/code&gt; is a Control node that draws a texture as nine pieces. It's the quickest way to get a resizable box.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add a &lt;code&gt;NinePatchRect&lt;/code&gt; to your UI scene and set &lt;strong&gt;Texture&lt;/strong&gt; to your panel PNG.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Patch Margin&lt;/strong&gt;, set Left, Top, Right and Bottom to 6 (your border width).&lt;/li&gt;
&lt;li&gt;Resize the node. Corners stay put, edges and center stretch.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;panel&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;NinePatchRect&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;texture&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;preload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"res://ui/panel-24.png"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;patch_margin_left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;patch_margin_top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;patch_margin_right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;patch_margin_bottom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Vector2&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;48&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Axis Stretch&lt;/strong&gt; controls how edges and center fill: &lt;code&gt;Stretch&lt;/code&gt; (default), &lt;code&gt;Tile&lt;/code&gt;, or &lt;code&gt;Tile Fit&lt;/code&gt;. Use &lt;code&gt;Tile&lt;/code&gt; when your edge has a repeating pattern (a rope, a chain, stitched leather); &lt;code&gt;Tile Fit&lt;/code&gt; adjusts the tile slightly so it ends cleanly.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NinePatchRect&lt;/code&gt; doesn't hold children nicely by itself; put it behind a &lt;code&gt;MarginContainer&lt;/code&gt; (margins equal to the patch margins) when you need content inside.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option 2: StyleBoxTexture (for buttons and themes)
&lt;/h2&gt;

&lt;p&gt;For anything built from Godot's Control nodes (Button, PanelContainer, LineEdit, Tooltip), use a &lt;strong&gt;StyleBoxTexture&lt;/strong&gt; instead. It plugs into the theme, so every button and panel picks it up.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new &lt;code&gt;StyleBoxTexture&lt;/code&gt; resource and set &lt;strong&gt;Texture&lt;/strong&gt; to the panel PNG.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;Texture Margins&lt;/strong&gt; (left, top, right, bottom) to 6. These are the 9-slice cuts.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;Content Margins&lt;/strong&gt; to how much padding you want between the border and the content (often the same 6, sometimes a bit more).&lt;/li&gt;
&lt;li&gt;In a &lt;code&gt;Theme&lt;/code&gt;, assign it to &lt;code&gt;PanelContainer/styles/panel&lt;/code&gt;, &lt;code&gt;Button/styles/normal&lt;/code&gt;, and so on. Make a second texture (pressed, darker) for &lt;code&gt;Button/styles/pressed&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sb&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;StyleBoxTexture&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;texture&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;preload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"res://ui/panel-24.png"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;texture_margin_left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;texture_margin_top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;texture_margin_right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;texture_margin_bottom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content_margin_left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content_margin_right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content_margin_top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content_margin_bottom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;PanelContainer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_theme_stylebox_override&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"panel"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sb&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Saved as a &lt;code&gt;.tres&lt;/code&gt; theme, the whole UI changes style by swapping one file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blurry edges&lt;/strong&gt;: the texture filter is still Linear. Set it to Nearest project-wide or on the node's &lt;code&gt;Texture Filter&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Border looks 1 px off&lt;/strong&gt;: the margins don't match your drawing. Count the border pixels again, including the dark outline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Box smaller than its corners&lt;/strong&gt;: at sizes below twice the margin, corners overlap. Give the node a &lt;code&gt;custom_minimum_size&lt;/code&gt; of at least &lt;code&gt;2 × margin&lt;/code&gt; on each axis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Odd scaling on high-DPI screens&lt;/strong&gt;: use integer stretch scale, not fractional.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Draw one small panel with uniform edges and a flat center.&lt;/li&gt;
&lt;li&gt;Turn off texture filtering.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NinePatchRect&lt;/code&gt; for quick boxes, &lt;code&gt;StyleBoxTexture&lt;/code&gt; in a theme for buttons and containers.&lt;/li&gt;
&lt;li&gt;Patch/texture margins = your border width.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want a ready base to start from, sketch a panel in the &lt;a href="https://simplepixelart.com/" rel="noopener noreferrer"&gt;pixel art&lt;/a&gt; editor at SimplePixelArt, export it at 1x, and drop it straight into the steps above.&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>godot</category>
      <category>pixelart</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Wang-16 vs blob-47: how auto-tile sets actually work (and which one to draw)</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Sun, 01 Nov 2026 16:09:00 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/wang-16-vs-blob-47-how-auto-tile-sets-actually-work-and-which-one-to-draw-538m</link>
      <guid>https://dev.to/hoanganhlam/wang-16-vs-blob-47-how-auto-tile-sets-actually-work-and-which-one-to-draw-538m</guid>
      <description>&lt;p&gt;Auto-tiling is what lets you paint "grass" or "water" on a map and have the borders sort themselves out. Under the hood every auto-tile system does the same thing: look at the neighbours of a cell, turn them into a number, and use that number to pick a tile.&lt;/p&gt;

&lt;p&gt;The two layouts you will meet most are &lt;strong&gt;Wang-16&lt;/strong&gt; and &lt;strong&gt;blob-47&lt;/strong&gt;. They are not interchangeable. Picking the wrong one means either drawing tiles you never use or getting seams you cannot fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wang-16: a tile per corner combination
&lt;/h2&gt;

&lt;p&gt;A Wang corner set asks one question per tile corner: &lt;em&gt;is this corner terrain A or terrain B?&lt;/em&gt; Four corners, two options each, gives 2⁴ = &lt;strong&gt;16 tiles&lt;/strong&gt;.&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%2Fkhrem3n8w6zpfqxybfvo.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%2Fkhrem3n8w6zpfqxybfvo.png" alt="Wang-16 corner set" width="566" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each tile is identified by its corners, read clockwise or as a 4-bit number (NW, NE, SW, SE). The full grass tile is &lt;code&gt;0000&lt;/code&gt;, the full dirt tile is &lt;code&gt;1111&lt;/code&gt;, and everything in between is a transition.&lt;/p&gt;

&lt;p&gt;Wang-16 works well for &lt;strong&gt;top-down terrain&lt;/strong&gt;: grass meeting dirt, sand meeting water, snow meeting rock. Transitions are soft and diagonal-friendly, and you only draw 16 tiles per pair of terrains.&lt;/p&gt;

&lt;p&gt;Its limit: because it only knows about corners, it cannot tell a one-tile-wide path from a thicker one. Thin features come out blobby.&lt;/p&gt;

&lt;h2&gt;
  
  
  Blob-47: edges &lt;em&gt;and&lt;/em&gt; corners
&lt;/h2&gt;

&lt;p&gt;A blob set looks at all &lt;strong&gt;8 neighbours&lt;/strong&gt; of a cell: the four edges (N, E, S, W) and the four corners (NE, SE, SW, NW). Eight bits would mean 256 combinations, so why only 47?&lt;/p&gt;

&lt;p&gt;Because most corners don't matter. A corner neighbour only changes the tile if &lt;strong&gt;both edges next to it are also set&lt;/strong&gt;. If the north or east neighbour is empty, the NE neighbour is hidden behind a border anyway. Fold away the corners that can't be seen and 256 masks collapse to &lt;strong&gt;47 distinct tiles&lt;/strong&gt;:&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%2F0rqk7t8o44beolixi87x.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%2F0rqk7t8o44beolixi87x.png" alt="Blob-47 set" width="798" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The folding rule in code is three lines:&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="c1"&gt;// bits: N=1, NE=2, E=4, SE=8, S=16, SW=32, W=64, NW=128&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;canonical&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mask&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;E&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mask&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mask&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;W&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mask&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;E&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nx"&gt;mask&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;=&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;    &lt;span class="c1"&gt;// NE only counts with N and E&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;E&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nx"&gt;mask&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;=&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;    &lt;span class="c1"&gt;// SE only counts with S and E&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nx"&gt;mask&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;=&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;   &lt;span class="c1"&gt;// SW only counts with S and W&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nx"&gt;mask&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;=&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="mi"&gt;128&lt;/span&gt;  &lt;span class="c1"&gt;// NW only counts with N and W&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;mask&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run every value from 0 to 255 through it and you get exactly 47 unique results.&lt;/p&gt;

&lt;p&gt;Blob-47 is the right choice for &lt;strong&gt;walls, platforms, cliffs, rivers and 1-tile-wide paths&lt;/strong&gt;: anything where inner corners and thin strips have to look deliberate. The price is drawing 47 tiles instead of 16.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which one should you draw?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Wang-16 (corners)&lt;/th&gt;
&lt;th&gt;Blob-47 (edges + corners)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tiles per terrain pair&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;47&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Looks at&lt;/td&gt;
&lt;td&gt;4 corners&lt;/td&gt;
&lt;td&gt;8 neighbours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1-tile-wide strips&lt;/td&gt;
&lt;td&gt;Blobby&lt;/td&gt;
&lt;td&gt;Clean&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inner corners&lt;/td&gt;
&lt;td&gt;Soft&lt;/td&gt;
&lt;td&gt;Sharp, explicit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Good for&lt;/td&gt;
&lt;td&gt;Top-down ground, water, sand&lt;/td&gt;
&lt;td&gt;Platformer terrain, walls, cliffs, roads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Godot 4 terrain mode&lt;/td&gt;
&lt;td&gt;Match Corners&lt;/td&gt;
&lt;td&gt;Match Corners and Sides&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tiled Wang set type&lt;/td&gt;
&lt;td&gt;Corner&lt;/td&gt;
&lt;td&gt;Mixed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A common setup is both: Wang-16 for the ground layer, blob-47 for walls and anything the player collides with.&lt;/p&gt;

&lt;h2&gt;
  
  
  You don't have to draw 47 tiles by hand
&lt;/h2&gt;

&lt;p&gt;Most blob tiles are combinations of the same few pieces: an outer corner, an inner corner, a straight edge and the fill. Split each tile into four quarters and every quarter is one of those pieces. This is the RPG Maker "A2 autotile" trick, and it means a handful of hand-drawn pieces can generate the full 47.&lt;/p&gt;

&lt;p&gt;That's the approach the tileset editor in &lt;a href="https://simplepixelart.com/tilesets/editor" rel="noopener noreferrer"&gt;SimplePixelArt&lt;/a&gt; uses: draw a base tile, pick Wang-16 or blob-47, and it composes every border variant for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting the set into an engine
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Godot 4:&lt;/strong&gt; create a &lt;code&gt;TileSet&lt;/code&gt;, add a terrain set with the mode from the table above, add your terrain, then paint the peering bits on each tile so they match its mask. With the bits set, the Terrains tab in the TileMap editor auto-tiles as you paint.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tiled:&lt;/strong&gt; open the tileset, add a Wang set of type &lt;em&gt;Corner&lt;/em&gt; (Wang-16) or &lt;em&gt;Mixed&lt;/em&gt; (blob-47), add your colours, and mark each tile's corners or edges. The Terrain brush then picks tiles automatically.&lt;/p&gt;

&lt;p&gt;Marking 47 tiles by hand is the tedious part, so it's worth using a tool that writes the file for you. The tileset editor above exports a Godot &lt;code&gt;.tres&lt;/code&gt; with the terrain peering bits already set and a Tiled &lt;code&gt;.tsx&lt;/code&gt; with the Wang set filled in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wang-16:&lt;/strong&gt; 4 corners → 16 tiles. Soft ground transitions, cheap to draw.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blob-47:&lt;/strong&gt; 8 neighbours, with hidden corners folded away → 47 tiles. Clean walls, paths and inner corners.&lt;/li&gt;
&lt;li&gt;Choose by what the terrain has to do, not by tile count.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to try both without drawing anything first, open a free online &lt;a href="https://simplepixelart.com/editor" rel="noopener noreferrer"&gt;pixel art editor&lt;/a&gt;, sketch one base tile and let the tileset editor build the set. There's more &lt;a href="https://simplepixelart.com/" rel="noopener noreferrer"&gt;pixel art&lt;/a&gt; made with it on the site.&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>pixelart</category>
      <category>godot</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>I Built SimplePixelArt — A Pixel Art Editor That Stays Smooth With Multiple Boards</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Fri, 23 Oct 2026 09:02:30 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/i-built-simplepixelart-a-pixel-art-editor-that-stays-smooth-with-multiple-boards-2kak</link>
      <guid>https://dev.to/hoanganhlam/i-built-simplepixelart-a-pixel-art-editor-that-stays-smooth-with-multiple-boards-2kak</guid>
      <description>&lt;p&gt;Hey devs! 👋&lt;/p&gt;

&lt;p&gt;I've been building &lt;a href="https://simplepixelart.com" rel="noopener noreferrer"&gt;SimplePixelArt&lt;/a&gt;, a free browser-based pixel art editor and toolkit for artists, indie game developers, and anyone who loves pixel art.&lt;/p&gt;

&lt;p&gt;My goal is to make creating pixel art and preparing game assets easier, without requiring complicated software installations.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎨 What Can You Do With SimplePixelArt?
&lt;/h2&gt;

&lt;p&gt;SimplePixelArt is more than just a drawing tool. It brings pixel art creation, image conversion, sprite extraction, tileset building, and tilemap editing together in one place.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎨 Create &amp;amp; Generate Pixel Art
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://simplepixelart.com/editor" rel="noopener noreferrer"&gt;Pixel Art Editor&lt;/a&gt;&lt;/strong&gt; — Draw pixel by pixel with layers, palettes, mirror mode, and multiple boards in a smooth workspace.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://simplepixelart.com/generator" rel="noopener noreferrer"&gt;AI Pixel Art Generator&lt;/a&gt;&lt;/strong&gt; — Generate pixel art from text prompts or reference images.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://simplepixelart.com/converter" rel="noopener noreferrer"&gt;Image to Pixel Art Converter&lt;/a&gt;&lt;/strong&gt; — Convert photos and images into pixel art. Adjust resolution, color count, brightness, contrast, saturation, transparency, and dithering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://simplepixelart.com/upload" rel="noopener noreferrer"&gt;Upload Existing Pixel Art&lt;/a&gt;&lt;/strong&gt; — Import PNG, GIF, and WebP artwork while preserving its original pixel grid.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🧩 Convert &amp;amp; Prepare Game Assets
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://simplepixelart.com/tilesets/slicer" rel="noopener noreferrer"&gt;Tileset &amp;amp; Spritesheet Slicer&lt;/a&gt;&lt;/strong&gt; — Split spritesheets and tilesets into individual sprites using a grid, automatic detection, or manual selection. Export sprites as a ZIP of PNG files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://simplepixelart.com/tilesets/editor" rel="noopener noreferrer"&gt;Tileset Editor&lt;/a&gt;&lt;/strong&gt; — Organize tiles, generate auto-tile terrain variations, and export game-ready assets for Godot, Tiled, Unity, and other workflows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://simplepixelart.com/tilemaps/editor" rel="noopener noreferrer"&gt;Tilemap Editor&lt;/a&gt;&lt;/strong&gt; — Build top-down or isometric maps with multiple layers and terrain-aware brushes. Export maps in Tiled's TMJ format.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🌍 Publish &amp;amp; Discover Pixel Art
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://simplepixelart.com/" rel="noopener noreferrer"&gt;SimplePixelArt Community&lt;/a&gt;&lt;/strong&gt; — Discover pixel art, publish your creations, and explore work from other artists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://simplepixelart.com/creator-program" rel="noopener noreferrer"&gt;Creator Program&lt;/a&gt;&lt;/strong&gt; — Learn about creator features, artwork attribution, licensing, and sharing your work with the community.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🛠️ Why I Built It
&lt;/h2&gt;

&lt;p&gt;I wanted to make pixel art creation accessible while also solving practical problems in game development.&lt;/p&gt;

&lt;p&gt;Drawing a sprite is only one part of the workflow. You might also need to convert a reference image, extract sprites from a sheet, create reusable terrain tiles, and assemble those tiles into a game world.&lt;/p&gt;

&lt;p&gt;Having separate tools for every step can make the workflow unnecessarily fragmented.&lt;/p&gt;

&lt;p&gt;With SimplePixelArt, you can move from creating pixel art to preparing game assets and building maps, all in your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 What's Next?
&lt;/h2&gt;

&lt;p&gt;I'm continuing to improve the editor, expand the creative workflow, and make the platform more useful for both pixel artists and indie game developers.&lt;/p&gt;

&lt;p&gt;Feedback is always welcome, especially from developers working with spritesheets, autotiling, tilesets, and tilemaps.&lt;/p&gt;

&lt;p&gt;If you're interested in pixel art or browser-based creative tools, give it a try:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://simplepixelart.com" rel="noopener noreferrer"&gt;https://simplepixelart.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear what you think and what features you'd like to see next!&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>javascript</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How I Built Factcovery in 2 Days with Claude — 0 Lines of Code Written by Me</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Sat, 28 Mar 2026 14:21:56 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/how-i-built-factcovery-in-2-days-with-claude-0-lines-of-code-written-by-me-5cei</link>
      <guid>https://dev.to/hoanganhlam/how-i-built-factcovery-in-2-days-with-claude-0-lines-of-code-written-by-me-5cei</guid>
      <description>&lt;p&gt;Here's what Factcovery actually looks like.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;&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.amazonaws.com%2Fuploads%2Farticles%2Fvdwesji3aq4wynurfl6k.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.amazonaws.com%2Fuploads%2Farticles%2Fvdwesji3aq4wynurfl6k.png" alt=" " width="800" height="419"&gt;&lt;/a&gt;&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.amazonaws.com%2Fuploads%2Farticles%2Fmfrxmulndlb0qez51qg3.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.amazonaws.com%2Fuploads%2Farticles%2Fmfrxmulndlb0qez51qg3.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&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.amazonaws.com%2Fuploads%2Farticles%2Fl7dkyfcfdqcru540qewl.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.amazonaws.com%2Fuploads%2Farticles%2Fl7dkyfcfdqcru540qewl.png" alt=" " width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mobile App&lt;/strong&gt;&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.amazonaws.com%2Fuploads%2Farticles%2F6pw42fbo3na7ovh71tlg.jpeg" 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.amazonaws.com%2Fuploads%2Farticles%2F6pw42fbo3na7ovh71tlg.jpeg" alt=" " width="590" height="1280"&gt;&lt;/a&gt;&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.amazonaws.com%2Fuploads%2Farticles%2Fwawbzastoz7g5o6wzke7.jpeg" 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.amazonaws.com%2Fuploads%2Farticles%2Fwawbzastoz7g5o6wzke7.jpeg" alt=" " width="590" height="1280"&gt;&lt;/a&gt;&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.amazonaws.com%2Fuploads%2Farticles%2Fm4ccwh400zsryijpnilk.jpeg" 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.amazonaws.com%2Fuploads%2Farticles%2Fm4ccwh400zsryijpnilk.jpeg" alt=" " width="590" height="1280"&gt;&lt;/a&gt;&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.amazonaws.com%2Fuploads%2Farticles%2Fuxbyiha80qw8hec1mxup.jpeg" 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.amazonaws.com%2Fuploads%2Farticles%2Fuxbyiha80qw8hec1mxup.jpeg" alt=" " width="590" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;App coming soon, pending store review&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lighthouse Report&lt;/strong&gt;&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.amazonaws.com%2Fuploads%2Farticles%2Frkv157pk6mjf4uf4oqi6.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.amazonaws.com%2Fuploads%2Farticles%2Frkv157pk6mjf4uf4oqi6.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Honestly, hitting a good Lighthouse score isn't rocket science — but I'm pretty confident AI will nail it more consistently than most of us would on our own.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Factcovery is live at &lt;a href="https://factcovery.com" rel="noopener noreferrer"&gt;factcovery.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  First things first — this is NOT vibe coding
&lt;/h2&gt;

&lt;p&gt;There's a way most people use AI that looks something like this: open Claude or ChatGPT, type &lt;em&gt;"build me a todo app"&lt;/em&gt;, get code back, paste it in, pray it works. When it breaks, paste the error back in. Repeat forever.&lt;/p&gt;

&lt;p&gt;That's &lt;strong&gt;vibe coding&lt;/strong&gt;. It works fine for small throwaway tasks. But for a real product — with a web app, a REST API, a mobile app, and CI/CD — it falls apart fast.&lt;/p&gt;

&lt;p&gt;What I did was a little different. I used Claude as an &lt;strong&gt;AI Agent&lt;/strong&gt;, which means before Claude writes a single line of code, we &lt;strong&gt;plan together first&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The core rule: Plan in plain English → Review → Then build.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Nothing fancy. But that one extra step changed everything about how the project turned out.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Factcovery?
&lt;/h2&gt;

&lt;p&gt;Factcovery is an app that aggregates and generates interesting "facts" by topic — bite-sized, accurate, shareable pieces of information you'd want to send to a friend.&lt;/p&gt;

&lt;p&gt;The final stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Web&lt;/strong&gt;: NuxtJS&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API&lt;/strong&gt;: Django REST Framework&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile&lt;/strong&gt;: Flutter&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Infrastructure&lt;/strong&gt;: GitHub Actions + VPS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total time: &lt;strong&gt;~2 days&lt;/strong&gt;.&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.amazonaws.com%2Fuploads%2Farticles%2Fioi0qawbmvj2purbx0xn.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.amazonaws.com%2Fuploads%2Farticles%2Fioi0qawbmvj2purbx0xn.png" alt=" " width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Part 1 — Web with NuxtJS: Plan first, code second
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The first step is never code — it's a conversation
&lt;/h3&gt;

&lt;p&gt;Instead of saying &lt;em&gt;"build me a web app about facts"&lt;/em&gt;, I started with an actual conversation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My prompt:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;"I want to build a web app called Factcovery — where users can discover interesting facts by topic. Target users are 20–35 year olds who like quick reads and mostly browse on mobile. Before writing any code, help me list all the screens we need, the main user flows, and suggest a folder structure for NuxtJS. No code yet — just the plan."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude came back with a clear plan: a list of screens, a user journey from app open to sharing a fact, and a sensible folder structure. &lt;strong&gt;I read it, adjusted what didn't feel right, and only then gave Claude the green light to start coding.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the key point: &lt;strong&gt;you make the decisions, Claude does the execution.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  UI — Describe the feeling, not the pixels
&lt;/h3&gt;

&lt;p&gt;I didn't say &lt;em&gt;"blue button, border-radius 8px"&lt;/em&gt;. I said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My prompt:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;"The UI of Factcovery should feel like a modern science magazine — clean, has depth, not too serious. Dark background with amber yellow as the accent color. Typography needs to be readable on mobile. Please propose a simple design system: color palette, font pairing, spacing scale. Then apply it to the homepage."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The result? A consistent design system from day one — not something patched together screen by screen.&lt;/p&gt;




&lt;h3&gt;
  
  
  Multiple Languages — Plan it from the start
&lt;/h3&gt;

&lt;p&gt;Retrofitting i18n into an existing codebase is painful. This time I asked Claude to plan the i18n strategy before the project structure was even finalized:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My prompt:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;"This project needs to support English and Vietnamese from day one. Propose how to organize translation files in NuxtJS, a naming convention for keys, and a workflow for adding new languages later without having to refactor. No code yet — just the approach."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Lighthouse — Build for performance, don't fix it later
&lt;/h3&gt;

&lt;p&gt;Instead of waiting until the app was done to find out the Lighthouse score was bad, I asked Claude upfront:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My prompt:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;"For a NuxtJS app that displays a lot of text and images, what are the most common Lighthouse issues? Create a checklist of things to implement from the start to hit 90+ on both mobile and desktop."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude returned a concrete checklist. I implemented it while building — not after.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part 2 — Django Backend: Read the frontend, then write the API
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A reverse workflow — that actually makes sense
&lt;/h3&gt;

&lt;p&gt;Instead of designing the API first and making the frontend conform to it, I did the opposite: &lt;strong&gt;I used the frontend code itself as input for Claude to infer the data model.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My prompt:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;"Here are my Nuxt components and pages [paste code]. From these, infer the Django models needed, the relationships between them, and the minimum API endpoints required for the frontend to work correctly. Output in this order: Models → Serializers → URLs."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The result was a backend that was in sync with the frontend from the very beginning — no discovering missing fields after the fact.&lt;/p&gt;




&lt;h3&gt;
  
  
  Crawl &amp;amp; Generate Fact Pipeline
&lt;/h3&gt;

&lt;p&gt;This was the most logic-heavy part. I spent the most time on the &lt;strong&gt;planning step&lt;/strong&gt; before letting Claude write anything:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My prompt:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;"I need a pipeline: crawl news sources → extract content → use AI to summarize into a short 'fact' → save to DB → expose via API. Design the architecture for this pipeline: what Django models are needed, what task queue to use, error handling strategy, and how to schedule it to run periodically. No code yet — just the architecture in text form."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After reviewing and tweaking the architecture, I had Claude implement it piece by piece.&lt;/p&gt;




&lt;h2&gt;
  
  
  Part 3 — Mobile with Flutter: Know when to pivot
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Tried React Native — and recognized it wasn't the right fit
&lt;/h3&gt;

&lt;p&gt;I started with React Native because I was comfortable in the JavaScript ecosystem. Claude scaffolded the project, I ran it, and the performance wasn't where I wanted it — animations felt sluggish, and the structure was more complex than a relatively simple app needed.&lt;/p&gt;

&lt;p&gt;Instead of trying to fix it, I made the call to pivot. This is where &lt;strong&gt;human judgment matters more than any prompt&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Switching to Flutter
&lt;/h3&gt;

&lt;p&gt;With Flutter, I started fresh — the right way:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My prompt:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;"I'm building the Factcovery mobile app with Flutter. The app has these screens: [list]. Please propose: project structure, a state management solution that fits this app, naming conventions, and how to organize the theme and styles. Explain the reasoning behind each choice."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude didn't just give me a structure — it explained why. I read it, understood the reasoning, and agreed before moving forward.&lt;/p&gt;




&lt;h3&gt;
  
  
  Push Notification System
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My prompt:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;"I need push notifications for the Flutter app: notify users when there are new facts on topics they follow. Plan the entire flow: from user subscribing to a topic → backend triggering the notification → Flutter receiving and displaying it. Include background handling. Plan first, code after."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Part 4 — CI/CD: GitHub Actions deploying to VPS
&lt;/h2&gt;

&lt;p&gt;This is the part that intimidates a lot of people — but with the "plan first" approach, it's straightforward:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;My prompt:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;"I have a VPS running Ubuntu and my code is on GitHub. When I push to main, I want to automatically: SSH into the VPS, git pull, run docker-compose up to restart services, then run a health check. Plan this workflow step by step, then write the complete .github/workflows/deploy.yml file. Also suggest how to set up SSH keys securely for GitHub Actions."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude wrote the full YAML config, the deploy script, and a guide for setting up secrets. I just read it, understood the flow, and followed the instructions.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ What worked really well
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Always ask for a plan before any code&lt;/strong&gt;&lt;br&gt;
This is rule number one. Any task more complex than "fix this specific bug" should start with a planning conversation. Spending 5 extra minutes on a plan saves 2 hours of debugging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Use the output of one step as input for the next&lt;/strong&gt;&lt;br&gt;
Frontend code → input for backend design. Backend API spec → input for mobile app. Everything connects in a logical chain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Ask Claude to explain its reasoning&lt;/strong&gt;&lt;br&gt;
Add &lt;em&gt;"explain why"&lt;/em&gt; to your prompts. You don't need to read every line of code, but understanding the reasoning lets you review properly and make real decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Break tasks into small pieces — don't prompt everything at once&lt;/strong&gt;&lt;br&gt;
One giant prompt = mediocre output across the board. One focused prompt per step = higher quality output that's actually reviewable.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚠️ Where human judgment is still essential
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deciding to pivot&lt;/strong&gt; (like switching from React Native to Flutter): AI can't sense that something "feels off" in the context of your specific project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reviewing architecture before implementation&lt;/strong&gt;: Claude will suggest something reasonable, but you understand the business requirements better than it does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choosing trade-offs&lt;/strong&gt;: When Claude presents multiple options, you're the one who decides — not Claude.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The real cost of building with AI
&lt;/h2&gt;

&lt;p&gt;Let's talk about something people rarely mention in posts like this — &lt;strong&gt;how much it actually costs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I'm on Claude Pro ($20/month). For a normal day of work, that's more than enough. But building an entire product in 2 days — web, API, mobile, and CI/CD all at once — is not a normal day. I hit the usage limit. Multiple times.&lt;/p&gt;

&lt;p&gt;When that happened, I switched over to &lt;strong&gt;minimax 2.5&lt;/strong&gt; to keep the momentum going - It's free. It handled most tasks just fine, but there were moments where I could feel the difference — especially on the heavier architecture planning prompts where Sonnet tends to reason a bit deeper and stay more consistent across a long context.&lt;/p&gt;

&lt;p&gt;So if you're planning something like this: either budget for API usage on top of your Pro subscription, or be strategic about when you use the big prompts. Save the architecture sessions for when you have the strongest model available. Don't waste it on boilerplate.&lt;/p&gt;

&lt;p&gt;Total cost was still a fraction of what any freelancer would charge for the same scope. But it wasn't free — just worth being upfront about.&lt;/p&gt;




&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Factcovery&lt;/strong&gt; wasn't built by a developer who's great at writing code. It was built by someone who knows &lt;strong&gt;how to work with AI intentionally&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The difference isn't in the prompts or the tools. The difference is in the &lt;strong&gt;mindset&lt;/strong&gt;: you are the product manager of your own project, and Claude is the best engineer you've ever worked with — as long as you brief them clearly enough.&lt;/p&gt;




&lt;p&gt;If you're curious about anything — the project structure, the exact prompts, the mistakes I didn't write about — just leave a comment. I'll answer everything. Building in public means sharing the messy parts too.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Javascript Functions Quick References</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Thu, 21 Dec 2023 09:59:01 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/javascript-functions-quick-references-2a1a</link>
      <guid>https://dev.to/hoanganhlam/javascript-functions-quick-references-2a1a</guid>
      <description>&lt;h1&gt;
  
  
  JavaScript Functions Cheat Sheet
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Function Declaration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Syntax
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Function body&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&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;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`Hello, &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;!`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Function Expression
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Syntax
&lt;/h3&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="nx"&gt;functionName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Function body&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&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;h3&gt;
  
  
  Example
&lt;/h3&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="nx"&gt;greet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`Hello, &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;!`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Arrow Function
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Syntax
&lt;/h3&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="nx"&gt;functionName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Function body&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&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;h3&gt;
  
  
  Example
&lt;/h3&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="nx"&gt;greet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;`Hello, &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;!`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Immediately Invoked Function Expression (IIFE)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Syntax
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Function body&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;IIFE executed&lt;/span&gt;&lt;span class="dl"&gt;'&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;h2&gt;
  
  
  Function Parameters and Arguments
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;addNumbers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;addNumbers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// Output: 15&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More: &lt;a href="https://simplecheatsheet.com/javascript"&gt;Javascript Cheat Sheet&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>cheatsheet</category>
    </item>
    <item>
      <title>JavaScript Requests quick reference</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Thu, 21 Dec 2023 09:56:04 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/javascript-requests-quick-reference-2496</link>
      <guid>https://dev.to/hoanganhlam/javascript-requests-quick-reference-2496</guid>
      <description>&lt;h1&gt;
  
  
  JavaScript Requests Cheat Sheet
&lt;/h1&gt;

&lt;h2&gt;
  
  
  XMLHttpRequest
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;xhr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;XMLHttpRequest&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/data&lt;/span&gt;&lt;span class="dl"&gt;'&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="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;responseText&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Request failed!&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;xhr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Fetch API
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Axios
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Async/Await
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&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="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More &lt;a href="https://simplecheatsheet.com/javascript"&gt;Javascript Cheat Sheet&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cheatsheet</category>
      <category>javascript</category>
      <category>networking</category>
    </item>
    <item>
      <title>PyTorch Quick Ref</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Sun, 17 Dec 2023 02:32:02 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/pytorch-quick-ref-3j1j</link>
      <guid>https://dev.to/hoanganhlam/pytorch-quick-ref-3j1j</guid>
      <description>&lt;h2&gt;
  
  
  Imports
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import torch                                        # root package
from torch.utils.data import Dataset, DataLoader    # dataset representation and loading
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Neural Network API
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import torch.autograd as autograd         # computation graph
from torch import Tensor                  # tensor node in the computation graph
import torch.nn as nn                     # neural networks
import torch.nn.functional as F           # layers, activations and more
import torch.optim as optim               # optimizers e.g. gradient descent, ADAM, etc.
from torch.jit import script, trace       # hybrid frontend decorator and tracing jit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  TorchScript and JIT
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;torch.jit.trace()         # takes your module or function and an example
                          # data input, and traces the computational steps
                          # that the data encounters as it progresses through the model

@script                   # decorator used to indicate data-dependent
                          # control flow within the code being traced
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ONNX
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;torch.onnx.export(model, dummy data, xxxx.proto)       # exports an ONNX formatted
                                                       # model using a trained model, dummy
                                                       # data and the desired file name

model = onnx.load("alexnet.proto")                     # load an ONNX model
onnx.checker.check_model(model)                        # check that the model
                                                       # IR is well formed

onnx.helper.printable_graph(model.graph)               # print a human readable
                                                       # representation of the graph
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://simplecheatsheet.com/pytorch"&gt;PyTorch CheatSheets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pytorch.org/"&gt;PyTorch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>pytorch</category>
      <category>cheatsheet</category>
    </item>
    <item>
      <title>How To Install and Use Docker Compose on Ubuntu 20.04</title>
      <dc:creator>Lam</dc:creator>
      <pubDate>Fri, 15 Dec 2023 07:31:07 +0000</pubDate>
      <link>https://dev.to/hoanganhlam/how-to-install-and-use-docker-compose-on-ubuntu-2004-4dm5</link>
      <guid>https://dev.to/hoanganhlam/how-to-install-and-use-docker-compose-on-ubuntu-2004-4dm5</guid>
      <description>&lt;h2&gt;
  
  
  Step 1 — Installing Docker Compose
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Next, set the correct permissions so that the docker-compose command is executable:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chmod +x /usr/local/bin/docker-compose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To verify that the installation was successful, you can run:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You’ll see output similar to this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Output
docker-compose version 1.29.2, build 5becea4c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Step 2 — Setting Up a docker-compose.yml File
&lt;/h2&gt;

&lt;p&gt;Start off by creating a new directory in your home folder, and then moving into it:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir ~/compose-demo
cd ~/compose-demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this directory, set up an application folder to serve as the document root for your Nginx environment:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Next, create the docker-compose.yml file:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano docker-compose.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Insert the following content in your docker-compose.yml file:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3 — Running Docker Compose
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://simplecheatsheet.com/docker"&gt;Docker Cheatsheet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simplecheatsheet.com/linux"&gt;Linux Cheatsheet&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>docker</category>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
