Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resize images using terminal on Mac OSX?

I need a simple and free way to resize images and do batch jobs, if necessary. Free image manipulation software has been trickier to use than it should be.

like image 334
Marcel Gruber Avatar asked Feb 12 '15 23:02

Marcel Gruber


People also ask

How do I resize an image in OSX?

Reduce an image's file size In the Preview app on your Mac, open the file you want to change. Choose Tools > Adjust Size, then select “Resample image.” Enter a smaller value in the Resolution field. The new size is shown at the bottom.

How do I resize an image to 5x7 on a Mac?

Select the image in Finder, right-click, and choose Open With > ColorSync Utility. At the top of the window, click the Adjust Image Size button. Choose scale, width, or height in the Resize dropdown and enter the value in the To box. You can optionally adjust the Quality and Set DPI settings.

How do I resize an image in text edit on a Mac?

TextEdit has no direct image editing options. You can, though, once you've added an image into the document, double click it to open it with Preview. Through Preview you'll be able to perform some basic image editing such as size adjustment (Tools / Adjust Size) or adding figures or text (View / Show Edit Toolbar).


2 Answers

As pointed out by LifeHacker, the following command will do this very easily:

sips -Z 640 *.jpg 

To quote their explanation:

"sips is the command being used and -Z tells it to maintain the image's aspect ratio. "640" is the maximum height and width to be used and "*.jpg" instructs your computer to downsize every image ending in .jpg. It's really simple and shrinks your images very quickly. Be sure to make a copy first if you want to preserve their larger size as well."

Source: http://lifehacker.com/5962420/batch-resize-images-quickly-in-the-os-x-terminal

like image 110
Marcel Gruber Avatar answered Nov 08 '22 22:11

Marcel Gruber


imagemagick helps:

$ convert foo.jpg -resize 50% bar.jpg 

There are a lot more things it can do, including the conversion between formats, applying effects, crop, colorize and much, much more.

like image 39
L3viathan Avatar answered Nov 08 '22 22:11

L3viathan