Ugly Hedgehog - Photography Forum
Home Active Topics Newest Pictures Search Login Register
Check out Bridge Camera Show Case section of our forum.
Main Photography Discussion
Compressing jpeg to a specific file size
Page 1 of 4 next> last>>
Jul 14, 2023 01:51:38   #
Dragonophile
 
I want to compress my jpegs to 11mb in size. There is an online site that supposedly does this but it requires uploading and then downloading my jpegs. I do not want to do this. Anyone use a computer software program - free or purchased - that allows compression to a specific file size rather than by percentage or pixel dimensions? I am currently compressing by percentage but the resulting file sizes are unpredictable. I submit pictures to a web site that requires pictures be 12mb or less. When I use 98% on one 15mb picture, I might get a 10 mb file but on the next picture of 15mb it might compress to 7 mb.

My thinking, which may be faulty!, is that I would get best results with least compression required if I can specify a 11mb file size and let the program do the calculations on compression rates.

Thoughts and suggestions appreciated.

Reply
Jul 14, 2023 03:34:39   #
Wallen Loc: Middle Earth
 
We can designate the quality of Jpg compression, but the output files size can not be assigned because that depend on the content of the image itself.

Images with large areas of single colors will compress differently from an image with lots of color & contrasts.

If the system is to compress to a certain file size, then every image will have different qualities.
Therefore they opted to allow selection of quality and let the image content dictate the final file size.

Look at the sample below. Even just changing the brightness of the image changes the file size.
With color the size grows even bigger and the image with the trees because of more variations between pixels becomes the largest file size, even though all images are the same size and saved in the same jpg quality.

If you want to output a certain file size, you will need to keep playing with the quality slider and most probably only get an approximate and not the exact file size you want.

















Reply
Jul 14, 2023 04:03:09   #
niteman3d Loc: South Central Pennsylvania, USA
 
AMS Photo Works does this and you can download it for free to try. You can usually buy it for $20 or so if you like the program.

There is a save screen with a percentage slider, but below that slider is a box that shows the file size at every increment. The part I don't like is that the slider adjustment is done by either dragging the slider itself which adjusts in one percent increments, but is hard to get just right on the money or with an up/down arrow which moves it in 5 percent increments only.

Reply
 
 
Jul 14, 2023 06:35:31   #
CHG_CANON Loc: the Windy City
 
Dragonophile wrote:
I want to compress my jpegs to 11mb in size. There is an online site that supposedly does this but it requires uploading and then downloading my jpegs. I do not want to do this. Anyone use a computer software program - free or purchased - that allows compression to a specific file size rather than by percentage or pixel dimensions? I am currently compressing by percentage but the resulting file sizes are unpredictable. I submit pictures to a web site that requires pictures be 12mb or less. When I use 98% on one 15mb picture, I might get a 10 mb file but on the next picture of 15mb it might compress to 7 mb.

My thinking, which may be faulty!, is that I would get best results with least compression required if I can specify a 11mb file size and let the program do the calculations on compression rates.

Thoughts and suggestions appreciated.
I want to compress my jpegs to 11mb in size. There... (show quote)


The answer hasn't changed since the discussion in Nov 2022: https://www.uglyhedgehog.com/t-757996-1.html

If you'd decide on the maximum (reduced) pixel resolution to share in a digital (online) format, you most likely can use 100% JPEG quality, for a file in the rather large 11MB area -- a file size that takes longer to send across the internet, longer to upload, longer to download, longer to open, longer to render.

This link was provided before. Here it is again: Recommended resizing parameters for digital images

The suggestion is 2048px wide, a pixel "length" that is wider than the majority of the phones, tablets, monitors that will be used to view your online / digital images. The resulting files will be in the 2-3MB range.

Reply
Jul 14, 2023 08:23:22   #
DirtFarmer Loc: Escaped from the NYC area, back to MA
 
Irfanview is a freeware program that will do that.
It's Windows only but will run on a Mac using Parallels.
When you open an image in Irfanview it will allow you to save it (ctrl-s). When you do that it gives you a dialog with save options including save quality, but down the list of options is a checkbox for 'Set file size' which also gives you a text box to enter a file size. It is not something I have used much (and not recently) so I can't say just how close to the target size it gets but the program is free, so give it a try.

In general, I would expect that setting a specific file size will give you a wide range of image quality settings because all images are different. Some results may not be up to your expectations, particularly if the image is large.

Update: Saving does work on a Mac/Parallels. Tried it on a 3Mbyte image file and set the result to 500Kb. Got a file 503Kb.
Saving the same file on Windows with the result set to 1Mb gives a file 983Kb.

Imagemagick is an open source freeware command-line program that will probably do similar things. It's extremely flexible and has a lot of capabilities, but its complexity is probably similar to Photoshop, so it will take a while to master it. There are lots of online tutorials.

Reply
Jul 14, 2023 09:47:04   #
larryepage Loc: North Texas area
 
