Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 04, 2015, 02:53:28 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Batch image resizing, dimensions fixed, quality dependant on eventual file size?  (Read 10052 times)

suleika

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 117
    • View Profile
    • Donate to Member
I have not one but two digicams now and I'm really getting into it as a hobby, and I'm doing quite well at organising the photos I work on, but the ones I don't work on are a bit of a mess and are taking up a lot of space.  Some of them I want to keep intact for working on in the future, and the rest I want to save as smaller jpg files (for reference, memento etc) and delete the originals.  A few of them I'm going to process by hand, but most of them could be batch processed.

Most of the originals are jpgs of (approx) either 3000x2000 and 1.5-3.5 MB, or 4200x3400 and 1.5 -5 MB.  (I'm not doing anything with my RAW files yet.)  I've tested quite a few and I've worked out that I'd like to make the files 1 MB but have them no smaller than 1000 pixels on the shorter side.  This won't be a one-off job; I'll be doing this every time I shoot.

I'm trying very hard to satisfice here rather than optimise - these photos are rejects, after all (I mainly want to be able to see why I rejected them, refer to the EXIF data, and also to keep a chronology alongside the photos I am keeping).  But the files vary in size quite a lot - and so if I use FastStone Image Viewer, for example, and set the shorter side at 1000 pixels, and set the jpg quality to give me an average file size of 1MB, I end up with quite a lot of files considerably smaller and larger than 1MB (and the setting would be different from batch to batch anyway).

Is there a smart way of doing this?  Does anyone know of a program that will deliver a file 1000 pixels short-side at 100% quality, unless result is more than 1MB, in which case try 99%, unless result is more than 1MB, in which case try 98%, etc etc?

Alternatively, is there a program that will simply reduce the quality of the jpg to a given file size (1MB) without resizing?  And can anyone tell me how different the result will be from a re-sized file (new dimensions) in terms of quality?  I would have thought it would be much the same when viewed at the same size on the screen.

I'm aware, by the way, that if I were to use a percentage as the quality setting then the resultant files would have a neatly consistent relationship to their originals, but I don't want to go that route, even though it would be easier to manage.  Firstly, the originals with smaller file sizes are the ones to benefit from not being over-compressed and the byte-rich files can afford it.  Secondly, if I can get the files near to 1MB each it will make accounting for future file storage extremely easy.


Alex Yakovlev

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 5
    • View Profile
    • Software Professional
    • Donate to Member
Batch file processing is a feature of Corel Paint Shop Pro Photo. All you should do is to setup actions performed on individual image file, select source and destination files/folders and click Start. However, it is commercial.

suleika

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 117
    • View Profile
    • Donate to Member
I appreciate the swift reply.  Are you familiar with its particular batch processing possibilities?  Will it do either of those things I describe? 

CWuestefeld

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 976
    • View Profile
    • Revolution Calling
    • Donate to Member
The app "Multiple Image Resizer" (http://www.multipleimageresizer.net/) will easily do the scaling including the smart "short side=1000" that you describe. But neither this nor anything else I've seen does the image-size targeting you ask for.

Frankly, this seems to be orders of magnitude more trouble than it can be worth. With the cost of storage these days, who cares if the output is 1.2MB rather than 1MB? And I don't discard any photos. In fact, I keep an archival copy straight from the camera, plus any edits separately, and I can easily backup my whole library onto 2-3 DVD, in under an hour.



suleika

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 117
    • View Profile
    • Donate to Member
If no program will do it, then so be it.  If I can find one, I shall use it, and it will not be more trouble than it is worth to me.

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
IIRC, IrfanView can also do batch processing, as can the gimp and Imagemagick's convert. The latter two are FOSS.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,976
    • View Profile
    • Read more about this member.
    • Donate to Member
PictureScaler seems to have all the features you asked for.

Among them:

* Specify the new width or height of the images (even according to longest/shortest edge which is handy when you are scaling portrait and landscape images at the same time)
* Set the target file size when saving JPEGs

This seems to be their new WWW site.  Q-Technologies

Google is your friend  :D
« Last Edit: May 03, 2008, 07:35:14 AM by 4wd »

suleika

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 117
    • View Profile
    • Donate to Member
PictureScaler seems to have all the features you asked for.

It's looking good - I shall give it a trial.  Thank you. 

(Now wondering what my search terms were when I didn't previously find it myself... :-[)

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,976
    • View Profile
    • Read more about this member.
    • Donate to Member
Quote
It's looking good - I shall give it a trial.  Thank you. 

Had a play with it, the resizing works however rotating is disabled in the trial and specifying a size for the final JPEG is ghosted - so I can only assume it's disabled in the trial version.

BTW, only just noticed the author only lives 20k or so from me.

EDIT: It requires Quicktime to be installed to do it's 'final size' thing, (I used QT Alt 1.77 that I had), and it seems to work quite well, all pics had a short side of 1000 and came in about 10k under the 200kB I specified as final size.

It imprints a www site link along the bottom of the longest side, (trial version) - reasonably unobtrusive depending on final pic size.
« Last Edit: May 04, 2008, 01:43:29 AM by 4wd »

suleika

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 117
    • View Profile
    • Donate to Member
Had a play with it, the resizing works however rotating is disabled in the trial and specifying a size for the final JPEG is ghosted - so I can only assume it's disabled in the trial version.

EDIT: It requires Quicktime to be installed to do it's 'final size' thing, (I used QT Alt 1.77 that I had), and it seems to work quite well, all pics had a short side of 1000 and came in about 10k under the 200kB I specified as final size.

Funny - my "target file size" isn't greyed out, but when I set it at 1000KB the results ranged from 440KB to 970KB  - maximum size perhaps?  I do have Quicktime as it happens (btw, I couldn't find the info about Quicktime and there seems to be no helpfile). 

I had another better google session and found some other resources - I've just tried JpegResizer - created a batch between 820KB and 1040 - that's pretty good.  I shall probably go for it. 

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,976
    • View Profile
    • Read more about this member.
    • Donate to Member
Funny - my "target file size" isn't greyed out, but when I set it at 1000KB the results ranged from 440KB to 970KB  - maximum size perhaps?  I do have Quicktime as it happens (btw, I couldn't find the info about Quicktime and there seems to be no helpfile).

I also tried setting it at 1MB and had sizes ranging from 400-800kB.  So I ran one pic through at size constraint of 1024kB which resulted in a file ~630kB and then I ran the same pic through saving at 100% quality which resulted in a 1.40MB file, (both times set at a resize of 'short side=1000').

I then compared the two using BeyondCompare's picture comparison and found there was actually minimal differences between them.

I tried the above on different photo subjects and every time it resulted in only minimal differences between the two output files.

You don't get told about Quicktime unless you don't have it installed, (which I normally don't), then it opens an info window.  Doesn't say it needs it for the 'final size' output option though.

The help file is a PDF download from the author's WWW site PictureScaler User Guide.

Quote
I had another better google session and found some other resources - I've just tried JpegResizer - created a batch between 820KB and 1040 - that's pretty good.  I shall probably go for it. 

Link five in the Google search in my original post  ;)

I'm sure there's probably a freeware alternative to these programs - just requires a little digging.

EDIT: Sourceforge is your second friend  :)

