# Is there any easy way to downsize an image to a target filesize, rather than reducing edges by %?

**URL:** <https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825>\
**Category:** Factual Questions\
**Created:** [January 3, 2018, 10:59pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825 "2018-01-03T22:59:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spectre\_of\_Pithecanthropus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/spectre_of_pithecanthropus/32/12343_2.png) [@Spectre\_of\_Pithecanthropus](https://boards.straightdope.com/u/Spectre_of_Pithecanthropus)\
**Post date:** [January 3, 2018, 10:59pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/1 "2018-01-03T22:59:11Z")

</div>

I’m the newsletter editor for an association to which I belong, and I need to process many image files for each issue. I compose and lay out each issue using MS Word, print it to PDF, and send the latter out to the members. I need each image to be about 250 or 300K in size; any smaller and it becomes too blurry even for a little association newsletter like this; any bigger and problems may arise somewhere down the line, either with the final formatting or when the members read the email and download their copies.

I’m not all that experienced with graphics tools yet, but with all the ones I’ve tried the resizing function is based on reducing the perimeter by a desired percentage, or to a desired resolution or pixel size. So for each image I have to calculate as follows. Naturally I use the calculator in my phone for this, but it’s still a bore:

[ol]  
[li]calculate desired-filesize/original-filesize to obtain the reduction needed[/li][li]Take the square root of the last result to estimate by how many percent I need to reduce edge lengths[/li][/ol]

The trouble is, the original sizes of the images are usually all different, so the calculation really does have to be redone every single time. I’m wondering if there’s any application or tool with which I specify the desired target filesize, and the tool could do all that work for me?

---

<div class="post-metadata">

**Author:** ![GaryM](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/garym/32/241_2.png) [@GaryM](https://boards.straightdope.com/u/GaryM)\
**Post date:** [January 3, 2018, 11:11pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/2 "2018-01-03T23:11:53Z")

</div>

Take a look at IrfanView. You can resize by specific horizontal or vertical dimension or percentage. You can also choose “quality” which impacts resolution. It’s a universal viewer as well and can do some editing too.

GaryM

---

<div class="post-metadata">

**Author:** ![ZonexandScout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zonexandscout/32/544_2.png) [@ZonexandScout](https://boards.straightdope.com/u/ZonexandScout)\
**Post date:** [January 3, 2018, 11:38pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/3 "2018-01-03T23:38:09Z")

</div>

I’d love to help, and I work a lot with both image files and video files, but I’m a little confused.

Are you saving the image files as JPEGs and then inserting them? A 1600x1200 JPEG, using reasonably good compression, should be much less than 300KB, and more than adequate for printing in a newsletter. I think you might be confusing final image file size with image quality and the two do not necessarily correspond with each other.

I’m also thinking you may want to look at your configuration for Word and how you are exporting to PDF. Word does a notoriously bad job of saving to PDF without a lot of tweaking. I always print to a PDF converter instead of saving directly from Word to a PDF.

And I’ll second IrfanView. Once you understand how to use the settings, it does a great job with many common image processing tasks.

---

<div class="post-metadata">

**Author:** ![DinoR](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dinor/32/2821_2.png) [@DinoR](https://boards.straightdope.com/u/DinoR)\
**Post date:** [January 3, 2018, 11:48pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/4 "2018-01-03T23:48:02Z")

</div>

> [@ZonexandScout](#):
>
> And I’ll second IrfanView.

…and a third with a [link](http://www.irfanview.com/)

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [January 3, 2018, 11:50pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/5 "2018-01-03T23:50:31Z")

</div>

Do you have any control over the input image format? Meaning, is it PNG, TIFF, JPEG2000, JPEG? Are the originals really all about the same size and content (a busy ultra HD color image will not compress as much as a postage-stamp-sized black square)?

Anyway, for photo-type images what you want to do is use JPEG2000 and specify an exact compression ratio.

ETA don’t use plain JPEG as you will not have precise control over the file size.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [January 4, 2018, 12:11am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/6 "2018-01-04T00:11:50Z")

</div>

I also second **ZonexandScout** ’s advice to use a utility like Adobe Distiller to create the PDF file; in Windows you should see “Adobe PDF” as a print option if it is installed.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [January 4, 2018, 12:23am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/7 "2018-01-04T00:23:35Z")

</div>

(Ghostscript can be used if you do not have the Acrobat software installed.)

---

<div class="post-metadata">

**Author:** ![md2000](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@md2000](https://boards.straightdope.com/u/md2000)\
**Post date:** [January 4, 2018, 12:24am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/8 "2018-01-04T00:24:08Z")

</div>

If you’re doing bulk, I have used a freebie utility called “Fotosizer” which you can use to resize a number of photos at once.

Same deal - select “keep aspect ratio” and set one of the dimensions in pixels (or percent, take your pick)

Simple word of caution - always keep the originals, write any modified photos to a different filename.

---

<div class="post-metadata">

**Author:** ![GaryM](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/garym/32/241_2.png) [@GaryM](https://boards.straightdope.com/u/GaryM)\
**Post date:** [January 4, 2018, 4:03am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/9 "2018-01-04T04:03:02Z")

</div>

> [@md2000](#):
>
> Simple word of caution - always keep the originals, write any modified photos to a different filename.

Words to live by right here!

GaryM

---

<div class="post-metadata">

**Author:** ![Spectre\_of\_Pithecanthropus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/spectre_of_pithecanthropus/32/12343_2.png) [@Spectre\_of\_Pithecanthropus](https://boards.straightdope.com/u/Spectre_of_Pithecanthropus)\
**Post date:** [January 4, 2018, 6:43am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/10 "2018-01-04T06:43:35Z")

</div>

> [@ZonexandScout](#):
>
> I’m also thinking you may want to look at your configuration for Word and how you are exporting to PDF. Word does a notoriously bad job of saving to PDF without a lot of tweaking. I always print to a PDF converter instead of saving directly from Word to a PDF.

That’s how I do it. I am aware that Word allows you to save a .docx file as a .pdf, but that the resulting file comes out much larger than when it’s done the other way, apart from whatever other issues may be introduced by saving a document as an Acrobat file.

---

<div class="post-metadata">

**Author:** ![Spectre\_of\_Pithecanthropus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/spectre_of_pithecanthropus/32/12343_2.png) [@Spectre\_of\_Pithecanthropus](https://boards.straightdope.com/u/Spectre_of_Pithecanthropus)\
**Post date:** [January 4, 2018, 7:14am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/11 "2018-01-04T07:14:45Z")

</div>

> [@GaryM](#):
>
> Take a look at IrfanView. You can resize by specific horizontal or vertical dimension or percentage. You can also choose “quality” which impacts resolution. It’s a universal viewer as well and can do some editing too.
> 
> GaryM

The problem is that when you want to reduce the image size, it’s really an area problem. Edge based scaling tools work linearly.

Suppose I have a square image of size 1Mb, and I want to reduce it to 250Kb. So I can just reduce the height and width by three quarters, right? Of course not. If I want the new version to be one-fourth the size of the original, I have to reduce the edges by just half. Of course, the files that I’m working with don’t all start out with some nice, even, and consistent filesize like 10M. Not only does the camera optimize each photo slightly differently, but I’ve also usually done some cropping and other post processing before I even get to where I’m ready to reduce the sizes. So, every photo means repeating the calculations. Given that the actual photos aren’t square but rectangular, I realize that using the square root doesn’t give me the exact figure I want, but it’s a useful method of estimation.

In the OP I asked about the possibility of a tool where I could simply specify that I want the resulting file to be 350Kb or whatever, but it would be almost as good if there was a way of specifying the desired size reduction in percentage or decimal form, but with respect to the area rather than the edges.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [January 4, 2018, 9:16am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/12 "2018-01-04T09:16:27Z")

</div>

Do you really want to change the image size as in number of pixels by rescaling it, reduce the file size by compressing it more aggressively, or both?

If you start with an uncompressed file and encode it using JPEG2000 with 16:1 compression, the resulting file will be a quarter that of if you use 4:1 compression, without changing the image dimensions or resolution. The compression ratio applies to the raw file which has a known number of bits per pixel. That sounds like it satisfies your “almost as good” criterion; the only question is whether any encoding library lets you specify the output size directly rather than a compression ratio.

I haven’t tested them all; eg [this link](https://wiki.harvard.edu/confluence/display/DigitalImaging/Encoding+JPEG2000+images+using+the+Aware+codec) claims you can specify the bitrate on the command line.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [January 4, 2018, 9:29am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/13 "2018-01-04T09:29:33Z")

</div>

:smack: bitrate is tantamount to compression ratio, sorry. All libraries I know let you specify the ratio.

---

<div class="post-metadata">

**Author:** ![PatrickLondon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/patricklondon/32/4422_2.png) [@PatrickLondon](https://boards.straightdope.com/u/PatrickLondon)\
**Post date:** [January 4, 2018, 10:07am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/14 "2018-01-04T10:07:05Z")

</div>

Inserting JPEGs into Word does something peculiar in Word to the Word filesize, IME. Try saving the image as Windows Media Format (.wmf), and then insert it into Word.

---

<div class="post-metadata">

**Author:** ![PatrickLondon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/patricklondon/32/4422_2.png) [@PatrickLondon](https://boards.straightdope.com/u/PatrickLondon)\
**Post date:** [January 4, 2018, 10:08am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/15 "2018-01-04T10:08:58Z")

</div>

You may also need to resize according to the page dimensions, i.e., in inches/cm rather than pixels. But still try .wmf.

---

<div class="post-metadata">

**Author:** ![Darren\_Garrison](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/darren_garrison/32/92_2.png) [@Darren\_Garrison](https://boards.straightdope.com/u/Darren_Garrison)\
**Post date:** [January 4, 2018, 11:28am UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/16 "2018-01-04T11:28:14Z")

</div>

> [@PatrickLondon](#):
>
> Inserting JPEGs into Word does something peculiar in Word to the Word filesize, IME.

Whatever Word does to JPEGs, it results in massive files. I’ve converted (for personal, not professional, use) older PDFs with illustrations into EPUBs, and ended up with 100 MB RTF files. If I open the RTF in [Atlantis](https://www.atlantiswordprocessor.com/en/) and re-save it as an RTF, the file size will be below 10 MB.

---

<div class="post-metadata">

**Author:** ![zbuzz](https://avatars.discourse-cdn.com/v4/letter/z/e19b73/32.png) [@zbuzz](https://boards.straightdope.com/u/zbuzz)\
**Post date:** [January 4, 2018, 2:30pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/17 "2018-01-04T14:30:50Z")

</div>

If you’ve got a Mac handy, you can pretty much do this with the built in Preview app.

Open the image in Preview, then File \> Export… \> Format: JPEG. Then as you slide the Quality slider from Best to Least, it will dynamically give you an estimate of the file size of the resulting exported file.

If the Least quality is still too big, go to Tools \> Adjust Size \> Resolution and lower the resolution. It will then estimate what the resulting file size will be depending on the new resolution. Keep lowering the resolution until you reach your target file size.

So you can’t plug in say 285 KB as a precise target, but even with a large image you should be able to get very close.

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [January 4, 2018, 3:42pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/18 "2018-01-04T15:42:45Z")

</div>

If you have access to Adobe Lightroom, it lets you do that in the export settings. Under file settings, if you select JPEG as your image format, there is a checkbox “Limit File Size To: \_\_\_\_ K”.

ETA: I should add that this parameter determines JPEG quality. It does not resize the image based on those constraints. The resize amount you have to plug in manually. Presumably, though, you have at least a minimum target resolution in mind.

---

<div class="post-metadata">

**Author:** ![Fubaya](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@Fubaya](https://boards.straightdope.com/u/Fubaya)\
**Post date:** [January 4, 2018, 3:56pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/19 "2018-01-04T15:56:47Z")

</div>

ImageMagick&nbsp;can do it. It started life as a Linux command line too, but it’s available for Windows and Mac with a front-end.

You can also search for “optimize images for web” which is the term for what you want. I have a hosted website that has this option available at the click of a button. There are probably online tools or simple programs just for doing it.

---

<div class="post-metadata">

**Author:** ![Fubaya](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@Fubaya](https://boards.straightdope.com/u/Fubaya)\
**Post date:** [January 4, 2018, 4:14pm UTC](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825/20 "2018-01-04T16:14:06Z")

</div>

> [@Fubaya](#):
>
> It started life as a Linux command line too

That should be command line _tool_

[Next page](https://boards.straightdope.com/t/is-there-any-easy-way-to-downsize-an-image-to-a-target-filesize-rather-than-reducing-edges-by/805825.md?page=2)