Dragonophile wrote:
I want to compress my jpegs to 11mb in size. There is an online site that supposedly does this but it requires uploading and then downloading my jpegs. I do not want to do this. Anyone use a computer software program - free or purchased - that allows compression to a specific file size rather than by percentage or pixel dimensions? I am currently compressing by percentage but the resulting file sizes are unpredictable. I submit pictures to a web site that requires pictures be 12mb or less. When I use 98% on one 15mb picture, I might get a 10 mb file but on the next picture of 15mb it might compress to 7 mb.

My thinking, which may be faulty!, is that I would get best results with least compression required if I can specify a 11mb file size and let the program do the calculations on compression rates.

Thoughts and suggestions appreciated.
I want to compress my jpegs to 11mb in size. There... (show quote)


The LightRoom Export function will do exactly what you are asking for, although I've never tried Exporting a JPEG to a smaller JPEG.

Keep in mind that there are two methods to reduce the size of JPEG image file...actually reducing the resolution and applying more vigorous compression. Modern versions of LightRoom give you some capability to manage that choice.

Reply
Jul 14, 2023 10:09:11   #
Dragonophile
 
Thanks for all the replies. I will look into AMS & Irfanview. They sound promising if they merely alter the compression ratio rather than actually reducing the picture size. Lightroom may be overkill for my needs, but it is good to know about.

Reply
Check out Printers and Color Printing Forum section of our forum.
Jul 14, 2023 11:18:49   #
R.G. Loc: Scotland
 
CHG_CANON wrote:
....The suggestion is 2048px wide, a pixel "length" that is wider than the majority of the phones, tablets, monitors that will be used to view your online / digital images. The resulting files will be in the 2-3MB range.


Or if you want to allow for possible 4k viewing on a 16:9 screen, the pixel dimensions are 3840 x 2160, which puts 3840 on the longest edge for horizontal (landscape orientation) images. That gives a resolution of ~8.3 MP which in most cases will be a drop in resolution from the original files. Even with an aspect ratio of 3:2, 3840 on the longest edge (horizontal orientation) gives less than 10 MP. Quality should be left at 100%.

Having more resolution than you need for the method of viewing is unnecessary and as mentioned, more time consuming.

Reply
Jul 14, 2023 11:42:29   #
R.G. Loc: Scotland
 
Dragonophile wrote:
....They sound promising if they merely alter the compression ratio rather than actually reducing the picture size.....


Dropping the pixel count to a more appropriate size will have less effect on picture quality than increasing the compression ratio (i.e. reducing the quality setting).

Reply
Jul 14, 2023 13:46:06   #
burkphoto Loc: High Point, NC
 
Dragonophile wrote:
I want to compress my jpegs to 11mb in size. There is an online site that supposedly does this but it requires uploading and then downloading my jpegs. I do not want to do this. Anyone use a computer software program - free or purchased - that allows compression to a specific file size rather than by percentage or pixel dimensions? I am currently compressing by percentage but the resulting file sizes are unpredictable. I submit pictures to a web site that requires pictures be 12mb or less. When I use 98% on one 15mb picture, I might get a 10 mb file but on the next picture of 15mb it might compress to 7 mb.

My thinking, which may be faulty!, is that I would get best results with least compression required if I can specify a 11mb file size and let the program do the calculations on compression rates.

Thoughts and suggestions appreciated.
I want to compress my jpegs to 11mb in size. There... (show quote)


If you work in Adobe Lightroom Classic, using raw original files, you can output original, unscaled pixels cropped the way you want them. You can check a box in the Export dialog to Limit File Size to: [specified size]. You can force a specific set of pixel dimensions, instead, but still limit the file size. It works very well.

I could write several pages on the export and printing features of Lightroom Classic. You can crop to any shape, design print layouts and print to file or PDF, use any output profile, get any size file, any pixel dimension limit, add copyright information, restrict metadata in files, and more. It's quite useful and very reliable. You can select a batch of images and output them all to the same specifications.

Reply
Jul 14, 2023 13:48:18   #
CHG_CANON Loc: the Windy City
 
burkphoto wrote:
If you work in Adobe Lightroom Classic, using raw original files, you can output original, unscaled pixels cropped the way you want them. You can check a box in the Export dialog to Limit File Size to: [specified size]. You can force a specific set of pixel dimensions, instead, but still limit the file size. It works very well.

I could write several pages on the export and printing features of Lightroom Classic. You can crop to any shape, design print layouts and print to file or PDF, use any output profile, get any size file, any pixel dimension limit, add copyright information, restrict metadata in files, and more. It's quite useful and very reliable. You can select a batch of images and output them all to the same specifications.
If you work in Adobe Lightroom Classic, using raw ... (show quote)


You can even save a custom 'user' preset with all the relevant and 1-click repeatable export parameters, giving it a personally relevant name...

