When you run a small utility site on free hosting tiers, the fastest way to blow through your bandwidth and serverless execution limits is letting users upload images to your backend.
​While building a small web utility (kikpin.me) in plain Node.js, I wanted to add a few creator tools—an image resizer for specific aspect ratios and a dominant color palette extractor. The obvious route was spinning up an API endpoint with sharp or a third-party image service. The problem: even modest traffic would quickly eat through free-tier RAM and function timeouts.
​So I moved all of it to the browser using plain HTML5 Canvas and vanilla JavaScript. Here is what actually worked, and a few edge cases that tripped me up.Lesson learned: Always call URL.revokeObjectURL(url) once the image loads. On mobile browsers, forgetting to revoke object URLs when users test multiple large photos in a row will noticeably spike memory usage.
​2. Extracting Dominant Colors Without Heavy Libraries
​For the color palette tool, I didn't want to ship a huge npm package just to grab 5 HEX codes. Drawing the uploaded image onto a tiny 50×50 canvas first solves two problems at once:
​It shrinks a 4000×3000 photo down to just 2,500 pixels, so ctx.getImageData() runs in a few milliseconds.
​It naturally smooths out noise.
​From there, looping through the RGBA array, quantizing each channel (rounding to the nearest multiple of 24 or 32), and counting the most frequent buckets gives a surprisingly accurate 5-color palette with zero external dependencies.
​3. The SEO Gotcha With Adding New Routes
​The technical part of building the tools took a weekend. The annoying part was getting Google to index them cleanly alongside multilingual routes (/ plus 7–8 language subpaths).
​A few things I had to fix after watching Google Search Console:
​Self-referencing canonicals on every locale: If /vi or /pt accidentally inherits the root canonical (/), Google drops the translated page as an "Alternative page with proper canonical tag."
​Don't expect instant indexing for hub pages: A /tools index page that is mostly cards and links often sits in "Crawled - currently not indexed" longer than standalone pages with actual instructions and text.
​Favicon sizing: Google ignores favicons that aren't a multiple of 48x48 (like 48px, 96px, 192px) and falls back to a generic globe icon in search results.
​Wrapping Up
​Moving compute to the client isn't always possible, especially when you need to hide API keys or scrape/resolve external URLs. But for anything involving image manipulation, color sampling, or text formatting, keeping it 100% client-side means instant feedback for the user, better privacy (their files never leave their device), and a $0 server bill.
​Has anyone else here hit mobile Canvas memory limits with large WebP/PNG exports? Curious how you handle downscaling on older Android devices without crashing the tab.