How to Compress and Resize Images for the Web Without Uploading Files to External Servers
Author : lio bartfort | Published On : 02 Dec 2026
A web browser can be used to compress images to 100KB by analysing and manipulating images via a computer using HTML5 Canvas and JavaScript. Optimising the image resolution and applying a lossy compression level in either the WebP or JPEG image format allows for highly accurate file sizes to be achieved for example for government documents (20KB) and portfolios (up to 2MB).
Typically, online image compression sites analyse images by first uploading them to another server in the cloud. Whilst this is acceptable for non-sensitive images (for instance, scanned passports, ID cards, design samples and pre-release products), it does however introduce avoidable security concerns by exposing images to untrusted third party servers.
Browser-based optimisation avoids these issues. All image manipulation takes place within the browser. No files ever leave a computer or smart phone. Manipulation occurs in milliseconds and there is no delay due to a connection to the internet. Furthermore, you maintain full control over the image quality and resolution.
Why Does Client-Side Image Optimization Matter for Privacy and Speed?
Unlike conventional online tools, browser-based optimisation analyses and manipulates images on your computer. As there is no data sent to a server, your files remain solely on your computer. Furthermore, there is no waiting time for files to be uploaded and analysed.
Conventional tools work as follows:
-
User selects an image.
-
Computer browser then sends the original (often 5-15MB) image to an offsite server for analysis.
-
Server applies image compression and temporarily holds the compressed version.
-
User downloads the compressed image.
Browser-based compression sees the mathematics undertaken during optimisation occur on your own computer, utilising your computer’s CPU and RAM. As a result, it offers the following benefits:
-
Zero Data Exposure: Sensitive information such as identification, healthcare documents and intellectual property is not exposed to external servers.
-
Instant Processing: Even if you are on a slow mobile internet connection or have no connection at all, browser-based compression can rapidly analyse and manipulate megabyte-sized images.
-
No Artificial Queue or Daily Caps: As the server is not being charged for analysing user files, browser-based image compressors such as ToolFlora’s Image Compressor and Image Resizer are free to use and have no subscription requirement or watermark.
Should You Resize or Compress First?
Always resize then compress. Decreasing the resolution of an image (for example to 800px/1200px – the actual width that an image will be displayed at) instantly removes superfluous pixels. This enables greater image quality to be maintained, even after compression and within strict file size requirements.
However, attempting to solely compress a large 12megapixel image down to 50KB causes the compression programme to excessively compromise image quality. This can lead to a ‘pixelated’ effect and blurred text.
Therefore, optimise by initially resizing and then compressing your image as follows:
-
Step 1 — Resize dimensions first: Reduce the resolution (both the image height and width) to that at which the image will be displayed. Optimally, this can reduce file size by up to 85%.
-
Step 2 — Pick the right output format: Changing an image to either WebP or JPEG switches the file type and so alters the compression method. Usually, WebP files are 25-35% smaller in size than JPEGs, for the same level of image quality.
-
Step 3 — Fine-tune compression quality: Manipulate the quality scale (typically from 1-100%) so that the correct file size is achieved. Crucially, important image border detail should not be compromised in the process.
How to Compress Images to Exact File Size Targets (20KB to 2MB)
Ensure that the appropriate resolution and quality are selected to attain the required file size, without compromising image quality.
Small Form & Portal Targets (20KB, 30KB, and 40KB)
-
20KB (compress image to 20kb online): scanning signatures and/or using as a small photo such as an avatar. Also good for detailed reports. Ideally 200 x 200px or 300 x 100px. Save as either JPEG or WebP. Initially set the image quality to around 45-60%.
-
30KB (compress image to 30kb online): Good for Government and personal profile photos. Ideally 300 x 300px or 400 x 400px. Save as either JPEG or WebP. Initially set the image quality to around 55-65%.
-
40KB (compress image to 40kb online): Ideal for documents which require photographic verification such as passports and ID. Also good for small blog photos. Ideally 400 x 500px or 600 x 400px. Save as JPEG. Initially set the image quality to around 60-70%.
Everyday Web & Portfolio Targets (50KB, 100KB, 1MB, and 2MB)
-
50KB (compress image to 50kb online): job board and/or product pages. Ideally 600 x 600px or 800 x 600px. Save as either WebP or JPEG. Initially set the image quality to around 65-75%.
-
100KB (compress image to 100kb online):Well suited for general blog photos. Also good for email and CMS uploads. Ideally 800 x 600px or 1200 x 800px. Save as WebP (or JPEG). Initially set the image quality to around 70-80%.
-
1MB (compress image to 1mb online): Great for a web page magazine style header and HD photo slideshows. Ideally 1920 x 1080px. Save as either WebP or JPEG. Initially set the image quality to around 80-85%.
-
2MB (compress image to 2mb online): Good for photographic portfolios. Also good for HD electronic proofs. Ideally 2500 x 1667px or 3000 x 2000px. Save as either JPEG or WebP. Initially set the image quality to around 85-92%.
Practical Tips for Extreme Targets (20KB, 30KB, and 40KB)
-
Crop tight margins: When for instance, scanning a signature or passport, trim the photo so that extra image surround is not unnecessarily consuming space.
-
Choose JPEG for government portals: Despite WebP offering a smaller file size, many Government job board sites currently only accept .jpg or .jpeg files.
-
Avoid PNG for photographs: As this is a lossless image file type, even a fairly small photo (such as 500 x 500px) can easily exceed 300KB. Convert photos to JPEG or WebP to avoid this.
Step-by-Step: How to Resize and Compress Images Locally in Your Browser
Follow these steps to effectively browser-based resize and compress any image including JPEG, PNG, WebP, GIF and BMP:
-
Resize: Open a browser-based image resizer for example ToolFlora’s Image Resizer. Upload your image to the browser. Ensure that the ‘Lock Aspect Ratio’ function is activated to stop distortion. Then input the desired image width (for example 800px for blog images or 300px for document submissions). Download the resized image.
-
Compress: Open ToolFlora’s Image Compressor and drag your resized image into the designated area.
-
Choose File Type: For website and blog use, select WebP for optimal Core Web Vitals speed. However, JPEG should be selected for cross-platform compatibility with email and submission forms.
-
Change Quality Level: Initially select approximately 75% quality. Observe the file size figure shown. To compress images online to 100KB or less (for example 50KB or 20KB), progressively lower the quality setting until the file size is comfortably within your required range.
-
Review and Download: Analyse the compressed image to ensure that text is clearly visible and borders are crisply defined. Finally, download the optimised image to your computer.
Which Image Format Should You Choose: JPEG, PNG, or WebP?
Use WebP for contemporary websites. Employ JPEG for cross-platform compatibility for both forms and emails. Utilise PNG only where transparent backgrounds or crisp vector graphics and/or screen shots are required.
-
WebP: Supports lossy and lossless compression and also allows for transparency. It typically provides files which are 25-35% smaller than JPEGs for equal image quality. Thus, it is the most favourable option in relation to both SEO and speed.
-
JPEG (JPG): Optimal for images and for coloured gradients. It is also the most universally compatible file type for older computer programmes, government sites and email. However, it does not permit transparency.
-
PNG: Excellent for company logos, computer interface and schematic screen shots as it provides very clear text. Unfortunately, as it is lossless, PNG files are generally considerably larger in size than both JPEG and WebP, particularly for actual photographs.
Frequently Asked Questions
How can I be sure that an online image compression site does not upload my images?
In just 2 seconds, you can test whether a site is browser-based. Simply view the relevant page within your browser and then disable your Wi-Fi or activate Airplane Mode. Subsequently, compress an image. As genuine browser-based compression operates on your own computer, it will continue to resize and compress your files, even without an internet connection.
How can I compress an image online to 100KB, and still retain good image quality?
Firstly, resize an image to between 800px and 1200px in width. Then, save it in either WebP or JPEG format. Set the quality level to approximately 70-80%. As reducing the image resolution effectively removes unnecessary data, there is no need for the compression programme to drastically blur an image in order to achieve a file size of under 100KB.
Why is my compressed image still larger than 50KB or 20KB?
Should altering the quality level fail to reduce your image file to beneath 50KB or 20KB, then either the resolution is still too great or the file has been saved in PNG format. Firstly, change the file type to JPEG. Secondly, resize the image (for example to 300-500 pixels in both height and width). Finally, re-compress the image.
Will compressing images boost a website’s SEO?
Yes. Lower file sizes decrease overall page file size. This directly enhances a site’s Largest Contentful Paint (LCP) score – one of the key factors that Google uses to rank websites as part of its Core Web Vitals metrics. In addition, faster websites also help to minimise mobile site exit rates.
Ready to Optimize Your Images Privately?
Effectively resize and compress files without having to register for an account or expose private images to external servers. Firstly, use ToolFlora’s free Image Resizer to accurately define image resolutions. Secondly, utilise the Image Compressor to precisely determine file sizes.
Watch How to Use the Image Compressor - Shrink JPG, PNG & WebP Photos to see in just 5 stages how ToolFlora’s browser-based image compressor can locally compress an 8.32 MB image to 955 KB.
