<?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: xiaomei Lu</title>
    <description>The latest articles on DEV Community by xiaomei Lu (@xiaomei_lu_85e416d898252c).</description>
    <link>https://dev.to/xiaomei_lu_85e416d898252c</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3963957%2Fbbe6bd2d-0a4d-4ccd-b653-fe4ac83cb879.png</url>
      <title>DEV Community: xiaomei Lu</title>
      <link>https://dev.to/xiaomei_lu_85e416d898252c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xiaomei_lu_85e416d898252c"/>
    <language>en</language>
    <item>
      <title>Getting images actually web-ready: compress, resize, and pick the right format without opening an editor</title>
      <dc:creator>xiaomei Lu</dc:creator>
      <pubDate>Sun, 07 Jun 2026 16:23:18 +0000</pubDate>
      <link>https://dev.to/xiaomei_lu_85e416d898252c/getting-images-actually-web-ready-compress-resize-and-pick-the-right-format-without-opening-an-o24</link>
      <guid>https://dev.to/xiaomei_lu_85e416d898252c/getting-images-actually-web-ready-compress-resize-and-pick-the-right-format-without-opening-an-o24</guid>
      <description>&lt;p&gt;A surprising amount of "my site is slow" comes down to one thing: someone dropped a 4032x3024 photo straight off their phone into a content block that renders at 800px wide. The browser downloads all 5 MB and then throws most of it away during resize. Multiply that by a dozen images and you've got a page that takes 8 seconds on a hotel wifi.&lt;/p&gt;

&lt;p&gt;Getting an image "web-ready" is really three decisions made in order: &lt;strong&gt;resize first, then choose a format, then compress.&lt;/strong&gt; Do them in that order and you usually cut file size by 80-95% with no visible quality loss. Here's how to actually do it, with the numbers that matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Resize to the size it's displayed at (this is the big win)
&lt;/h2&gt;

&lt;p&gt;This is the step people skip, and it's the one that matters most. Pixels you can't see still cost bytes.&lt;/p&gt;

&lt;p&gt;Figure out the largest size the image is ever shown at, then add a buffer for high-DPI screens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Full-width hero on a normal layout:&lt;/strong&gt; cap at ~1920px wide. Even 4K monitors rarely render a content image wider than that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blog post inline image / content column:&lt;/strong&gt; the column is usually 700-800px, so export at &lt;strong&gt;1600px&lt;/strong&gt; (2x for retina) and let CSS scale it down.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thumbnail / avatar / card image:&lt;/strong&gt; displayed at 200px? Export at &lt;strong&gt;400px&lt;/strong&gt;. No more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Icons and logos:&lt;/strong&gt; if it's flat/geometric, this should be an SVG, not a raster image at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The math is brutal in your favor here. A 4000x3000 image is 12 million pixels. Resized to 1600x1200 it's 1.9 million pixels — &lt;strong&gt;84% gone&lt;/strong&gt; before you've compressed anything. Resizing from 4000px to 1600px usually takes a 5 MB JPEG down to roughly 600-900 KB on its own.&lt;/p&gt;

&lt;p&gt;Quick rule: if the longest edge of your file is bigger than 2000px and it's not a print asset or a zoomable gallery image, it's too big.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Pick the right format
&lt;/h2&gt;

&lt;p&gt;Format choice is mostly about what's &lt;em&gt;in&lt;/em&gt; the image:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Photographs / complex gradients → JPEG or WebP.&lt;/strong&gt; Lots of color, no hard edges, no transparency. JPEG is universally supported; WebP is ~25-35% smaller at the same quality and supported by every browser shipped in the last 5+ years.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screenshots, UI, text, line art, anything with sharp edges → PNG or WebP (lossless).&lt;/strong&gt; JPEG turns crisp edges into a smeary mess of artifacts. This is the #1 format mistake — saving a screenshot of code as a JPEG.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Needs transparency → PNG or WebP.&lt;/strong&gt; JPEG has no alpha channel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AVIF&lt;/strong&gt; is the smallest of all (often 20% under WebP) but it's slower to encode and a bit fussier; great for hero images where the savings are worth it, overkill for thumbnails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Honest default for 2026: &lt;strong&gt;WebP for almost everything&lt;/strong&gt;, with a JPEG fallback only if you're targeting truly ancient clients. If you don't want to think about it, JPEG for photos and PNG for screenshots is still perfectly fine and will never surprise you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Compress with a target quality, not "maximum"
&lt;/h2&gt;

