<?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: longan_dev</title>
    <description>The latest articles on DEV Community by longan_dev (@longan_dev_2854250b0856e1).</description>
    <link>https://dev.to/longan_dev_2854250b0856e1</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%2F4015868%2Fcc0457ec-924e-4ee3-8a93-2f1313fa47fc.png</url>
      <title>DEV Community: longan_dev</title>
      <link>https://dev.to/longan_dev_2854250b0856e1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/longan_dev_2854250b0856e1"/>
    <language>en</language>
    <item>
      <title>I built a free image-to-pixel-art converter that runs 100% in the browser</title>
      <dc:creator>longan_dev</dc:creator>
      <pubDate>Sun, 05 Jul 2026 07:18:37 +0000</pubDate>
      <link>https://dev.to/longan_dev_2854250b0856e1/i-built-a-free-image-to-pixel-art-converter-that-runs-100-in-the-browser-4fc9</link>
      <guid>https://dev.to/longan_dev_2854250b0856e1/i-built-a-free-image-to-pixel-art-converter-that-runs-100-in-the-browser-4fc9</guid>
      <description>&lt;p&gt;I wanted to turn some photos into pixel art for a side project, and every online tool I found either watermarked the output, required signup, or uploaded my images to a server. So I built my own: &lt;a href="https://imagetopixelart.top" rel="noopener noreferrer"&gt;https://imagetopixelart.top&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How it works (no backend at all):&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Downsampling&lt;/strong&gt; — draw the image onto a small canvas (&lt;code&gt;drawImage&lt;/code&gt; with smoothing), where each cell becomes one "pixel". A slider controls block size from 2 to 64px.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Color quantization&lt;/strong&gt; — median-cut over the RGB space for the "Auto" palette, or nearest-color mapping against fixed retro palettes: Game Boy's 4 greens, the NES hardware palette, PICO-8's 16 colors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nearest-neighbor upscale&lt;/strong&gt; — &lt;code&gt;imageSmoothingEnabled = false&lt;/code&gt; keeps every pixel a perfect sharp square at any export size.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The whole thing is a single HTML file. No build step, no framework, no dependencies. Images never leave the device, which makes it instant and private by default.&lt;/p&gt;

&lt;p&gt;Things that surprised me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;Map&lt;/code&gt; cache keyed on packed RGB (&lt;code&gt;(r&amp;lt;&amp;lt;16)|(g&amp;lt;&amp;lt;8)|b&lt;/code&gt;) made nearest-color mapping ~10x faster on photos.&lt;/li&gt;
&lt;li&gt;Weighting the distance metric (2/4/3 for R/G/B) noticeably improves how "right" the palette mapping feels vs plain Euclidean.&lt;/li&gt;
&lt;li&gt;Median-cut in ~30 lines of JS is good enough — no need for k-means.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try it and tell me what palette I should add next: &lt;a href="https://imagetopixelart.top" rel="noopener noreferrer"&gt;https://imagetopixelart.top&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>showdev</category>
      <category>powerapps</category>
    </item>
  </channel>
</rss>
