The command line

Everything Cobalt Photo does to many pictures at once, from a console, a .bat file or your own program — with the same formats, quality and care as its windows. No window opens.

Pro14 Min. Lesezeit

Diese Seite ist noch nicht übersetzt und wird daher auf Englisch angezeigt.

In der App: cobaltphoto /? in any console prints the help; its last line leads here.
cobaltphoto convert *.heic --to jpg
cobaltphoto resize D:\Site -r --long 1600 --replace
cobaltphoto find D:\Photos -r "stars:5 taken:2025" | cobaltphoto pdf --name "Best of 2025"

Start

The command comes with Cobalt Photo: type cobaltphoto in Command Prompt, PowerShell, Windows Terminal or a .bat file, in any folder. Windows makes it known to every console itself; nothing to set up or add to the path.

It is a console program: it opens no window and shows nothing in the taskbar. To turn the command off, Windows has Settings → Apps → Advanced app settings → App execution aliases, cobaltphoto.exe.

Files and folders

After the command come the pictures, as many as needed, in any mix:

TypedWhat it gives
photo.jpgThat picture.
"D:\Photos\2026"The pictures in the folder. With -r, those in its subfolders too.
*.heic, D:\Shots\IMG_*.pngThe pictures the mask matches — Command Prompt does not expand masks, so cobaltphoto does. With -r, in subfolders too.
nothing, with paths piped inThe paths, one per line: cobaltphoto find … | cobaltphoto clean.

It reads every picture Cobalt Photo opens: JPG, PNG, HEIC, WebP, AVIF, JPEG XL, TIFF, GIF, BMP, ICO, SVG, Photoshop, Krita, OpenRaster, TGA, macOS icons and the RAW files of over 600 cameras — all formats. Hidden and system files are left out, as Explorer does. A path in quotes may have spaces.

Options of every command

OptionWhat it does
-o, --out <folder>Where the new files go; the folder is made when it is not there. Without it, next to each original.
-r, --recurseFolders with their subfolders.
--replaceWrite over a file of the same name instead of making photo (2).jpg — or, for clean and resize, change the original itself. The old file goes to the Recycle Bin, so it can be put back. (A drive without a Recycle Bin, such as some memory cards, deletes it.)
--dry-runShow what would be done, file by file, and change nothing. Worth it before rename, --replace and import --move.
--jsonThe results as JSON, one line per file — what is in it.
-q, --quietOnly the files that failed and the summary.
--no-progressNo progress line. It is off anyway when the output goes to a file or a pipe.

convert — into another format

cobaltphoto convert <files> --to <format> [options]

The same as Convert: each picture upright, in the format asked for, next to the original or into -o. A RAW file's picture goes into a folder of the format's name beside it (JPEG), so it is not taken for the camera's own JPEG. The original is never changed. The place it was taken is never kept.

OptionWhat it does
--to jpg | png | webp | avif | jxl | heic | tiff | gif | bmp | ico | jxr | tga | pdfThe format. HEIC needs Windows' HEVC Video Extensions — why.
--quality 1–100For JPG, WebP, AVIF and JPEG XL. Without it: JPG as in Settings → Converter (85 as it comes), WebP 75, AVIF 65, JPEG XL 85.
--losslessWebP, AVIF and JPEG XL without loss.
--tiff lzw | zip | noneTIFF's compression (lzw as it comes).
--ico-sizes 16,32,48,256The sizes inside an ICO.
--pdf-page picture | a4 | letterA PDF's page: the picture's own size, A4 or Letter.
--pdf-eachOne PDF per picture (as it comes: one PDF of all — see also pdf).
--long 2048Made smaller: the long side, in pixels.
--percent 50Made smaller: a share of the size.
--size 1920x1080 with --fit crop | fit | stretchExactly that size: its middle cut to the shape (crop, as it comes), the whole of it fitted inside, or stretched.
--no-sharpenNo sharpening after making smaller.
--keep date-camera | date | noneWhat stays of the picture's data: the date and the camera (as it comes), the date, or nothing.
--mark "© Anna" or --mark-logo logo.pngA watermark: a text, or a logo — watermarks.
--mark-place bottom-right | bottom | bottom-left | top-right | top | top-left | left | middle | right | all-overWhere it is drawn (bottom-right as it comes).
--mark-size 4, --mark-opacity 75, --mark-darkIts height in percent of the short side; how opaque it is (10–100); dark letters with a light glow.
--developA RAW file developed from its sensor data, not the camera's JPEG inside it — RAW. With it: --auto-white (white balance by the picture), --vivid, --noise off | low | strong, --no-bright-sky.
cobaltphoto convert *.heic --to jpg
cobaltphoto convert D:\Shots -r --to webp --long 1600 --mark "© Anna" -o D:\Web
cobaltphoto convert logo.png --to ico --ico-sizes 16,32,48
cobaltphoto convert *.cr3 --develop --vivid --to tiff -o D:\Print