&lt;p&gt;For lossy formats (JPEG/WebP/AVIF), quality is a 0-100 dial, and the sweet spot is lower than people expect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quality 80-85&lt;/strong&gt; is the standard "looks identical, much smaller" zone for photos. Start here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quality 70-75&lt;/strong&gt; is fine for thumbnails and background images where nobody's pixel-peeping.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Above 90&lt;/strong&gt; you're mostly adding bytes you can't see. Below 60 you start to notice blocking in skies and skin tones.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A typical 1600px photo at quality 82 lands around &lt;strong&gt;120-200 KB&lt;/strong&gt;. That's the target to aim for on a content image. If you're well above 300 KB after resizing, your quality setting is too high or the format is wrong for the content.&lt;/p&gt;

&lt;p&gt;For PNG screenshots, "quality" works differently — you reduce the color palette (e.g. down to 256 colors) and run lossless optimization. A flat UI screenshot can drop 60-70% with palette reduction and look identical.&lt;/p&gt;

&lt;h2&gt;
  
  
  Doing it without installing anything
&lt;/h2&gt;

&lt;p&gt;If you live in the terminal, the local CLI tools are excellent and worth knowing — they're scriptable, run offline, and keep files on your machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ImageMagick:&lt;/strong&gt; &lt;code&gt;magick input.jpg -resize 1600x -quality 82 output.jpg&lt;/code&gt; does resize + compress in one shot. &lt;code&gt;mogrify&lt;/code&gt; batches a whole folder.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cwebp:&lt;/strong&gt; &lt;code&gt;cwebp -q 80 input.png -o output.webp&lt;/code&gt; for WebP conversion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sharp&lt;/strong&gt; (Node) or &lt;strong&gt;Pillow&lt;/strong&gt; (Python) if you want this baked into a build step or an upload pipeline. This is the right answer for anything recurring.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;squoosh-cli&lt;/strong&gt; wraps the same encoders Squoosh uses, good for AVIF.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If it's a one-off, or you're on a machine where you can't install things, or you just don't want to remember ImageMagick's flag soup, a browser tool is faster. Web options worth knowing: &lt;strong&gt;Squoosh&lt;/strong&gt; (Google's, the gold standard for fiddling with one image and watching the quality slider in real time, fully client-side), &lt;strong&gt;TinyPNG&lt;/strong&gt; (dead simple, great auto-compression, but free tier caps file size and count), and &lt;strong&gt;Photopea&lt;/strong&gt; if you also need to actually edit.&lt;/p&gt;

&lt;p&gt;For the plain resize-then-compress run I described above, I usually point people at the image tools on &lt;a href="https://bestaifinds.com/image/compress" rel="noopener noreferrer"&gt;BestAIFinds&lt;/a&gt; — full disclosure, I help build that one, so weigh that accordingly. There's a compress tool, a separate resize tool, and format conversion, all free with no sign-up or watermark, and uploads auto-delete within about an hour. Squoosh is genuinely better if you want to manually tune one image with a live preview, so use that when you care about a single hero shot. For batching a folder, honestly just use ImageMagick.&lt;/p&gt;

&lt;h2&gt;
  
  
  The privacy caveat you should actually think about
&lt;/h2&gt;

&lt;p&gt;Any browser tool that uploads to a server means your image touches someone else's machine, even if it's deleted an hour later. For a marketing photo or a screenshot of public docs, who cares. For anything with PII, internal dashboards, unreleased product shots, medical or legal material — &lt;strong&gt;use a local CLI or a fully client-side tool&lt;/strong&gt; (Squoosh and ImageMagick never send your file anywhere). This isn't paranoia, it's just matching the tool to the sensitivity of the file. Read whether a tool processes in-browser or server-side before you paste in something confidential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it together
&lt;/h2&gt;

&lt;p&gt;The whole workflow for a typical content image:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Resize&lt;/strong&gt; longest edge to ~1600px (or 2x your display size). Biggest single saving.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pick format:&lt;/strong&gt; WebP or JPEG for photos, PNG/WebP for screenshots and UI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compress&lt;/strong&gt; to quality ~82 for photos, ~75 for thumbnails. Aim for under ~200 KB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sanity-check&lt;/strong&gt; the output actually looks fine at the size it'll be shown, not zoomed to 400%.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do those four things and a page that was shipping 6 MB of images ships maybe 600 KB, with no visible difference. Your Lighthouse score, your mobile users, and your bandwidth bill all thank you.&lt;/p&gt;

&lt;p&gt;What's your default quality setting and format these days — has WebP fully replaced JPEG in your workflow, or are you still shipping JPEG fallbacks? Curious what edge cases are keeping people on the old formats. Drop a comment.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>performance</category>
      <category>images</category>
      <category>webperf</category>
    </item>
    <item>
      <title>Free browser tools for the boring file tasks every dev runs into</title>
      <dc:creator>xiaomei Lu</dc:creator>
      <pubDate>Tue, 02 Jun 2026 07:02:55 +0000</pubDate>
      <link>https://dev.to/xiaomei_lu_85e416d898252c/free-browser-tools-for-the-boring-file-tasks-every-dev-runs-into-3df1</link>
      <guid>https://dev.to/xiaomei_lu_85e416d898252c/free-browser-tools-for-the-boring-file-tasks-every-dev-runs-into-3df1</guid>
      <description>&lt;p&gt;Every few days I hit some small file chore that has nothing to do with the actual work: a PDF too big to email, a screenshot that needs a transparent background, a CSV someone wants as JSON. None of it is hard. It's just annoying enough to break my flow, and the first Google result is usually a desktop app that wants an install and an account before it'll do a 5-second job.&lt;/p&gt;

&lt;p&gt;Over time I've collected a set of browser-based tools that handle this stuff without any of that friction. Here's the practical roundup, with concrete steps for the tasks that come up most.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compress a PDF before emailing it
&lt;/h2&gt;

&lt;p&gt;Mail servers commonly reject attachments over ~10-25 MB, and exported PDFs (especially anything with images or scans) blow past that fast.&lt;/p&gt;

&lt;p&gt;The steps are basically the same everywhere:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a PDF compressor in your browser.&lt;/li&gt;
&lt;li&gt;Drag the file in.&lt;/li&gt;
&lt;li&gt;Pick a compression level — "medium" is usually the sweet spot between size and readable text.&lt;/li&gt;
&lt;li&gt;Download and check it still looks fine before you send.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The thing to watch: heavy compression can soften scanned text or photos. Always eyeball the output. If it's a contract or anything someone has to read carefully, stay on the lighter setting.&lt;/p&gt;

&lt;p&gt;Tools I've used for this: &lt;strong&gt;Smallpdf&lt;/strong&gt;, &lt;strong&gt;PDF24&lt;/strong&gt;, and &lt;a href="https://bestaifinds.com/pdf/compress" rel="noopener noreferrer"&gt;BestAIFinds&lt;/a&gt; (full disclosure, I help run that last one). All three do the same core job in the browser. PDF24 is nice because it's genuinely no-account; Smallpdf has a free tier with daily limits. The one I help with is free with no sign-up and no watermark, and it auto-deletes uploads within about an hour — but honestly, for a one-off, grab whatever tab is already open.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remove an image background
&lt;/h2&gt;

&lt;p&gt;This used to mean opening an editor and masking by hand. Now an automatic remover gets you 90% of the way in one click — great for product shots, profile pictures, or dropping a logo onto a slide.&lt;/p&gt;

&lt;p&gt;How it goes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload the image (PNG/JPG).&lt;/li&gt;
&lt;li&gt;Let it auto-detect the subject.&lt;/li&gt;
&lt;li&gt;Download as a transparent PNG.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It struggles with fine detail — wispy hair, glass, motion blur. For those, &lt;strong&gt;Photopea&lt;/strong&gt; is worth knowing about: it's a free, in-browser Photoshop clone where you can clean up edges manually with the same keyboard muscle memory. For the quick automatic version I'll use an in-browser remover like the one on &lt;a href="https://bestaifinds.com/image/remove-bg" rel="noopener noreferrer"&gt;BestAIFinds&lt;/a&gt;, but the workflow is identical across tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Convert formats without a round-trip
&lt;/h2&gt;

&lt;p&gt;The two that come up constantly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PDF to Word&lt;/strong&gt; when you need to edit text in a doc someone "helpfully" sent as a PDF. Formatting is the hard part — tables and columns are where converters fall apart. Run it, then spend two minutes fixing layout rather than expecting it to be perfect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSV / Excel / JSON / XML&lt;/strong&gt; when you're moving data between a spreadsheet and something that speaks JSON. For small files a browser converter is faster than writing a one-off script; for anything large or repeatable, just use &lt;code&gt;pandas&lt;/code&gt; or &lt;code&gt;jq&lt;/code&gt; and move on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;iLovePDF&lt;/strong&gt; and &lt;strong&gt;Smallpdf&lt;/strong&gt; both cover the PDF conversions well. I'll often reach for whatever's already open in a tab.&lt;/p&gt;

&lt;h2&gt;
  
  
  A few honest caveats
&lt;/h2&gt;

&lt;p&gt;Browser tools are great, but know their limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; anything you upload leaves your machine. Don't put confidential contracts, customer data, or anything under NDA through a random web tool. Check the deletion policy first — some auto-delete uploads within an hour, some are vaguer about it. For sensitive files, prefer a local CLI (&lt;code&gt;qpdf&lt;/code&gt;, &lt;code&gt;ghostscript&lt;/code&gt;, &lt;code&gt;ImageMagick&lt;/code&gt;, &lt;code&gt;ffmpeg&lt;/code&gt;) that never sends bytes anywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scriptability:&lt;/strong&gt; if a task repeats, automate it. A web UI is for one-offs; for the tenth time, write the script.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free tiers:&lt;/strong&gt; "free" sometimes means a couple of files a day or a watermark. Read before you rely on it for a deadline.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A quick reference list
&lt;/h2&gt;

&lt;p&gt;Tasks → what I tend to grab:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PDF too big to email → any browser compressor, "medium" level, eyeball the result&lt;/li&gt;
&lt;li&gt;PDF → editable text → a PDF-to-Word converter, then fix tables by hand&lt;/li&gt;
&lt;li&gt;Transparent background → automatic remover for speed, Photopea for fiddly edges&lt;/li&gt;
&lt;li&gt;Spreadsheet ↔ JSON → browser converter for small one-offs, &lt;code&gt;pandas&lt;/code&gt;/&lt;code&gt;jq&lt;/code&gt; for real pipelines&lt;/li&gt;
&lt;li&gt;Compress/convert video → an in-browser video tool for short clips, &lt;code&gt;ffmpeg&lt;/code&gt; for batches&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sign-off
&lt;/h2&gt;

&lt;p&gt;There's no magic here — these are all variations on "upload, click, download." The point is just to not lose 20 minutes installing software for a job that takes seconds. Keep a couple of these bookmarked, keep a local CLI around for anything private or repeatable, and you'll rarely get stuck.&lt;/p&gt;

&lt;p&gt;If you've got a go-to tool I didn't mention, drop it in the comments — I'm always swapping mine out.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>tools</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