kf-jpeg-fitsize - Fit jpeg to a maximum filesize. Reduce jpeg quality to fit that file size.

Requires two more free programs to work, (it's actually a batch file which uses them), but the price is right - the images need to be resized first before running the batch file over them.

Another EDIT: DOH!  I just realised I already have a program on my computer that does this only it doesn't copy the EXIF info, (to expand: Analyzer copies EXIF data, however the Batch plugin loses it - I've just sent an email asking if he can implement it).
Image Analyzer with the Batch Plugin.  Image Analyzer is free, the unrestricted Batch Plugin is Donationware - donate what you like and you'll get the version that doesn't add a small watermark to your pics, (I donated ages ago to have the ability to DeSkew a lot of pics - still use it occasionally because it can handle maths expressions in the batch files).

eg. To scale and save as you were after, the batch file is, (could probably do a lot of tweaking for max image quality, etc):

SkipNextIf(Width>Height)
  goto(@ShortWidth)

SkipNextIf(Height<1001)
  Resize(round(1000*(Width/Height)),1000,Pixel)
goto(@SaveIt)

@ShortWidth
SkipNextIf(Width<1001)
  Resize(1000,round(1000*(Height/Width)),Pixel)

@SaveIt
SetJPEGQuality(100)
SetJPEGSizeLimit(1024000)
« Last Edit: May 04, 2008, 11:14:06 PM by 4wd »

suleika

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 117
    • View Profile
    • Donate to Member
Thanks for your post edits - there are programs to copy exif info across, I know, so it's not an absolute deal-breaker.  ImageAnalyzer itself looks interesting and the script works - definitely worth a look. 

PhilB66

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,513
    • View Profile
    • Donate to Member
ImageTasks was mentioned before and so was VSO Image Resizer (discussed here).

Mobaphoto is another tool that supports batch processing (freeware and portable)

2008-05-09_195951.jpg
2008-05-09_200206.jpg

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 6,763
    • View Profile
    • Donate to Member
Re: Batch image resizing, dimensions fixed, quality dependant on eventual file s
« Reply #13 on: September 27, 2008, 05:15:33 AM »
The app "Multiple Image Resizer" (http://www.multipleimageresizer.net/) will easily do the scaling ...

I tried this one today, "MIR", Multiple Image Resizer, because I read a description of the features, and got interested. However, I must say I cannot understand why this particular Image Resizer will not tell the dimensions of the image to be resized. How can I calculate the percentage resizing of a picture, if I don't know the dimensions? Well, in fact I can imagine many situations where the lack of this obvious information, would keep me from even thinking about resizing  in the first place!

Besides, I never managed to get the program to work properly  anyway.
Tested, and removed.
« Last Edit: September 27, 2008, 05:18:43 AM by Curt »

CWuestefeld

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 976
    • View Profile
    • Revolution Calling
    • Donate to Member
I cannot understand why this particular Image Resizer will not tell the dimensions of the image to be resized. How can I calculate the percentage resizing of a picture, if I don't know the dimensions?
I'm not sure why you'd care to calculate the percentage. MIR is perfectly happy to be told to resize to some absolute dimensions, or even to fit the target into some bounding dimensions.

I think there's a good reason that MIR doesn't show the dimensions of your image. That's because the program is designed to operate on whole batches of images. In that context, there isn't any particular image whose dimensions it can point to; it's got a heap of images, each (potentially) having its own dimensions.