developers

code.
not clicks.

The HM photo engine ships as two libraries that share one recipe format: hmcore for Python and HMCoreKit for iOS 17+ and macOS 14+. It is licensed separately to businesses; HM GUI for Mac is built on it.

python.

import hmcore as hm
from hmcore import retouch

img = hm.load_image("guest.heic")
out, recipe = retouch.auto_portrait(img, level="natural")
hm.save(out, "guest.jpg")          # 8-bit in, 8-bit out
recipe.save("guest.json")          # every step, editable

preview = recipe.apply(img, preview=1170)   # screen size

Swift.

import HMCoreKit

let img = try HMImage.load(url: photoURL)
let recipe = try Recipe.load(recipeURL)
let preview = try MetalRenderer()
    .apply(recipe, to: img)                // GPU
try recipe.apply(img)
    .write(url: outURL, bitDepth: 16)      // ICC embedded

the recipe.

Steps run in order, and parameters are the op's own. Masks travel inside a recipe as lossless 16-bit PNG, and local edits, liquify and face data are part of the format. Automatic tools store their results as numbers, so a replay never has to guess.

// look.json: made on the Mac, replayed on iPhone
{
  "hm_recipe": 1,
  "name": "HM Portrait (natural)",
  "steps": [
    { "op": "spot_heal", "points": [[812, 640, 9]] },
    { "op": "smooth_skin", "strength": 0.35, "texture": 0.5 },
    { "op": "enhance_eyes", "strength": 0.25 },
    { "op": "white_balance", "temperature": 5600 },
    { "op": "curves", "points": [[0,0],[.5,.56],[1,1]] }
  ]
}

the hand-off.

How an AI editor drives HM GUI for Mac. Everything happens in one folder, ~/Pictures/HM GUI/AI: no port, no socket, no account. HM GUI reads that folder only while the AI Automation bar's switch is on, and the switch is off again every time the app starts.

what the AI reads

state.json is the open picture — size, color space, layers. ops.json is every tool the app has, with each setting's range and default. preview.jpg is the picture as it looks right now.

what it writes

A recipe into inbox/, first as name.json.tmp and then renamed, so HM GUI never reads half a file.

what comes back

HM GUI plays the recipe on the front picture, moves it to done/ and writes done/name.result.json: whether it worked, which step failed and why if it didn't, and any files it exported. Then state.json and preview.jpg are updated, so the AI can look and decide its next step.

what it may not do

Only the ops in ops.json, at most 100 steps and 64 MB per recipe, no file paths inside steps, exports only into exports/, and symlinks ignored. All or nothing: if any step fails, the picture is unchanged.

Copy Prompt in the bar hands your AI editor these same instructions, so what it is told and what the app does can't drift apart.

command line.

hm retouch portrait guest.jpg out.jpg --save-recipe steps.json
hm retouch heal in.tif out.tif --points 812,640,9
hm bg replace in.jpg out.psd --background studio.tif --kind person
hm crop in.jpg out.jpg --aspect print_4x6 --auto --straighten
hm edit in.heic out.tif -r look.json --bit-depth 16
hm models verify

proof.

From the test suites, run on every change.

checktargetmeasured
Swift vs Python, 42 golden cases (CPU and GPU)ΔE2000 mean < 1.0, p99 < 3.0worst mean 0.08, typical 0.001
smart fill vs diffusion fill+3 dB PSNR+15.6 dB
hair-fringe cut-outalpha MSE < 0.020.006
12 MP one-tap portrait (Python, Apple silicon)< 3 s1.2 s
GPU preview frame, 1170×1560< 33 ms13 ms
auto straighten< 0.3°≤ 0.05°