Easily Resize Multiple Images Using the Mac Terminal

Corey Schafer · Beginner ·📰 AI News & Updates ·11y ago

Key Takeaways

This video demonstrates how to resize multiple images using the Mac Terminal, specifically using the sips command to alter image sizes while maintaining aspect ratios, and also shows how to rename files in bulk.

Full Transcript

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 like to use a 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 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 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 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 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 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 and then it's going to 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 you

Original Description

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/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Corey Schafer · Corey Schafer · 27 of 60

1 Web fonts using CSS Font Face
Web fonts using CSS Font Face
Corey Schafer
2 Using Font Awesome in Desktop Applications (OS X)
Using Font Awesome in Desktop Applications (OS X)
Corey Schafer
3 Sublime Text 2: Setup, Package Control, and Settings
Sublime Text 2: Setup, Package Control, and Settings
Corey Schafer
4 ArcGIS API for JavaScript Part 1: Our First Web Map
ArcGIS API for JavaScript Part 1: Our First Web Map
Corey Schafer
5 Mac Tip: Windows' Snapping Feature on Mac with HyperDock
Mac Tip: Windows' Snapping Feature on Mac with HyperDock
Corey Schafer
6 Linux/Mac Terminal Tutorial: Creating Aliases for Commands
Linux/Mac Terminal Tutorial: Creating Aliases for Commands
Corey Schafer
7 ArcGIS API for JavaScript Part 2: Starting Templates
ArcGIS API for JavaScript Part 2: Starting Templates
Corey Schafer
8 Paver Patio Time Lapse
Paver Patio Time Lapse
Corey Schafer
9 Mac Tip: Ways to perform Screen Capturing and Screenshots
Mac Tip: Ways to perform Screen Capturing and Screenshots
Corey Schafer
10 WordPress Plugins: Imsanity
WordPress Plugins: Imsanity
Corey Schafer
11 WordPress Tips: Test your theme with Theme Unit Test and Monster Widget
WordPress Tips: Test your theme with Theme Unit Test and Monster Widget
Corey Schafer
12 Sublime Text 3: Setup, Package Control, and Settings
Sublime Text 3: Setup, Package Control, and Settings
Corey Schafer
13 Understanding Binary, Hexadecimal, Decimal (Base-10), and more
Understanding Binary, Hexadecimal, Decimal (Base-10), and more
Corey Schafer
14 Mac Tip: Adding Folder Stacks to the Dock
Mac Tip: Adding Folder Stacks to the Dock
Corey Schafer
15 CSS Tips and Tricks: Add External URLs to Print Stylesheets
CSS Tips and Tricks: Add External URLs to Print Stylesheets
Corey Schafer
16 JavaScript Arrays: Properties, Methods, and Manipulation (Part 7 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 7 of 7)
Corey Schafer
17 JavaScript Arrays: Properties, Methods, and Manipulation (Part 1 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 1 of 7)
Corey Schafer
18 JavaScript Arrays: Properties, Methods, and Manipulation (Part 5 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 5 of 7)
Corey Schafer
19 JavaScript Arrays: Properties, Methods, and Manipulation (Part 4 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 4 of 7)
Corey Schafer
20 JavaScript Arrays: Properties, Methods, and Manipulation (Part 3 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 3 of 7)
Corey Schafer
21 JavaScript Arrays: Properties, Methods, and Manipulation (Part 2 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 2 of 7)
Corey Schafer
22 JavaScript Arrays: Properties, Methods, and Manipulation (Part 6 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 6 of 7)
Corey Schafer
23 Python Tutorial: if __name__ == '__main__'
Python Tutorial: if __name__ == '__main__'
Corey Schafer
24 Sublime Text Quick Tip: "Go To Definition" Click Shortcut
Sublime Text Quick Tip: "Go To Definition" Click Shortcut
Corey Schafer
25 How to quickly create favicons for the desktop, Apple/Android devices, tablets, and more
How to quickly create favicons for the desktop, Apple/Android devices, tablets, and more
Corey Schafer
26 Easily Resize Multiple Images Using Picasa
Easily Resize Multiple Images Using Picasa
Corey Schafer
Easily Resize Multiple Images Using the Mac Terminal
Easily Resize Multiple Images Using the Mac Terminal
Corey Schafer
28 Python Tutorial: virtualenv and why you should use virtual environments
Python Tutorial: virtualenv and why you should use virtual environments
Corey Schafer
29 Python Tutorial: pip - An in-depth look at the package management system
Python Tutorial: pip - An in-depth look at the package management system
Corey Schafer
30 Git Tutorial: Using the Stash Command
Git Tutorial: Using the Stash Command
Corey Schafer
31 How Software Engineers, Developers, and Designers can volunteer their skills
How Software Engineers, Developers, and Designers can volunteer their skills
Corey Schafer
32 Git Tutorial: Diff and Merge Tools
Git Tutorial: Diff and Merge Tools
Corey Schafer
33 Git Tutorial: Change DiffMerge Font-Size on Mac OSX
Git Tutorial: Change DiffMerge Font-Size on Mac OSX
Corey Schafer
34 Sublime Text Quick Tip: Launch Sublime Text from the Terminal
Sublime Text Quick Tip: Launch Sublime Text from the Terminal
Corey Schafer
35 Python Tutorial: str() vs repr()
Python Tutorial: str() vs repr()
Corey Schafer
36 Programming Terms: DRY (Don't Repeat Yourself)
Programming Terms: DRY (Don't Repeat Yourself)
Corey Schafer
37 Programming Terms: String Interpolation
Programming Terms: String Interpolation
Corey Schafer
38 Programming Terms: Idempotence
Programming Terms: Idempotence
Corey Schafer
39 Python Tutorial: Namedtuple - When and why should you use namedtuples?
Python Tutorial: Namedtuple - When and why should you use namedtuples?
Corey Schafer
40 Programming Terms: Mutable vs Immutable
Programming Terms: Mutable vs Immutable
Corey Schafer
41 Python Tutorial: Else Clauses on Loops
Python Tutorial: Else Clauses on Loops
Corey Schafer
42 Overview of Online Learning Resources
Overview of Online Learning Resources
Corey Schafer
43 Mac OS X Terminal Tutorial: Time-Saving Keyboard Shortcuts
Mac OS X Terminal Tutorial: Time-Saving Keyboard Shortcuts
Corey Schafer
44 Git Tutorial for Beginners: Command-Line Fundamentals
Git Tutorial for Beginners: Command-Line Fundamentals
Corey Schafer
45 Quickest and Easiest Way to Run a Local Web-Server
Quickest and Easiest Way to Run a Local Web-Server
Corey Schafer
46 Python Tutorial: Generators - How to use them and the benefits you receive
Python Tutorial: Generators - How to use them and the benefits you receive
Corey Schafer
47 Python Tutorial: Comprehensions - How they work and why you should be using them
Python Tutorial: Comprehensions - How they work and why you should be using them
Corey Schafer
48 Chrome Quick Tip: Quickly Bookmark Open Tabs for Later Viewing
Chrome Quick Tip: Quickly Bookmark Open Tabs for Later Viewing
Corey Schafer
49 Programming Terms: Combinations and Permutations
Programming Terms: Combinations and Permutations
Corey Schafer
50 Git Tutorial: Difference between "add -A", "add -u", "add .", and "add *"
Git Tutorial: Difference between "add -A", "add -u", "add .", and "add *"
Corey Schafer
51 Preparing for a Python Interview: 10 Things You Should Know
Preparing for a Python Interview: 10 Things You Should Know
Corey Schafer
52 SQL Tutorial for Beginners 1: Installing PostgreSQL and Creating Your First Database
SQL Tutorial for Beginners 1: Installing PostgreSQL and Creating Your First Database
Corey Schafer
53 SQL Tutorial for Beginners 2: Creating Your First Table
SQL Tutorial for Beginners 2: Creating Your First Table
Corey Schafer
54 SQL Tutorial for Beginners 3: INSERT - Adding Records to Your Database
SQL Tutorial for Beginners 3: INSERT - Adding Records to Your Database
Corey Schafer
55 Linux/Mac Terminal Tutorial: Navigating your Filesystem
Linux/Mac Terminal Tutorial: Navigating your Filesystem
Corey Schafer
56 Python: Ex Machina Easter Egg - Hidden Message within the Code
Python: Ex Machina Easter Egg - Hidden Message within the Code
Corey Schafer
57 Mac Tip: New Split Screen Feature in El Capitan
Mac Tip: New Split Screen Feature in El Capitan
Corey Schafer
58 Setting up a Python Development Environment in Eclipse
Setting up a Python Development Environment in Eclipse
Corey Schafer
59 Git Tutorial: Fixing Common Mistakes and Undoing Bad Commits
Git Tutorial: Fixing Common Mistakes and Undoing Bad Commits
Corey Schafer
60 SQL Tutorial for Beginners 4: SELECT - Retrieving Records from Your Database
SQL Tutorial for Beginners 4: SELECT - Retrieving Records from Your Database
Corey Schafer

This video teaches how to use the Mac Terminal to resize multiple images quickly and efficiently, and also covers bulk renaming of files. It's a useful skill for anyone who needs to process large numbers of images, such as web developers or graphic designers.

Key Takeaways
  1. Open the Mac Terminal
  2. Navigate to the directory containing the images to be resized
  3. Use the sips command with the -Z option to resize images while maintaining aspect ratios
  4. Specify the desired image size using the -Z option
  5. Use the * wildcard to select all images in the directory
  6. Run the command to resize the images
  7. Optionally, use the -o option to specify an output directory for the resized images
  8. Use a separate command to rename the resized images in bulk
💡 The sips command with the -Z option allows for easy resizing of multiple images while maintaining their aspect ratios, making it a useful tool for image processing tasks.

Related AI Lessons

When AI Asks for More Electricity Than a Country Can Imagine
AI's increasing power consumption is causing concerns, learn why it matters for data centers and energy supply
Medium · AI
You Are Not Behind. The World Is.
You're not behind, the world is still adapting to AI, and it's okay to take your time to learn and grow
Medium · AI
Career choice with the advent of AI - pure Computer Science or learn software with a background of core engineering area
Learn how to choose between a Computer Science and Engineering career path or combining programming with a core engineering background in the age of AI
Dev.to AI
The AI Hype Cycle: Calm Before the Next Breakthrough?
Understand the AI hype cycle to anticipate the next breakthrough and make informed decisions
Medium · Programming
Up next
Motorist saved by human chain | 9 News Australia
9 News Australia
Watch →