resize — smaller, or to an exact size

cobaltphoto resize <files> --long <pixels> | --percent <n> | --size <w>x<h> [options]

As the Manager's Resize: each picture in its own format, its data kept. Copies beside the originals with the size in their name (photo (1600 px).jpg), or into -o — or with --replace the originals themselves, the old ones to the Recycle Bin. A RAW file gets a JPG copy. An animation, an icon and a picture already that small are left as they are. Its options: --long, --percent, --size with --fit, --no-sharpen as for convert, and --quality for JPG.

cobaltphoto resize *.jpg --long 1600
cobaltphoto resize D:\Site -r --percent 50 --replace
cobaltphoto resize avatar.png --size 512x512 --fit crop

mail — smaller for mail

cobaltphoto mail <files> [--long <pixels>] [--quality 1–100]

The drop panel's Smaller for mail: a JPG small enough to send, large enough to look at, beside each picture as photo (small).jpg. The long side as in Settings (2048 as it comes), unless --long says.

cobaltphoto mail IMG_0412.heic IMG_0413.heic
cobaltphoto mail D:\Trip -o D:\ToSend

pdf — pictures into a PDF

cobaltphoto pdf <files> [--name <name>] [--page picture | a4 | letter] [--each]

One PDF of all the pictures, a page each, in the order given — named after their folder (or the one picture), or --name. With --each, one PDF per picture. Next to the first picture, or into -o.

cobaltphoto pdf scan*.jpg --name Contract --page a4
cobaltphoto pdf D:\Receipts --each -o D:\PDF

extract — frames and icon sizes

cobaltphoto extract <files> [--frame <n>] [--size <pixels>]

As the viewer's Save frame and Save size, as PNG with their transparency:

cobaltphoto extract anim.gif
cobaltphoto extract anim.webp --frame 12
cobaltphoto extract app.icns --size 256 -o D:\Icons

clean — without personal data

cobaltphoto clean <files> [--location-only] [--replace]

As the Manager's Clean: who, where and with what is taken out — the location, the camera's serial number, the author, comments — and what the picture needs to look the same stays, its date too. A JPG, PNG or WebP is not encoded again: only its data is cut out, and the result must open as the same picture before it is written. Other formats get a clean JPG.

cobaltphoto clean *.jpg -o D:\ToSend
cobaltphoto clean D:\Blog -r --location-only --replace

rotate — turn or flip

cobaltphoto rotate <files> right | left | 180 | flip-h | flip-v

Free. The files themselves are turned, as the viewer turns them. A JPG keeps every pixel: only its orientation tag changes, which every viewer and Windows follow. PNG, TIFF, BMP and GIF are written again without loss. RAW files and SVG are left as they are.

cobaltphoto rotate IMG_0412.jpg right
cobaltphoto rotate scans\*.png 180

meta — stars, labels, tags, text, dates

cobaltphoto meta <files> [what to set]

