An image editor with an API (preferably python-oriented)
Preview supports AppleScript which allows you to open and save files from CLI. There are commands for open and save.

For example, to open a file with Preview:



tell application "Preview"
    open "/path/to/file.png"
end tell


You can run AppleScript as a script file, or from the command line using osascript -e "…".

osascript -e "tell application \"Preview\"" -e "open \"/path/to/file.png\"" -e "end tell"


You can find the full Preview AppleScript dictionary by opening Script Editor.app (from the Utilities folder), choosing File → Open Dictionary and selecting Preview. This will show you many of the commands that Preview supports with the syntax for how to use them.