GumletGumlet logo
Pricing
Login
Book a Demo
Signup

Image Optimization

2 min read

How to batch convert images using a macOS terminal?

Convert multiple images at once with the terminal on your Mac! Learn how to batch-convert images with a few simple commands. Get tips on automating the process and optimizing your workflow.

Aditya Patadia 

Updated on Jun 19, 2024
How to batch convert images using a macOS terminal?

Share this Article

Gumlet offers advanced image optimization and processing, including auto-format conversion, network-aware compression, and responsive resizing. These features enhance site performance by reducing bandwidth usage, speeding up page loads, and improving web vitals. Deliver retina-ready images across Apple devices in the latest format with Gumlet. Signup now; it's free.

MacOS preview application provides a very easy way to convert and process images if you want a quick way to convert a few images. This article by MacRumors describes an easy way to achieve it.

This becomes a problem if you ever want to convert large number of images. Opening thousands of images and then converting them using preview will mostly end up hanging mac for saveral minutes.

There is however a very handy command line utility called sips that comes built-in macOS and provides an easy way to convert thounsands of images in efficient manner.

Command Structure

To convert single file with sips, here is command syntax:

sips -s format [image type] [file name] --out [output file]

For example if you want to convert file named test.png, here is sips syntax:

sips -s format jpeg test.png --out test.jpg

Batch Convert

This command does not take multiple inputs but it's super easy to convert multiple files with shell scripting:

for i in *.png; do sips -s format jpeg $i --out Converted/$i.jpeg;done

Convert to HEIF / HEIC

It's also possible to convert all jpeg images to HEIC to save space before storing them. HEIC images will be 30-50% smaller for same quality as JPEG.

for i in *.jpg; do sips -s format heic -s formatOptions 75 $i --out converted/$i.heic;done

This command will convert images to heic and put converted images to "converted" folder. Here, the formatOptions argument sets output quality for the image. Value of 0 means most compressed and 100 means lossless.

A 3-second delay in page load time leads to upto 60% drop in traffic. Find out how fast your website will load with Gumlet’s industry-leading image optimization.

Analyze my site

Supported Formats

Sips supports large number of image formats. Here is a table on supported formats.

Format Read / Write
pdf Writable
psd Writable
icns Writable
gif Writable
exr Writable
bmp Writable
dds Writable
ico Writable
tga Writable
astc Writable
ktx Writable
heic Writable
heics Writable
jpeg Writable
jp2 Writable
pbm Writable
png Writable
pvr Writable
tiff Writable
dng Read
pict Read
cr2 Read
cr3 Read
crw Read
dxo Read
erf Read
raf Read
3fr Read
fff Read
dcr Read
mrw Read
mos Read
raw Read
rwl Read
nrw Read
nef Read
orf Read
orf Read
orf Read
raw Read
rw2 Read
pef Read
iiq Read
srw Read
sgi Read
arw Read
srf Read
sr2 Read
webp Read
avci Read
heif Read
mpo Read
pic Read

With a few clicks and a JS plugin, Gumlet has optimized images of 6000+ sites and apps by an average of 68% optimization.   

Try for free

Similar readings

image-682338e11f2c04000f430f54
AVIF vs. WebP: Which Image Format Is Better?
Posted on May 13, 2025
image-6704366b3baf71000ee29c43
SVG vs PNG: Key Differences, Benefits, and Use Cases
Posted on Oct 07, 2024
image-66e41b3cc6c158000f4acba8
JPEG vs PNG: Which is the Best Image Format?
Posted on Sep 13, 2024
Images or videos loading slow?

We compress them so that your users don't need to wait.

Try Gumlet

Images or videos loading slow?We compress them so that your users don't need to wait.  Try Gumlet →

Ready to get started?

Sign up and start optimizing your videos by up to 57% with Gumlet. No credit card required. Reach out to contact sales or to get a custom pricing estimate that fits your needs.

Start now Contact sales →
Optimizing videos is hard, but our pricing is not
Simple per-minute pricing with no hidden fees.
Pricing details →
Effortlessly integrate Gumlet into your existing stack
Upload with API and set webhooks for output in minutes.
Integragtion guide →

Footer

Gumlet Company logo
USA

Gumlet LLC
8 The Green, Dover, DE 19901

Singapore

Gumlet Pte Ltd
20A, Tanjong Pagar Road, Singapore (088 443)

Gumlet aicp logoGumlet soc2 logoGumlet iso logo
PRODUCT
  • Video Overview
  • Video Analytics
  • DRM Video Protection
  • Video CMS
  • Video Protection
  • Video Player Customization
  • Video Streaming
  • Video Transcoding
  • Video DRM
  • Online Video Hosting
  • Image Optimization
  • No-code Integration
  • Wordpress
  • Vimeo Alternative
  • Cloudinary Alternative
  • Imgix Alternative
  • Wistia Alternative
RESOURCES
  • Blog
  • Learn
  • Glossary
  • Tools
  • Startup Credits
  • Why Gumlet
  • Webinars
  • Documentation
  • Howdrm.works
SUPPORT
  • Product Updates
  • Feedback
  • Community
  • Become an Affiliate
  • Contact Us
  • Service Status
COMPANY
  • Pricing
  • About Us
  • Customers
  • Careers
  • Press Kit

© 2025 Gumlet Pte. Ltd.

Privacy Policy

Terms of Service