Shrinking file size for picture (.jpeg)

  • Thread starter Thread starter WWGD
  • Start date Start date
  • Tags Tags
    File Picture
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
27 replies · 4K views
Messages
7,828
Reaction score
13,156
TL;DR
I submitted a picture(.jpeg), was told it's too big. How to shrink it?
Hi,
So I submitted a picture , a .jpeg file, and, at 5.7 mb, I was told it's too large, I need to shrink it. Just how do I do that? I doubt I can zip it. Should I save it in a paint program? Any other idea?
Edit: I guess it comes down to increasing the compression ratio. Just if it's simple, does anyone know how to increase the compression ratio?
 
Last edited:
Physics news on Phys.org
WWGD said:
Should I save it in a paint program?
No, paint programs are for creating drawings. Most image viewers are able to resize and compress images e.g. Windows Photos. Right-click on the jpg file and see what you have installed.
 
Reply
  • Like
Likes   Reactions: FactChecker, WWGD and phinds
WWGD said:
So I submitted a picture , a .jpeg file, and, at 5.7 mb, I was told it's too large
Typically, a raw JPG file is WAY oversized for use in computers.
WWGD said:
I guess it comes down to increasing the compression ratio
Exactly. Find a compression app and use 30% compression instead of 100%
1688093009676.png
 
Reply
  • Like
Likes   Reactions: WWGD
phinds said:
Exactly. Find a compression app and use 30% compression instead of 100%
100% compression would certainly get the size down, but you wouldn't see a lot!

