<?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: gatekey</title>
    <description>The latest articles on DEV Community by gatekey (@gatekey).</description>
    <link>https://dev.to/gatekey</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%2F4202013%2Fe3dd0b20-8f98-4e67-af80-0367a376e9a5.png</url>
      <title>DEV Community: gatekey</title>
      <link>https://dev.to/gatekey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gatekey"/>
    <language>en</language>
    <item>
      <title>E-commerce Image Sizes in 2026: A Practical Cheat Sheet for Amazon, Etsy, eBay, Shopify &amp; TikTok Shop</title>
      <dc:creator>gatekey</dc:creator>
      <pubDate>Mon, 02 Nov 2026 02:59:46 +0000</pubDate>
      <link>https://dev.to/gatekey/e-commerce-image-sizes-in-2026-a-practical-cheat-sheet-for-amazon-etsy-ebay-shopify-tiktok-57cf</link>
      <guid>https://dev.to/gatekey/e-commerce-image-sizes-in-2026-a-practical-cheat-sheet-for-amazon-etsy-ebay-shopify-tiktok-57cf</guid>
      <description>&lt;h1&gt;
  
  
  E-commerce Image Sizes in 2026: A Practical Cheat Sheet for Amazon, Etsy, eBay, Shopify &amp;amp; TikTok Shop
&lt;/h1&gt;

&lt;p&gt;If you sell online, you have probably resized the same photo a dozen times today — once for Amazon, once for Etsy, once for your Shopify product page, and once more for a TikTok Shop video thumbnail. Each marketplace has its own pixel requirements, and getting them wrong means cropped text, rejected listings, or blurry zoomed-in images.&lt;/p&gt;

&lt;p&gt;Here is the practical cheat sheet I keep coming back to, plus a faster way to apply it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The numbers that actually matter
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Amazon&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Main product image: 1600 × 1600 px (minimum 500 × 500, zoom requires 1000+)&lt;/li&gt;
&lt;li&gt;Aspect ratio: 1:1 square&lt;/li&gt;
&lt;li&gt;Format: JPEG, PNG, GIF, TIFF — but 85% of buyers use zoom, so go 1600+&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Etsy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Listing image: 2000 × 2000 px recommended (3000 × 3000 max)&lt;/li&gt;
&lt;li&gt;Aspect ratio: 1:1 or 4:3&lt;/li&gt;
&lt;li&gt;Format: JPEG, PNG, GIF (no WebP, no HEIC)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;eBay&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gallery / product images: 1600 × 1600 px (minimum 500 × 500)&lt;/li&gt;
&lt;li&gt;Aspect ratio: 1:1 square&lt;/li&gt;
&lt;li&gt;Format: JPEG, PNG, BMP, GIF, TIFF&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Shopify&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product images: 2048 × 2048 px ideal&lt;/li&gt;
&lt;li&gt;Aspect ratio: 1:1 works best for the theme grid&lt;/li&gt;
&lt;li&gt;File size: Shopify auto-compresses, so upload the largest you have&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;TikTok Shop&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product listing image: 800 × 800 px or larger&lt;/li&gt;
&lt;li&gt;Video cover: 1080 × 1920 px (9:16) for organic content&lt;/li&gt;
&lt;li&gt;Format: JPEG, PNG&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pinterest (often overlooked for e-commerce)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pins: 1000 × 1500 px (2:3) perform better than squares&lt;/li&gt;
&lt;li&gt;Product boards: 600 × 900 minimum&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why getting the size right is worth the effort
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Amazon and eBay &lt;strong&gt;reject or demote&lt;/strong&gt; listings with images below the minimum.&lt;/li&gt;
&lt;li&gt;Etsy's zoom viewer needs 2000+ px or buyers see a blurry close-up.&lt;/li&gt;
&lt;li&gt;TikTok Shop thumbnails are cropped aggressively — the wrong aspect ratio cuts off your product.&lt;/li&gt;
&lt;li&gt;A consistent 1:1 or 2:3 export also keeps your brand feed looking professional across channels.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The faster workflow
&lt;/h2&gt;

