10
\$\begingroup\$

I am working on a project where two my images must be AS SMALL AS POSSIBLE. I have scaled two images to the same dimensions/dpi and I've checked the color profile in Photoshop CS6 and they both look the same. They were both saved out at the same JPEG compression.

Can someone please explain to me how these two images ended up being such drastically different sizes? The dog one is 97 KB and the bunny one is 576 KB.

enter image description here

enter image description here

So after following the suggestion I changed the embedded color profiles of both of the above images and they are now nearly the same file size. However, I have two more that do have the same embedded color profile and again, these are drastically different sizes. Can you explain why?

enter image description here

enter image description here

\$\endgroup\$
1
  • 1
    \$\begingroup\$ if you can quantify "small" (you must have some specification you are working towards) and what the purpose is, then you might receive some more file size optimization methods. \$\endgroup\$
    – horatio
    Commented Oct 10, 2012 at 20:16

4 Answers 4

13
\$\begingroup\$

The first two images both have embedded color profiles. The smaller one has Adobe RGB, and the larger one has "TIFF RGB", which happens to consume more space.

My guess is you probably want these to be sRGB anyway, with no embedded color profile.

In the second case, it's the details. The hand photograph has big areas of the same color, a lot of blur, and very many sharp lines. That's ideal for compression. The bikes and trees are full of contrast and intricate detail. That's much harder to compress.

Try running a strong gaussian blur over the second image and watch how it shrinks when you save it. That doesn't solve your problem, but should make clear what's happening.

\$\endgroup\$
2
  • \$\begingroup\$ How can you check a picture for embedded color profiles? \$\endgroup\$ Commented Nov 7, 2019 at 14:57
  • \$\begingroup\$ There are several ways, but perhaps the easiest is: open them up in Gimp and it'll tell you and ask if you want to convert to srgb. \$\endgroup\$
    – mattdm
    Commented Nov 7, 2019 at 16:09
7
\$\begingroup\$

Two images with the same dimensions contain the same amount of data but not necessarily the same amount of information. A pure white image contains virtually no information and can be compressed into a very small space (it is sufficient to store only the height and width in order to fully recreate this image).

Scenes with a lot of detail contain a lot of information and so will require more storage space, this is unavoidable. However noise is like information which is meaningless, if you can reduce noise, it will reduce the filesize without compromising the image content.

\$\endgroup\$
1
  • \$\begingroup\$ +1: I love theories about how much information does some data carries... I suggest "Kolmogorov theory" to help understanding that... \$\endgroup\$ Commented Oct 11, 2012 at 21:03
4
\$\begingroup\$

JPEG compression says how much details to throw away, not how much to keep.

With the same amount of details thrown away, two different images will be left with different amount of details. The storage is generally proportional to the amount of details left in the image after compression.

In your second set, the second image clearly has more details. This should be obvious compared to the first one which has huge expanses of uniform color which compress much better.

On some cameras you can choose to compress images to a certain quality OR a certain size. When an image contains more details it loses more details when compressed to a certain size, so this is desirable only if storage is limited.

\$\endgroup\$
6
  • \$\begingroup\$ So, can I do anything else to reduce the file size? \$\endgroup\$
    – daveMac
    Commented Oct 10, 2012 at 18:55
  • \$\begingroup\$ After removing the profile, the next thing to do is remove the metadata. This can be done with nconvert -rmeta. Then if you really want to files with different amounts of details to be the same size, you have to compress one more than the other (in other words, remove the extra details). \$\endgroup\$
    – Itai
    Commented Oct 10, 2012 at 20:07
  • \$\begingroup\$ Once you've removed extraneous metadata, the only way to reduce the file size is to reduce the amount of information in the image. You do by cropping, down-sizing, or reducing the Q ("quality") factor the the jpeg image. You can typically reduce to q=75 (not sure what the exact photoshop equivalent is) before you get noticeable artifacts (without zooming to look at individual pixels) but it varies from image to image. \$\endgroup\$ Commented Oct 10, 2012 at 20:42
  • \$\begingroup\$ And sadly, images with sharp lines, contrast, and detail will tend to show artifacts more quickly as you lower the JPEG quality. So you pretty much can't win. \$\endgroup\$
    – mattdm
    Commented Oct 10, 2012 at 21:57
  • 3
    \$\begingroup\$ @mattdm Noise by definition is random and doesn't compress well. I've found applying a blur filter to the out of focus areas in an image can dramatically reduce the filesize and make the image look better by making the subject pop. You can win sometimes! \$\endgroup\$
    – Matt Grum
    Commented Oct 11, 2012 at 0:42
4
\$\begingroup\$

If you are working in Photoshop (or PS Elements), use the "Save for Web and Devices..." option rather than "Save" or "Save As...". Not only does that give you the opportunity to strip unwanted file components (colour profiles, metadata), you get an interactive preview of what your settings changes will do to the image, such as how far you can go with JPEG compression before artifacts begin to become objectionable.

You are going to have to accept that some images will compress to a much greater degree than others: compression (in simple terms) is mostly about describing changes between neighbouring pixels, and "smooth gradient" is a lot shorter story to tell than a long, complicated tale of 64 more-or-less unrelated individual pixels. Your bicycles/foliage picture is the photographic equivalent of A Tale of Two Cities or À la recherche du temps perdu — you can create a two-paragraph summary, but it'll miss a lot. To paraphrase Einstein: your files should be as simple as possible, but no simpler. Use higher compression levels (lower quality numbers) on images that can stand it, and on aggregate your file sizes will work out well enough that one image that needs to be bigger won't upset the apple cart.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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