Reply
Check out The Pampered Pets Corner section of our forum.
Jul 14, 2023 13:50:39   #
burkphoto Loc: High Point, NC
 
CHG_CANON wrote:
You can even save a custom 'user' preset with all the relevant and 1-click repeatable export parameters, giving it a personally relevant name...


Yep! That's very powerful. I have 11 presets I use for different purposes.

Reply
Jul 14, 2023 17:35:55   #
profbowman Loc: Harrisonburg, VA, USA
 
Dragonophile wrote:
I want to compress my jpegs to 11mb in size. There is an online site that supposedly does this but it requires uploading and then downloading my jpegs. I do not want to do this. Anyone use a computer software program - free or purchased - that allows compression to a specific file size rather than by percentage or pixel dimensions? I am currently compressing by percentage but the resulting file sizes are unpredictable. I submit pictures to a web site that requires pictures be 12mb or less. When I use 98% on one 15mb picture, I might get a 10 mb file but on the next picture of 15mb it might compress to 7 mb.

My thinking, which may be faulty!, is that I would get best results with least compression required if I can specify a 11mb file size and let the program do the calculations on compression rates.

Thoughts and suggestions appreciated.
I want to compress my jpegs to 11mb in size. There... (show quote)


When dealing with jpeg files, to me the more critical characteristic is its quality. The clioser to 100%, the better it is. So, why worry about the file size to begin with try 100 and see what file size it gives you for several pictures. Then try 95 and see shat file size results. A quality of 05 is really over-the-top for pitures posted to the web. So, if 100% works or you have to go to 95%, you are safe either way.

BTW, check out the picutres on the website you are sending your photos to. If they are shrinking your photos to some pixel size less than what you are sending to them and they are not making the larger files available to web users, they why not shrin the pictures to the size they want? That way you have control over the resizing. ---Richard

Reply
Jul 14, 2023 19:42:17   #
DirtFarmer Loc: Escaped from the NYC area, back to MA
 
profbowman wrote:
When dealing with jpeg files, to me the more critical characteristic is its quality. The clioser to 100%, the better it is. So, why worry about the file size to begin with try 100 and see what file size it gives you for several pictures. Then try 95 and see shat file size results. A quality of 05 is really over-the-top for pitures posted to the web. So, if 100% works or you have to go to 95%, you are safe either way.

BTW, check out the picutres on the website you are sending your photos to. If they are shrinking your photos to some pixel size less than what you are sending to them and they are not making the larger files available to web users, they why not shrin the pictures to the size they want? That way you have control over the resizing. ---Richard
When dealing with jpeg files, to me the more criti... (show quote)


You might be interested in looking at my study on jpg rewrites. It gives some numerical analysis of the quality level of images. Comparing the quality of two images is really not easy when you try to compare them side by side. The link above goes to the abstract of my study, and includes a link to the full PDF (too large for UHH to download). The full PDF contains an appendix which describes how to do a blink test, which is a much better way to compare two images.

But quality of 95 is overkill in most cases. Quality of 80 is quite sufficient for most situations, and many images will not be significantly degraded down to quality of 60. And, depending on your software, a quality above 90 could present other problems.

In the end, the quality of a jpg is subjective.

PS: most software uses a scale of 1-100 (or 0-100) for the quality. Photoshop, however uses a scale of 0-12, and is not linearly related to other software's quality setting. The Photoshop 0 quality is probably similar to 20 or 30 in other software.

Reply
Jul 14, 2023 22:26:12   #
Dragonophile
 
Let me clarify and ask elementary questions.

First, my only concern is not with picture viewing. This website allows users to download my pictures. Some users want to print the pictures in brochures or newsletters or reports or even a newspaper article. Some users may just want to print for their personal uses. I am OK with this. I retain copyright, but I always give requestors free permission to use my photos. Sometimes, they even ask if I have higher resolution images than on the website. So printing is an issue over and above pixels/screens.

Then there is the issue of resizing vrs compression. Aren't they separable at times? Compression is lossy I know, but it is algorithm based, correct? Some resizing can be actual pixel reduction correct? Or am I not understanding?

Simple sounding question. I start with a jpeg file that is about 17mb in size. I use my program at 97% compression to get it down to 9 mb. 98% puts it over the upload size restriction. Or, I use one of the programs suggested to compress it to 11mb. Someone wants to download this picture and print it in a glossy brochure. Will it make any difference if the file has been compressed to 9 mb versus the larger 11 mb in terms of printable quality? What if the file difference is 7mb vrs 11mb? Or what if the download is 7 mb but they want my original 17 mb file? That is the crux of what I need to know.

[I will look at your link Dirt Farmer. I haven't yet...]

Reply
Page 1 of 4 next> last>>
If you want to reply, then register here. Registration is free and your account is created instantly, so you can post right away.
Check out Advice from the Pros section of our forum.
Main Photography Discussion
UglyHedgehog.com - Forum
Copyright 2011-2024 Ugly Hedgehog, Inc.