# Easily Resize Multiple Images Using the Mac Terminal

## Метаданные

- **Канал:** Corey Schafer
- **YouTube:** https://www.youtube.com/watch?v=HVMOBKRNEbc
- **Дата:** 04.04.2015
- **Длительность:** 7:18
- **Просмотры:** 10,902

## Описание

One problem I run into frequently is needing to resize multiple images at once. To do this manually would take way too much time, especially if you have a lot of images.

Luckily, there are several good tools out the to automate this process for us. In this video we will be resizing multiple images using the Mac Terminal and the built-in "sips" command.

If you are someone who is more comfortable using an application rather than the terminal, I also have a video on resizing multiple images using Google's Picasa. You can find that video here:
http://youtu.be/43eOoHpUW44


✅ Support My Channel Through Patreon:
https://www.patreon.com/coreyms

✅ Become a Channel Member:
https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join

✅ One-Time Contribution Through PayPal:
https://goo.gl/649HFY

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist
http://a.co/inIyro1

✅ Equipment I Use and Books I Recommend:
https://www.amazon.com/shop/coreyschafer

▶️ You Can Find Me On:
My Website - http://coreyms.com/
My Second Channel - https://www.youtube.com/c/coreymschafer
Facebook - https://www.facebook.com/CoreyMSchafer
Twitter - https://twitter.com/CoreyMSchafer
Instagram - https://www.instagram.com/coreymschafer/

## Содержание

### [0:00](https://www.youtube.com/watch?v=HVMOBKRNEbc) Segment 1 (00:00 - 05:00)

hey everybody how's it going in this video i'm going to show you how to quickly resize a lot of images using your terminal on your mac now i understand a lot of people don't like to use a terminal i used to not lot so if you're looking for another way to resize a lot of images like in an application or something i do have another video where i show how to do that in an application called picasa so if you're interested in that i will post the link to that video in the description but with that said i've never seen an easier way to resize a lot of images than this method that i'm going to show you in the terminal so with that let's go ahead and get started you can see here on my desktop i have three folders large medium and small if i open up this large folder all of these images that i have in here if i open these up in a preview then you can see that they're all high resolution large photos so what if we want to maybe for your website you want a large version of a photo a medium version and a small version that happens a lot especially whenever you're doing galleries and you need thumbnails or something like that so let's go ahead and i'm going to show you two different ways and how to do this if we open up this medium folder the first way i'm going to show you is by altering the original photo so i'm going to copy these and then i'm going to paste them into this medium folder and now these are still the same large photos in the medium folder so now let's close this down and now in my terminal here i'm going to right now i'm on my desktop if i do an ls command you can see this medium folder here i'm going to change directory into the medium folder now if i do another ls command now you can see all of my jpeg images now the ma the command that i'm going to use to change the size of all these photos is super easy it's just sips and then this capital z option and what the capital z option does is it maintains the aspect ratio because we don't want our pictures um you know getting elongated or anything like that with weird widths and heights so we wanted to maintain that aspect ratio so since this is a medium picture let's set this to 640 pixels um and the what we want to change is everything in this folder that's what the star is the wild card so everything in this folder with a dot jpeg and that's it let's just go ahead and hit enter and you see it'll go ahead and start that list and go through all those images now if i come over here to my folder and i select all these files and preview them now you can see that they're all resized to 640 pixels so now let me show you how to do this without altering the original so first let me change directory back to my large folder with all the large original images and if you remember last time whenever we did the medium photos first we copied all the larges and put them into the medium folder but now i'm going to show you we're in the large folder and i'm going to show you how to resize these images and put them directly into the small folder without doing any copying first so i'm just going to hit the up arrow a couple of times in my terminal to get back to that sips command and now since we're going to do the small photos i'm going to take these down to about 300 pixels and now it's the exact same command but right now we're in the large folder if we hit enter right now it would over write all of our large images with the 300 pixel images but instead you can put this out option on to the end and that's going to be an output directory of where all these images go so i can just put this onto my desktop and within the desktop i'm going to put that in this directory called small so i'll go ahead and hit enter and you can see it goes through all those images and now if i go over here and open up my small folder then we can see all the pictures are here and if i open them up in preview you can see that they are small 300 pixel images and so now basically at this point if all you're trying to do is resize your images then you're done you have your folder here with your large and then your medium and your small and you can resize those to any pixel mounts that you want one thing i want to add on here though is usually when people do this and they do large medium and small versions of their files usually they also want to rename the files because they don't if they're putting them up on their web server they want their large medium and

### [5:00](https://www.youtube.com/watch?v=HVMOBKRNEbc&t=300s) Segment 2 (05:00 - 07:00)

smalls to all be named something different so that's a little outside of the scope of this video so i'm going to show you how to do it but i'm not going to really explain it very much i have this command here that i've just copied and pasted in here and let me go into first let me go change directory into my small folder and i'm going to rename all these so let me open this up and right now if i was to do an ls on this directory you can see that these are all named exactly the same thing that my large images are named now if we wanted to distinguish these and say okay let me clear this out okay now um pretty much what this does is it finds all the files in this current directory that i'm in you have to make sure that you're within your small directory if you run this command because you don't want it to change files that you don't plan it to change but within the directory that i want to change the file names i execute this statement here that pretty much it will disregard the extension right here and then it's going to tack on a 300 also add back the extension here at the end so if i hit enter there and now i rerun that ls command again now you can see that all the file names here have a 300 tacked onto the end of it um so yeah uh maybe i'll make a video that kind of explains uh the bulk renaming um in more in advance but i thought it was something i should also add to the bulk image resizing since it's most likely something that people are going to want to do with all the resized images is also rename those with the new image sizes so that about does it i hope that this tutorial was useful for you guys if you guys have any questions about this stuff feel free to ask in the comments section below be sure to subscribe for future videos and thank you for watching

---
*Источник: https://ekstraktznaniy.ru/video/12666*