brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: sips -s format jpeg converts HEIC photos to JPEG in the terminal

Terminal
~/tips/tip-terminal-sips-heic-to-jpeg

sips -s format jpeg -s formatOptions 80 *.heic --out jpg/

Turns iPhone HEIC photos into JPEG files that every website accepts.

iPhone photos arrive as HEIC, and plenty of upload forms still refuse them. The Mac can convert a whole folder with a built-in tool.

sips sets the output format with -s format. Point --out at a folder for a batch, which is how I’d do it:

sips -s format jpeg -s formatOptions 80 *.heic --out jpg/

Create the folder first with mkdir -p jpg, because sips won’t make it for you.

Each photo.heic becomes jpg/photo.jpg; sips fixes the extension itself and says so in a warning. formatOptions sets the JPEG quality as a percentage, or as low, normal, high or best. I find 80 a good middle for photos that go on the web.

The same works for other formats: -s format png for screenshots, or -s format heic the other way round. You can combine it with -Z 1600 in the same command to scale the image down while converting.

Mind the --out. Without it, sips writes the result over the original file. Always give an output folder for batches. Most metadata comes along, including location data if the photo has it, so strip that separately before you post photos taken at home.

Further reading: sips man page (macOS)

More Terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac mc hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}' All Terminal tips (116) All topics

Link