&lt;p&gt;Instead of opening Photoshop or a web compressor for every channel, I keep one browser tab open for this: &lt;strong&gt;imgsize&lt;/strong&gt; (&lt;a href="https://www.imgsize.cc" rel="noopener noreferrer"&gt;https://www.imgsize.cc&lt;/a&gt;) — a free, browser-only image resizer with 85+ presets covering these exact marketplaces. You pick the platform (Amazon, Etsy, eBay, Shopify, TikTok Shop and more), and it resizes and crops your photo to that platform's required pixel size, max file size, and accepted format. Everything runs locally in your browser, so product photos never get uploaded anywhere — which also matters if you work with unreleased designs.&lt;/p&gt;

&lt;p&gt;You can even export one photo at all 17 marketplace specs at once as a ZIP, instead of manually duplicating tabs.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Ratio&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Amazon&lt;/td&gt;
&lt;td&gt;1600×1600&lt;/td&gt;
&lt;td&gt;1:1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Etsy&lt;/td&gt;
&lt;td&gt;2000×2000&lt;/td&gt;
&lt;td&gt;1:1 / 4:3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;eBay&lt;/td&gt;
&lt;td&gt;1600×1600&lt;/td&gt;
&lt;td&gt;1:1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shopify&lt;/td&gt;
&lt;td&gt;2048×2048&lt;/td&gt;
&lt;td&gt;1:1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TikTok Shop&lt;/td&gt;
&lt;td&gt;800×800+&lt;/td&gt;
&lt;td&gt;1:1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pinterest&lt;/td&gt;
&lt;td&gt;1000×1500&lt;/td&gt;
&lt;td&gt;2:3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Save the table, resize once per listing, and stop losing time to pixel-requirement guesswork.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ecommerce</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Resize and Crop Images in the Browser with the Canvas API — No Server, No Upload</title>
      <dc:creator>gatekey</dc:creator>
      <pubDate>Thu, 29 Oct 2026 15:06:42 +0000</pubDate>
      <link>https://dev.to/gatekey/resize-and-crop-images-in-the-browser-with-the-canvas-api-no-server-no-upload-4cia</link>
      <guid>https://dev.to/gatekey/resize-and-crop-images-in-the-browser-with-the-canvas-api-no-server-no-upload-4cia</guid>
      <description>&lt;h2&gt;
  
  
  Why process images on the client at all
&lt;/h2&gt;

&lt;p&gt;Most image tools upload your file to a server, resize it there, then send a new file back. That works, but it has three downsides: your photos leave the device (privacy), every request costs round-trip latency (speed), and the operator pays storage and bandwidth (cost).&lt;/p&gt;

&lt;p&gt;You can do the whole resize and crop inside the browser with the Canvas 2D API. Nothing is sent over the network, processing finishes in milliseconds, and there is no backend to scale. That is exactly how &lt;a href="https://www.imgsize.cc" rel="noopener noreferrer"&gt;imgsize&lt;/a&gt; works: pick a platform preset, drop the file, get the sized image back locally.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline in five steps
&lt;/h2&gt;

&lt;p&gt;The flow stays the same whether you resize to a preset, a free crop, or a custom width and height:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read the selected &lt;code&gt;File&lt;/code&gt; from an &lt;code&gt;&amp;lt;input type="file"&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Decode it with &lt;code&gt;createImageBitmap()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create a canvas sized to the &lt;strong&gt;target&lt;/strong&gt; dimensions.&lt;/li&gt;
&lt;li&gt;Draw the cropped source region onto it with the nine-argument &lt;code&gt;drawImage()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Export a &lt;code&gt;Blob&lt;/code&gt;, make an object URL, and trigger a download.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  A minimal, runnable example
&lt;/h2&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;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;input[type=file]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// 1. Decode the file on the client&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bitmap&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;createImageBitmap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// 2. Target canvas: 1080 x 1080 (square social post)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;canvas&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1080&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1080&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;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// 3. High-quality smoothing&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;imageSmoothingEnabled&lt;/span&gt; &lt;span class="o"&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;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;imageSmoothingQuality&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;high&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// 4. Crop the source region, then scale it to the target.&lt;/span&gt;
&lt;span class="c1"&gt;//    drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh)&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;sx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sh&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// source crop rectangle in original pixels&lt;/span&gt;
  &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1080&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1080&lt;/span&gt;  &lt;span class="c1"&gt;// destination rectangle on the canvas&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// release decoder resources&lt;/span&gt;

&lt;span class="c1"&gt;// 5. Export and download&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&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;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBlob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image/png&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createObjectURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blob&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;a&lt;/span&gt;&lt;span class="dl"&gt;'&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;href&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;url&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;download&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;resized.png&lt;/span&gt;&lt;span class="dl"&gt;'&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="nf"&gt;click&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="nf"&gt;revokeObjectURL&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="c1"&gt;// free the object URL after use&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the core. Everything else is around these five calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  The nine-argument drawImage() is doing two jobs at once
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;drawImage()&lt;/code&gt; with nine arguments combines &lt;strong&gt;cropping&lt;/strong&gt; and &lt;strong&gt;scaling&lt;/strong&gt; in one call:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first four numbers describe which rectangle of the source image to take (&lt;code&gt;sx, sy, sw, sh&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The last four describe where it lands on the destination canvas (&lt;code&gt;dx, dy, dw, dh&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If &lt;code&gt;sw/sh&lt;/code&gt; does not match the target aspect ratio, the browser stretches the crop into &lt;code&gt;dw/dh&lt;/code&gt;. For a clean output you calculate the crop yourself so there is no distortion — for example, take a centered square out of a landscape photo before drawing it onto a square canvas.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-world details that break a naive version
&lt;/h2&gt;

&lt;p&gt;These are the details that a tutorial snippet usually skips but a usable tool needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Map screen coordinates back to original pixels
&lt;/h3&gt;

&lt;p&gt;When the user drags a crop box on screen, your coordinates live in a scaled preview. Before &lt;code&gt;drawImage()&lt;/code&gt;, convert them back to source pixels using the preview's scale factor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;crop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;imageRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;imageRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&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;sy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;crop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;imageRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;imageRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&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;sw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;sx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;crop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;imageRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&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;sh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;sy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;crop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;imageRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you skip this, the crop drifts whenever the preview is zoomed or panned.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Fill an opaque background where transparency is not allowed
&lt;/h3&gt;

&lt;p&gt;Marketplace listings (Amazon, Etsy) do not accept transparency. Before drawing, paint the canvas white (or neutral gray) so transparent edges do not turn black:&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="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fillStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fillRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bitmap&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sh&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Social presets, on the other hand, keep the source transparency, so the background fill should be conditional on the target format.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Watch for silent MIME downgrades
&lt;/h3&gt;

&lt;p&gt;In some browsers and WebViews, &lt;code&gt;canvas.toBlob('image/gif')&lt;/code&gt; silently returns a PNG instead. Before trusting the export, check &lt;code&gt;blob.type&lt;/code&gt; against the requested MIME and surface a clear error rather than handing the user a mislabeled file.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Release resources
&lt;/h3&gt;

&lt;p&gt;Close each decoded bitmap with &lt;code&gt;bitmap.close()&lt;/code&gt;, and call &lt;code&gt;URL.revokeObjectURL()&lt;/code&gt; on old preview URLs so memory does not accumulate across repeated resizes.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. PNG ignores the quality argument
&lt;/h3&gt;

&lt;p&gt;Only JPEG honors the quality parameter in &lt;code&gt;toBlob()&lt;/code&gt; / &lt;code&gt;toDataURL()&lt;/code&gt;. PNG compression losslessness does not take a quality number, so pass quality only when exporting JPEG.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to reach for a ready-made tool
&lt;/h2&gt;

&lt;p&gt;If you need 80+ platform presets, one-click background fill, and batch exports without writing this yourself, &lt;a href="https://www.imgsize.cc" rel="noopener noreferrer"&gt;imgsize&lt;/a&gt; runs the same client-side Canvas pipeline in the browser: no upload, no login, no watermark. You can try it at &lt;a href="https://www.imgsize.cc" rel="noopener noreferrer"&gt;https://www.imgsize.cc&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are building your own editor, the five-step pipeline above is the whole foundation — the rest is crop UI, preset metadata, and export options.&lt;/p&gt;

&lt;p&gt;What part of client-side image processing have you run into trouble with? Drop it in the comments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>The 8 Image Dimensions Every Creator Actually Needs (And How to Get Them in Seconds)</title>
      <dc:creator>gatekey</dc:creator>
      <pubDate>Mon, 26 Oct 2026 01:18:25 +0000</pubDate>
      <link>https://dev.to/gatekey/the-8-image-dimensions-every-creator-actually-needs-and-how-to-get-them-in-seconds-lh9</link>
      <guid>https://dev.to/gatekey/the-8-image-dimensions-every-creator-actually-needs-and-how-to-get-them-in-seconds-lh9</guid>
      <description>&lt;p&gt;Every creator knows the frustration: you finish a perfect photo, then realize Instagram wants 1080×1080, TikTok wants 1080×1920, LinkedIn wants 1200×627, and Amazon's main image has to be exactly 2000×2000 or your listing gets penalized.&lt;/p&gt;

&lt;p&gt;Instead of Googling each spec and opening an image editor every time, I keep a cheat sheet of the 8 dimensions I actually use. Here it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 8 image dimensions every creator needs
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Use case&lt;/th&gt;
&lt;th&gt;Size (px)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Instagram Post&lt;/td&gt;
&lt;td&gt;Feed post&lt;/td&gt;
&lt;td&gt;1080 × 1080&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instagram Story&lt;/td&gt;
&lt;td&gt;Story / Reel cover&lt;/td&gt;
&lt;td&gt;1080 × 1920&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TikTok&lt;/td&gt;
&lt;td&gt;Video thumbnail / cover&lt;/td&gt;
&lt;td&gt;1080 × 1920&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;YouTube Thumbnail&lt;/td&gt;
&lt;td&gt;Video thumbnail&lt;/td&gt;
&lt;td&gt;1280 × 720&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LinkedIn Post&lt;/td&gt;
&lt;td&gt;Article / feed image&lt;/td&gt;
&lt;td&gt;1200 × 627&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Facebook Cover&lt;/td&gt;
&lt;td&gt;Page cover photo&lt;/td&gt;
&lt;td&gt;1640 × 924&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amazon Main Image&lt;/td&gt;
&lt;td&gt;Product listing&lt;/td&gt;
&lt;td&gt;2000 × 2000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Etsy Listing&lt;/td&gt;
&lt;td&gt;Product photo&lt;/td&gt;
&lt;td&gt;2000 × 2000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are the specs that actually matter. Everything else is a variant you'll rarely need.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why resizing manually is a waste of time
&lt;/h2&gt;

&lt;p&gt;Open an editor → import the image → find the canvas settings → enter the new dimensions → drag the image to fit → export → repeat for the next platform.&lt;/p&gt;

&lt;p&gt;For one photo across five platforms, that's five separate exports. Multiply that by ten products a day, and you've just lost an hour.&lt;/p&gt;

&lt;h2&gt;
  
  
  The faster way: browser-only resizing
&lt;/h2&gt;

&lt;p&gt;I built &lt;a href="https://www.imgsize.cc" rel="noopener noreferrer"&gt;imgsize&lt;/a&gt; specifically for this workflow. It runs entirely in your browser — your photos never leave your device.&lt;/p&gt;

&lt;p&gt;Here's the 10-second process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://www.imgsize.cc" rel="noopener noreferrer"&gt;imgsize&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Pick the platform preset (Instagram, TikTok, LinkedIn, Amazon, Etsy, etc. — 70+ built in)&lt;/li&gt;
&lt;li&gt;Drop your image&lt;/li&gt;
&lt;li&gt;Download the perfectly sized result&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No upload. No login. No watermark. No waiting for a server to process your file.&lt;/p&gt;

&lt;p&gt;The best part: if you need the same image for multiple platforms, you can export them all in a ZIP — one drop, multiple exact sizes, done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop guessing dimensions
&lt;/h2&gt;

&lt;p&gt;Bookmark this post or save the &lt;a href="https://www.imgsize.cc" rel="noopener noreferrer"&gt;imgsize&lt;/a&gt; link next time you're about to publish. The goal isn't to learn every spec by heart — it's to stop caring about the math and just get the right output.&lt;/p&gt;

&lt;p&gt;What platform dimensions do you find yourself looking up most often? Drop it in the comments and I'll add it to the preset list.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Resize Images for Any Platform Without Uploading: A Browser-Only Guide</title>
      <dc:creator>gatekey</dc:creator>
      <pubDate>Fri, 23 Oct 2026 08:12:50 +0000</pubDate>
      <link>https://dev.to/gatekey/resize-images-for-any-platform-without-uploading-a-browser-only-guide-2hbi</link>
      <guid>https://dev.to/gatekey/resize-images-for-any-platform-without-uploading-a-browser-only-guide-2hbi</guid>
      <description>&lt;p&gt;Every creator knows the pain: each platform wants a different image size. Instagram 1080x1080, TikTok 1080x1920, Twitter 1600x900, YouTube 1280x720, LinkedIn 1200x627... Resizing one photo for five platforms usually means opening an editor, remembering each spec, and exporting five times. Worse, most online "resize" tools upload your image to a server first - which is slow, and a privacy concern if the photo isn't meant to leave your device.&lt;/p&gt;

&lt;p&gt;That's why I built &lt;a href="https://www.imgsize.cc" rel="noopener noreferrer"&gt;imgsize&lt;/a&gt;, a 100% browser-based image resizer. Your image never leaves your device. Pick a platform preset (70+ included), and it's resized instantly with the exact dimensions that platform wants.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why browser-only processing matters
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No uploads - your photos stay on your device. Great for personal documents, ID photos, or anything sensitive.&lt;/li&gt;
&lt;li&gt;No login, no signup - just open the page and resize.&lt;/li&gt;
&lt;li&gt;Fast - processing happens locally, so there's no waiting on a server round-trip.&lt;/li&gt;
&lt;li&gt;Works anywhere - desktop, tablet, phone; no install needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A quick example
&lt;/h2&gt;

&lt;p&gt;Say you need a cover for an Instagram post:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://www.imgsize.cc" rel="noopener noreferrer"&gt;imgsize&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Choose the &lt;strong&gt;Instagram Post&lt;/strong&gt; preset (1080x1080)&lt;/li&gt;
&lt;li&gt;Drop your image&lt;/li&gt;
&lt;li&gt;Download - done. Nothing was uploaded.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Under the hood
&lt;/h2&gt;

&lt;p&gt;It uses the browser's built-in canvas and image APIs, so everything runs client-side. No server, no tracking pixels, no file left behind.&lt;/p&gt;

&lt;p&gt;If you're a web developer, you might also like the approach: it's a nice example of doing image processing entirely in the browser with the Canvas API.&lt;/p&gt;

&lt;p&gt;Got a platform I'm missing? The preset list is always growing - let me know and I'll add it.&lt;/p&gt;

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