Time to be with your loved ones

Time to be with loved ones

by sat

submit your photo

Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

There are numerous applications for reducing filesize. Most of them reduce resolution (e.g. from 300dpi to 72dpi) or reduce height and width. I tried http://www.imageoptimizer.net/

Surprisingly, when uploading a small file (optimized for web) with 72dpi resolution, it will produce an image of the same size and 92dpi resolution, but the file size has been reduced to 50%. How does it work?

It should not be simple compression, as compression (which is also accompanied by quality loss) reduces the file size by 10%.

share|improve this question
Hi Ali, welcome to the site. While I think there may (though iffy) be people here that can answer that question, it's not really a photography question. It's about software algorithms and is probably better answered on other Stack sites. –  John Cavan Oct 22 '11 at 17:49
@JohnCavan You are quite right, I doubted to ask the question here, but I thought photographers regularly use graphic softwares like photoshop and are deeply involved in image resolution issues. I will delete this question. –  All Oct 22 '11 at 18:13
do not delete this question, look at my answer below and you will know how important this is to photographer –  Gapton Oct 28 '11 at 15:02
add comment

5 Answers

PNG compression quality varies greatly from compressor to compressor. The standard PNG compression in Photoshop for example can sometimes commonly be beat by large percentage points. This is primarily due to more intelligent switching algorithms when it picks the kind of prediction to do for a certain set of pixels. Most of the "additional" compression is achieved in that way, but there is also a certain set of specialty tools out there which will also just do a plain old better entropy encoding of the data (through reverse compression, sounds funny but works very well). That is probably more technical of an answer than you were looking for though.

JPG can be compressed better by better compressors as well while achieving the same or nearly the same quality. This usually works by finding optimal tuning numbers for internal quality settings and doing automatic comparisons with the original photo. In this way you can reduce quality without it being entirely noticeable. AFAIK, this is how google's tools work for web image optimization for example.

Its a very large topic. Feel free to ask a question and I'll do my best to answer.

share|improve this answer
add comment

The DPI reported in a JPEG file is just a metadata field. That is, it's intended to offer a hint to software that displays or prints image files, but it's not immutable, in practice it's not authoritative or enforced, and it's usually ignored by most software and photographers alike. The actual DPI of a displayed image is determined by the absolute resolution (the number of pixels) divided by the actual size (inches).

The http://www.imageoptimizer.net/ tool mainly reduces the quality level of the JPEG file you upload to it. That is, it decodes the JPEG you send it and re-encodes it, throwing away even more information than the original JPEG encoding did.

If you feed it a high-quality JPEG and examine the original and "optimized" images side-by-side, you will see that the "optimized" version has less fine detail and more JPEG artifacts. You can achieve similar results by adjusting the JPEG quality settings in your image editing software.

share|improve this answer
add comment

Besides the algorithms described in other answers, small images' file sizes can be reduced by stripping out metadata from the file. EXIF/IPTC data can add up to 64 kilobytes to a JPEG image.

share|improve this answer
add comment

Firstly, DPI really isn't a unit of resolution, but one of dot density. For example, you can have a 300x300 pixel image and print it at 300dpi for a 1 inch x 1 inch print, or you can print it out at 100dpi for 3 inch x 3 inch output. In both of these cases, the image's resolution (300x300 pixels) remains the same.

As for compression: The most common compression algorithm for photos, JPEG, reduces file size by throwing out image data in a way that will impact output quality the least. This is know as a "lossy" algorithm. There are "lossless" algorithms, such as GIF or PNG, that reduce a image's final file size by indexing linear sequences of a uniform color. However, photos tend not to have too many patches of uniform color, so these algorithms aren't typically as effective.

WebReference has a dated, but still good tutorial on Optimizing Web Graphics that provides a nice overview of image compression.

share|improve this answer
This is actually incorrect for PNG. PNG compresses gradients in an image through color prediction schemes (DPCM). In this way, PNG can typically do far better compression than GIF and can compress for a most images - and certainly can still compress images without patches of uniform color fairly well. –  Jon Oct 22 '11 at 19:45
GIF isn't very sophisticated, but it usually uses LZW rather than RLE as described.... –  mattdm Oct 22 '11 at 23:26
The paragraph about resolution is spot-on, though. –  mattdm Oct 22 '11 at 23:27
add comment

I am a computer scientist and photography is my hobby.

All the answers provided information of "traditional" compression algorithm. I should point out that there is a new algorithm that can shrink a JPEG 4x to 6x in file size without losing quality. This new compression method is specifically designed to shrink JPEG photographs.

This means that photographers now can save as much as 6 times the storage space required for their photos archives. That's why I feel this new algorithm is highly related to photography and should be brought to photographers' attention.

The technical bit, traditional JPEG compression sample across the entire photograph and apply the same "level of quality" across the photograph. The new algorithm works in the same way, but it can assign different "level of quality" to different area of the photo.

Simply put, it cuts the photo in many pieces, and saves the blurry, out of focus pieces in very low quality, and saves the sharp and colourful pieces in high quality. It is aware of the content of the photograph.

This is a bit like "variable bitrate" in audio compression.

Their website has a demo, I have used it and I stared at the two photos for minutes and can't distinguish them.

See the following techcrunch post for more details and their website: http://techcrunch.com/2011/09/06/new-startup-jpegmini-reduces-photos-size-not-their-quality/

share|improve this answer
I think jpegmini is pretty well debunked in this post. While there are some cases where it can work, I don't think it's the magic that you're claiming. (Even the Techcrunch article you link to is more reasonable.) –  mattdm Sep 6 '12 at 2:31
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.