The objective of image compression is to reduce irrelevance and redundancy of the image data in order to be able to store or transmit data in an efficient form. Image compression may be lossy or lossless.
Questions tagged [image-compression]
816 questions
90
votes
13 answers
Is it possible to tell the quality level of a JPEG?
This is really a two part question, since I don't fully understand how these things work just yet:
My situation: I'm writing a web app which lets the user upload an image. My app then resizes to something displayable (eg: 640x480-ish) and saves the…

nickf
- 537,072
- 198
- 649
- 721
71
votes
3 answers
Image Compression tools via command line
I'm searching best tool to compress images (png and jpeg) via command line.
After googling I found trimage which is good as it compresses both png and jepeg, but compression ratio is very poor in this case.
I came across jpeg-optimizer.com…

Mukesh Yadav
- 2,256
- 2
- 33
- 51
60
votes
5 answers
Setting jpg compression level with ImageIO in Java
I'm using javax.imageio.ImageIO to save a BufferedImage as a jpeg file.
In particular, I created the following Java function:
public static void getScreenShot(BufferedImage capture, Path folder, String filename) {
try {
…

mat_boy
- 12,998
- 22
- 72
- 116
43
votes
13 answers
How to compress image size?
I want to capture image in low resolution using android camera api but when I captured image it will take default resolution of device camera.So I want to capture image in low resolution or small size at time of capture or how can I compress big…

Nitish Patel
- 1,026
- 2
- 19
- 36
36
votes
3 answers
Reduce the size of a bitmap to a specified size in Android
I want to reduce the size of a bitmap to 200kb exactly. I get an image from the sdcard, compress it and save it to the sdcard again with a different name into a different directory. Compression works fine (3 mb like image is compressed to around 100…

TharakaNirmana
- 10,237
- 8
- 50
- 69
30
votes
17 answers
Code Golf: 1x1 black pixel
Recently, I used my favorite image editor to make a 1x1 black pixel (which can come in handy when you want to draw solid boxes in HTML cheaply). Even though I made it a monochrome PNG, it came out to be 120 bytes! I mean, that's kind of steep. …

Joey Adams
- 41,996
- 18
- 86
- 115
26
votes
3 answers
How to compress Bitmap as JPEG with least quality loss on Android?
This is not a straightforward problem, please read through!
I want to manipulate a JPEG file and save it again as JPEG. The problem is that even without manipulation there's significant (visible) quality loss.
Question: what option or API am I…

TWiStErRob
- 44,762
- 26
- 170
- 254
25
votes
4 answers
How can I compress images using java?
From pagespeed I am getting only image link and possible optimizations in bytes & percentage like,
Compressing and resizing https://example.com/…ts/xyz.jpg?036861 could save 212KiB (51% reduction).
Compressing…

Darshit Patel
- 700
- 1
- 6
- 16
24
votes
9 answers
How to save an image with a specific filesize?
I am building a PHP system whereby users can create a visually complex image that has the final requirement of being 50kB or less.
The user can select to have text printed onto one of 37 template images, so the result is a single flat image.
The…

Jess Telford
- 12,880
- 8
- 42
- 51
22
votes
2 answers
How to compress the image using gifsicle tool or any other tool on ubuntu
I have some images in .GIF format which i want to compress. But i am getting the output either same or hardly 2-5% compression.I need higher compression ratio so that the web pages can be loaded fastly. Currently i am using the gifsicle tool but…

anand
- 1,711
- 2
- 24
- 59
20
votes
2 answers
JPG vs compressed JPG vs WEBP - why WEBP isn't the smallest one?
I have this image (photo taken by me on SGS 9 plus): Uncompressed JPG image. Its size is 4032 x 3024 and its weight is around 3MB. I compressed it with TinyJPG Compressor and its weight was 1.3MB. For PNG images I used Online-Convert and I saw webp…

Radek Anuszewski
- 1,812
- 8
- 34
- 62
20
votes
3 answers
Compress image using sharp in node.js
I want to resize and compress images using sharp in node.js
In sharp for jpeg there is separate compression and for webp there is separate and for png there is separate.
WEBP
sharp('a.jpg')
.resize(1000)
.webp({quality: 80})
JPEG
sharp('_4_.jpg')
…

Haseeb Ahmad
- 7,914
- 12
- 55
- 133
19
votes
2 answers
Am I creating lossless PNG images?
I am doing image processing in a scientific context. Whenever I need to save an image to the hard drive, I want to be able to reopen it at a later time and get exactly the data that I had before saving it. I exclusively use the PNG format, having…

smcs
- 1,772
- 3
- 18
- 48
19
votes
5 answers
Compare source image against a bank of known images
I am building an App for a parent of a friend of mine that sadly had a stroke and can no longer talk, read or spell. He can however draw rather detailed drawings.
I have currently built an App that can process an image of a drawing and detect basic…

Ste Prescott
- 1,789
- 2
- 22
- 43
18
votes
1 answer
An Image Compression tool for windows similar to ImageOptim (of mac)
I was looking for a image compression tool for windows(Windows 7, more specifically), similar to ImageOptim (of mac). I've used few jpeg compressors tools in windows but they aren't giving the desired result. Yes, they compress the size but the…

JayKandari
- 1,228
- 4
- 16
- 33