Every finished painting brings the same cleanup. I export a PNG, make a smaller web copy, create a grayscale version to check values, pull a palette for later, and rename files so future me can find them. None of it is creative work, and it interrupts the moment when I should be stepping back to judge the piece.

So I built a small folder watcher. I drop or export a PNG into one folder, and a script handles the rest: a web-ready WebP capped at 2000px on the long side, a grayscale value check, a palette strip of six dominant colors, and a JSON sidecar with size, date, and palette hex codes. It is roughly 80 lines of Python and runs in a terminal tab while I paint. If you prefer a live browser workflow, Halsion Paint's browser-based painting agent can export web-ready copies and make value-check variants beside your canvas.

Folder layout showing one exported PNG beside generated web, value-check, and palette files
One export in, four files out. I leave generated files alone.

Why painters benefit

The grayscale copy gets the most use. Squinting at a canvas helps, but after three hours you can fool yourself. A desaturated copy that appears beside the original on every save is an honest second opinion. If the focal point vanishes in grayscale, I usually have a value problem, not a color problem.

The palette strip started as a gimmick. Now I use it to compare pieces from the same series, spot color drift, and drop references into mood boards.

A painted landscape beside its grayscale version and a six-swatch palette strip
Original, value check, and palette strip generated on save.

How the watcher works

The stack is intentionally boring: Python, the Pillow image processing library for image work, and the watchdog Python file watcher to react to new files.

pip install pillow watchdog 

1. Wait until the file is finished

Painting apps often write large files in chunks. Process too early and you get a truncated image or an error. I poll the file size until it stops changing:

import time from pathlib import Path def wait_until_stable(path: Path, checks=3, delay=0.5): last = -1 stable = 0 while stable < checks: size = path.stat().st_size stable = stable + 1 if size == last else 0 last = size time.sleep(delay) 

2. Process the export

import json from datetime import datetime from pathlib import Path from PIL import Image, ImageOps, ImageDraw OUT = Path('processed') OUT.mkdir(exist_ok=True) def get_palette(img, n=6): small = img.convert('RGB').resize((200, 200)) q = small.quantize(colors=n, method=Image.Quantize.MEDIANCUT) raw = q.getpalette()[: n * 3] counts = dict((c, idx) for c, idx in q.getcolors()) ordered = sorted(range(n), key=lambda i: -counts.get(i, 0)) return [tuple(raw[i * 3 : i * 3 + 3]) for i in ordered] def palette_strip(colors, w=120, h=120): strip = Image.new('RGB', (w * len(colors), h)) draw = ImageDraw.Draw(strip) for i, c in enumerate(colors): draw.rectangle([i * w, 0, (i + 1) * w, h], fill=c) return strip def process(path: Path): wait_until_stable(path) stem = path.stem img = Image.open(path) web = img.convert('RGB') web.thumbnail((2000, 2000)) web.save(OUT / f'{stem}_web.webp', quality=85) ImageOps.grayscale(img.convert('RGB')).save(OUT / f'{stem}_values.png') colors = get_palette(img) palette_strip(colors).save(OUT / f'{stem}_palette.png') meta = { 'source': path.name, 'size': img.size, 'processed': datetime.now().isoformat(timespec='seconds'), 'palette': ['#%02x%02x%02x' % c for c in colors], } (OUT / f'{stem}.json').write_text(json.dumps(meta, indent=2)) print(f'done: {path.name}') 

3. Watch the folder

from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler class Handler(FileSystemEventHandler): def on_created(self, event): p = Path(event.src_path) if not event.is_directory and p.suffix.lower() == '.png': process(p) if __name__ == '__main__': watch = Path('exports') watch.mkdir(exist_ok=True) obs = Observer() obs.schedule(Handler(), str(watch), recursive=False) obs.start() print(f'watching {watch.resolve()}') try: while True: time.sleep(1) except KeyboardInterrupt: obs.stop() obs.join() 

Point your painting app's export or autosave-to-PNG action at exports/ and you are done.

Lessons from daily use

Color profiles matter. Converting to RGB without handling an embedded profile can shift colors, especially in a wide-gamut painting. For web copies I accept that. When color accuracy matters, I convert with the profile intact using ImageCms.

Grayscale is not one thing. Pillow's grayscale uses luminance weighting, close to perceived brightness, but it will not match every app's desaturate filter. I treat it as a sanity check, not a measurement.

Quantized palettes are suggestions. Median-cut finds common colors, not important ones. A tiny vivid accent might get averaged away. I read the strip as a whole-canvas summary, not a list of the colors I deliberately chose.

Keep originals out of the output folder. My first version wrote results beside the source and triggered the watcher again. A separate processed/ folder fixed that, and I only react to created events in exports/.

A terminal window logging several finished exports while a painting app is open beside it
The terminal sits on a second monitor and quietly logs each save.

Possible next upgrades

  • Add a contact sheet that tiles the last ten value checks for series comparison
  • Flag images whose grayscale histogram is too narrow, a cheap “this looks flat” warning
  • Watermark the web copy automatically for portfolio posts
  • Keep a running palette log to see how color habits change over a year

If you paint in the browser, Halsion Paint browser painting workflow offers another route: an agent beside your canvas can export web-ready copies, create value-check variants, and verify saved results on request while the project stays editable. You skip folder watching, but work inside a live session.

Final thoughts

This did not make my paintings better by itself. It removed repetitive chores so I could spend more attention on the canvas. The value-check copy has also caught problems I would have missed.

If you paint digitally and write a little code, a small automation like this is a good first project. It is low-stakes, useful daily, and easy to tailor. If you build your own version, I would like to hear which chores you automated first.