As the Manager's Metadata. Written into JPG and PNG themselves; RAW, HEIC, TIFF and WebP get an .xmp beside them, which Lightroom, darktable and the Manager read too. Only what is asked for changes; an empty value removes it: --title "".

OptionWhat it sets
--stars 0–5 | rejectedThe stars; 0 removes them, rejected marks it as rejected.
--label red | yellow | green | blue | purple | noneThe colour label.
--tags "sea,2026"These tags instead of its own.
--add-tags, --remove-tagsTags added to its own, or taken from them.
--title, --description, --author, --copyrightThe texts. Several authors with ; between them.
--taken "2026-10-12 14:30"The date taken, the same for all.
--shift +1h | -30m | +1d2hEach date taken moved — a camera's clock set wrong, or in another time zone.
--location 41.3851,2.1734Where it was taken: latitude, longitude.
--no-locationWhere it was taken removed.
cobaltphoto meta best\*.jpg --stars 5 --label green
cobaltphoto meta *.cr3 --shift -1h
cobaltphoto meta D:\Trip -r --add-tags "Rome,2026" --author "Anna"

rename — new names from a pattern

cobaltphoto rename <files> --pattern "{date}_{n}" [options]

As the Manager's Rename. The pattern's words:

WordBecomes
{date}, {time}When it was taken (or the file's date, when it has none).
{place}, {country}The town and country it was taken in, from its location.
{camera}The camera.
{name}, {folder}Its name now; its folder's name.
{n}A number, in the order taken.

A word the picture has nothing for is left out with its _ or -. A name taken gets (2). The RAW file, .xmp, .aae and Live Photo .mov of the same name are renamed with the picture. Options: --date iso | compact | dots | month (2026-10-12, 20261012, 12.10.2026, 2026-10), --start 1, --digits 3, --per-day (numbers start again each day), --order taken | name, --no-file-date, --lower-ext (.JPG becomes .jpg).

cobaltphoto rename *.jpg --pattern "{date}_{place}_{n}" --dry-run
cobaltphoto rename D:\Trip --pattern "{country} {date} {n}"

import — from a card into the library

cobaltphoto import <card or folder> [options]

As the Manager's Import & sort: the pictures and videos copied into the library, into folders by date or by trip, each copy checked byte by byte, its dates kept. The ones imported before are left out; a shot's RAW and JPEG stay together. A camera card (a drive with DCIM) is read with all its folders; another folder with -r.

OptionWhat it does
--to <library>Where they go — as it comes, the Manager's import's library (Pictures).
--layout year-month | year-day | day | trips | oneThe folders: 2026\2026-10 (as it comes), 2026\2026-10-12, 2026-10-12, 2026-10-12 Rome for trips, or straight into the library.
--trip-hours 24For trips: a longer gap between shots starts a new trip.
--allAlso the ones imported before.
--no-videosPictures only.
--rename "{date}_{n}"New names from a pattern, as rename.
--moveSort a folder: the files moved, not copied.
--deleteFrom the card after each checked copy.
cobaltphoto import E:\ --layout trips
cobaltphoto import D:\Downloads --move --to D:\Photos

duplicates — the same pictures

cobaltphoto duplicates <folders> [--series very | quite | little] [--small]

As the Manager's Duplicates search: byte-for-byte copies and the same picture in another size or format — and with --series, shots of a series that are almost the same. It only lists them, each group with its pictures, the largest first; it deletes nothing — what to delete is yours to choose, in the Manager or from --json in a script of your own. --small takes pictures under 256 px too.

cobaltphoto duplicates D:\Photos -r
cobaltphoto duplicates D:\Photos D:\Downloads -r --json > duplicates.json

find — pictures by what they are

cobaltphoto find <folders> "<query>"

The Manager's search, in the same words. It prints the paths that match, one per line — for a file, or a pipe into another command. Without a folder, the current one.

QueryFinds
taken:2025, taken:jan, taken:>2024-06-01, taken:7dWhen taken: a year, a month, after a day, the last 7 days.
camera:sony, camera:noneThe camera.
in:barcelona, in:"new york"~10km, gps:noWhere: a town, region or country, near a place; with or without a location.
stars:>=4, label:red, tag:seaStars, colour label, tag.
res:4k, orient:portrait, mp:>=12Size in pixels, shape, megapixels.
size:>5mb, type:raw, modified:yesterdayThe file's size, kind, when it changed.
time:evening, -*.png, match:anyTime of day; - leaves out; match:any for any of the conditions instead of all.
cobaltphoto find D:\Photos -r "stars:5 taken:2025"
cobaltphoto find D:\Photos -r "gps:yes" | cobaltphoto clean --location-only
cobaltphoto find D:\Photos -r "type:raw taken:<2020" > old-raw.txt

info — what a picture is

cobaltphoto info <files> [--json]

Free. Its kind, size in pixels and bytes; when and with what it was taken (camera, lens, focal length, aperture, shutter, ISO); where, with the town and the height; its stars, label, tags, title and author; an animation's frames, an icon's sizes.

cobaltphoto info IMG_0412.jpg
cobaltphoto info D:\Trip -r --json > trip.json

wallpaper and lockscreen

cobaltphoto wallpaper <file> [--fit fill | fit | stretch | center | tile]
cobaltphoto lockscreen <file>

Free. One picture as the desktop background on every monitor (fill as it comes), or as the lock screen's picture. Any picture Cobalt Photo opens: it is made an upright JPG first, in Cobalt Photo's own folder, so the original can move or go.

What it writes

A line about what is about to be done, a line per file — ✓ with what was made, or ✗ with why not — then the summary: how many, how long, the sizes before and after. Under the lines a progress bar counts on: how far, how many of how many, how many failed, about how long is left. Windows Terminal shows the same progress on its tab and its button in the taskbar. When the output goes to a file or a pipe, there is no progress bar and no colour; find then writes the paths alone.

--json

One JSON object per line, nothing else on the output — for ConvertFrom-Json in PowerShell, jq, or any program. Letters outside English are written as \u escapes, so the lines read the same in any console.

CommandEach line
convert, resize, mail, pdf, extract, clean, rotate, meta, rename, import{"file": …, "ok": true, "made": …, "note": …}, or {"file": …, "ok": false, "error": …}
infofile, format, width, height, bytes, taken, camera, lens, exposure, fnumber, iso, focal, latitude, longitude, altitude, place, stars, label, tags, title, description, author, frames, seconds, sizes — what it does not know is null.
duplicatesA group: {"kind": "exact" | "same" | "series", "bytes": …, "files": [{"path", "width", "height", "bytes"}, …]}
find{"path": …}

Exit codes

CodeMeans
0Done: every file.
1Some files failed, or were not found — the others are done.
2A wrong command or option: nothing was done. The error says which.
3The command is Pro's, and Pro is not open: nothing was done.
4No pictures to work on — or find found none.

In scripts

A .bat file that converts what is dropped on it and says when something failed:

@echo off
cobaltphoto convert %* --to jpg --long 2048 -o "%USERPROFILE%\Desktop\For mail"
if errorlevel 1 pause

PowerShell, reading the results:

$big = cobaltphoto info D:\Photos -r --json | ConvertFrom-Json | Where-Object { $_.width -ge 6000 }
$big | ForEach-Object { $_.file }

In Windows PowerShell 5.1, a pipe between two programs passes only English letters unless $OutputEncoding = [Text.Encoding]::UTF8 is set first; PowerShell 7, Command Prompt and --json need nothing.

Pro

rotate, info, wallpaper and lockscreen are always free, as the viewer is. The other commands are Cobalt Photo Pro's, as in the app's windows: open in the 14-day trial and with a subscription. Without it, such a command says so, does nothing and ends with code 3. A subscription just bought counts at once: the command asks the Microsoft Store when Pro looks closed.