Depending on the source of the image you may get better results by reducing the size instead (or as well) - PF will resize it to a maximum dimension of (can't remember) after you upload it anyway.
 
Reply
  • Haha
  • Like
Likes   Reactions: russ_watters, WWGD and DaveC426913
Yeah, first reduce the dimensions. Not much point in it being bigger than it will be onscreen. If the file size is still too large, then increase the compression.

What paint program are you using?
 
Reply
  • Like
Likes   Reactions: Algr, russ_watters and WWGD
pbuk said:
100% compression would certainly get the size down, but you wouldn't see a lot!
OOPS. Yeah, I meant instead of 0% compression.
DaveC426913 said:
Yeah, first reduce the dimensions. Not much point in it bein bigger than it will be onscreen. If the file size is still too large, then increase the compression.
I think most apps can do both at the same time. Crop then save and the save can be set to whatever compression you want.
 
Reply
  • Like
Likes   Reactions: WWGD
phinds said:
I think most apps can do both at the same time. Crop then save and the save can be set to whatever compression you want.
Cropping means making smaller by cutting bits off; you may not want to do that. Resizing means making smaller by decreasing resolution.
 
Reply
  • Like
Likes   Reactions: russ_watters, phinds, FactChecker and 1 other person
WWGD said:
Yes, instead of saving it as a, say, 1900 x 620 pixels, save it as a , say, 640x320.
Perhaps that's a bit far, I think PF resizes down to 800 px.

Edit: 800 x 620 for me, YMMV.

Screenshot 2023-06-30 at 04-22-09 Shrinking file size for picture(.jpeg).png

Screenshot 2023-06-30 at 04-20-32 Shrinking file size for picture(.jpeg).png
 
Last edited:
Reply
  • Like
Likes   Reactions: WWGD
I recently had 15 photos that were each about 3-5 MB. I brought each one into GIMP (a free download, which is a popular photo editor) and clicked "File" ->"Export as" ->"Export" -> change name if you don't want to overwrite -> set quality at 60 -> "Export".
It reduced that size greatly and I could not visually see the difference on my monitor. For instance, it turned a 3.75 MB file into a 936 KB file.

UPDATE: PS. Zipping the photos did not significantly reduce the size.
 
Last edited:
Reply
  • Like
Likes   Reactions: .Scott and WWGD
FactChecker said:
Zipping the photos did not significantly reduce the size.
Of course not. JPG is a compression algorithm, so ZIPping a JPG is trying to compress a file that is already compressed.
 
These days the only good use of ZIP or SIT is to make a folder appear as a single file. Most modern file formats have data-specific file compression that will work better than a general-data file compression like ZIP.
 
Reply
  • Like
Likes   Reactions: Nik_2213
Algr said:
These days the only good use of ZIP or SIT is to make a folder appear as a single file. Most modern file formats have data-specific file compression that will work better than a general-data file compression like ZIP.
I disagree. There are plenty of common file types that are not compressed, such as .TXT, .DOC, .EXE, etc
 
First, resize the photo(s), i.e. change the pixel dimensions, to suit their intended use. Then set the JPEG quality level (compression) to lowest value that will give an acceptable appearance for the intended use.

My iPhone XR (which is now a 5 year old model) produces 4032x3024 pixel images, which are way... too... big for on-screen use, even on my iMac with a 27-inch display. Resizing them in Photoshop by factors of 1/2 and 1/4 gives the following file sizes, all at maximum JPEG quality, which Photoshop calls level 10:

original 4032x3024: 4.2MB
1/2 size 2016x1512: 1.5MB
1/4 size 1008x756: 585KB

I can reduce the file size further by reducing the JPEG quality. At high quality (level 8):

4032x3024: 2.5MB
2016x1512: 1.0MB
1008x756: 398KB

And at medium quality (level 5):

4032x3024: 1.6MB
2016x1512: 704KB
1008x756: 294KB
 
Wrichik Basu said:
IrfanView is a nice program that can resize images. You can choose % of original image, which will decrease both size and dimensions.
I used to use that years ago! I remember it being very good.

There are built in options now. E.g. if I share a photo from my phone, I'm asked whether I want to reduce the image size.
 
Reply
  • Like
Likes   Reactions: Nik_2213
phinds said:
Of course not. JPG is a compression algorithm, so ZIPping a JPG is trying to compress a file that is already compressed.
I already knew this. At the time that I posted my comment, nobody had responded to the OP comment about zipping the files.
 
Reply
  • Like
Likes   Reactions: phinds
@FactChecker suggested using GIMP.
I also use GIMP - It's a handy app to have on you laptop.
It's good for touching up photos - contrast/brightness/color correction, etc,

One other thing: If the image is text, borders, windows, etc with no "photos", the storing it in png format could be near loss-less with a very substantial reduction of the file size. Assuming, of course, that PNG is an acceptable format.
 
Reply
  • Like
Likes   Reactions: FactChecker
Vanadium 50 said:
Yes, that's the idea, but even uncompressed 1900x620 shouldn't be over 5 MB.
Good point. My photos are 3456x2304 and bit-depth=24. As .JPG files, their size is typically 3-4 MB with a couple around 5 MB. But there are different levels of JPEG lossy compression and I honestly do not know what my camera uses. The OP does not mention what quality of photo he is supposed to supply or who it is going to.
 
FactChecker said:
The OP does not mention what quality of photo he is supposed to supply or who it is going to.
I think the implication of his question is that he wants it to show up HERE.
 
FactChecker said:
Good point. My photos are 3456x2304 and bit-depth=24. As .JPG files, their size is typically 3-4 MB with a couple around 5 MB. But there are different levels of JPEG lossy compression and I honestly do not know what my camera uses. The OP does not mention what quality of photo he is supposed to supply or who it is going to.
It's an application I'm filing. It requires I submit a picture. But when I do, I'm told the picture I've submitted is too large at some 5.7 mb, and that I should provide a smaller one.
 
phinds said:
I think the implication of his question is that he wants it to show up HERE.
That's how I read it too, but as...
WWGD said:
It's an application I'm filing.
, don't they give some specification? If not I'd default to the standard for a passport or driving license application: in the UK this is a minimum 600x600 px although 900x1200 is a good choice. At this resolution saving with "very high"/80% jpg quality (i.e. low compression) should give you a small enough image to upload.

All the recommendations for image processing software above are fine, but there is no need to go looking for anything new to install - the simple image editor that comes with whatever (modern) desktop OS you are using is fine.
 
Reply
  • Like
Likes   Reactions: WWGD and FactChecker
May I also support Irfan View ? It is still free for non-commercial use. Also, there are a bunch of free updates and plug-ins empowering it above and beyond what it had even a few years ago. It continues to improve. (*)

Besides a UI I can grok --GIMP gives me a prompt migraine !!-- Irfan View also has the very handy feature that it will identify and offer to correct most common mis-Typed or un-Typed graphic files.

FWIW, my favourite use is to craft crisp 350x350 folder.JPG images, a boon for my post-middle-aged eyes...

(*) IV struggles with huge HDRIs, patch anticipated, and its batch tools cannot, as yet, extract Alpha Channels...
 
Reply
  • Like
Likes   Reactions: WWGD and Wrichik Basu