---
title: "Discussion on \"Compress a photo to an exact KB limit in the browser (and why \"under 20 KB\" isn't the only rule)\" | Hashnode"
description: "Discussion on \"Compress a photo to an exact KB limit in the browser (and why \"under 20 KB\" isn't the only rule)\". Binary-search the JPEG quality, shrink pixels only as a last resort, and respect the form's minimum too."
url: "https://hashnode.com/posts/compress-a-photo-to-an-exact-kb-limit-in-the-browser-and-why-under-20-kb-isn-t-the-only-rule/6af82ed7ceb9a51e114903dc"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Compress a photo to an exact KB limit in the browser (and why "under 20 KB" isn't the only rule)](https://beginthings.hashnode.dev/compress-a-photo-to-an-exact-kb-limit-in-the-browser-and-why-under-20-kb-isn-t-the-only-rule?utm_source=hashnode&utm_medium=feed)

Binary-search the JPEG quality, shrink pixels only as a last resort, and respect the form's minimum too.

4d ago · 6 min read · beginthings.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#images](https://hashnode.com/tag/images)
-   [#india](https://hashnode.com/tag/india)

## Written by

[Sourav Mahapatra](https://hashnode.com/@souravmahapatra)

@souravmahapatra

  
[View profile](https://hashnode.com/@souravmahapatra)

Building BeginThings.com — 100+ free tools for freelancers & solopreneurs. No login, no fluff.

Building BeginThings: 100+ free browser tools, and BeginRooms, a 3D workspace for client projects. India.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
