Have you ever downloaded a stock photo image file, but needed to resize the image in order to decrease the file size? So you open the image in Preview, select ‘Tools’ > ‘Adjust Size…’, enter a smaller size value, and the file size reads something like 825KB (was 2.1 MB). Then you save the file, go to it in Finder, and it’s only reduced to like 1.9MB or something not even close to 825KB. You’re like WTF! Why isn’t this file reducing?
These are just random numbers used to illustrate my point, but if you’ve had an experience like this you are not alone. I’m searching for the proper answer for reducing these file size and I’m not clear as to why some image files reduce in size as they say, and others just won’t drop their megabytes.
The typical graphic designer / Adobe addict approach would be to open the files in Photoshop, then save for web. Even with a good macro this is super annoying. The iHeart Apple user would open the file in Preview, export as a PNG, then open that PNG and export back to a JPG with the same name. You’ll achieve the file size reduction, but you’ll also waste away time in your life fussing with bullshit.
At TutorialShares.com we’re all about developing your skills as a power user. So with that in mind, let’s open up Terminal and a deadsimple workflow to get thing done.
I have a folder of images that need to be uploaded to my WordPress site, but the site says it’s limited to 2MB uploads per file and it’s only accepting files of 1.1MB and smaller.
Question: How can I batch reduce the file size of my stock photos with out resizing the images or using an intensive photo editing app (Photoshop)?
Answer: Scriptable Image Processing aka SIPS
Batch Convert any image file to JPG
mkdir jpegs; sips -s format jpeg *.* --out jpegs
cd into your image directory
make a new directory to put the newly formatted images in:
$ mkdir jpegs
run a sips command to convert all image files into the jpeg file format and save them to the jpegs directory you created in the previous step:
sips -s format jpeg *.* --out jpegs
now check out the file size in your jpeg directory
the files will be the size preview was showing them at in the adjust size window
Batch Convert JPG to PNG
mkdir pngs; sips -s format png *.* --out pngs
The fact that stock photo gaints like iStockPhoto.com are selling us these bloated files is poor form in my opinion. I really don’t understand why they don’t offer “Optimized for Web” version of their imagery. I’m sure they’ll give some excuse about copyrights, blah blah blah, but at then end of the day their selling us files intended to be used for web that aren’t web ready.