Skip to content

Edit in External App: round-trip a layer through Topaz Gigapixel (or any app) - #197

Open
Fvzion wants to merge 1 commit into
robbietilton:mainfrom
Fvzion:feature/external-editor
Open

Fvzion wants to merge 1 commit into
robbietilton:mainfrom
Fvzion:feature/external-editor

Conversation

@Fvzion

@Fvzion Fvzion commented Sep 30, 2026

Copy link
Copy Markdown

The problem today

Upscaling or denoising a layer with Topaz Gigapixel AI or Photo AI means exporting it, opening it in Topaz, saving, importing the result back as a new layer, and resizing the canvas to fit it. Photoshop does this in one step through Topaz's Automate plug-ins; Compositor has no plug-in API, and Gigapixel's command line needs its Pro licence.

What changes for the user

Filter › Edit in External App lists Topaz Gigapixel AI and Topaz Photo AI when they're installed, plus Other App… for any app (remembered).

  1. The active layer is written as PNG to a folder picked once, kept as a security-scoped bookmark. The sandbox's own tmp would trigger macOS's "access data from other apps" prompt.

  2. It opens in the app. A banner shows the wait, with Import File… for a result saved elsewhere and Cancel.

  3. When the app saves a new file whose name starts with the original's (Gigapixel's suffixes, any extension) and it stops growing, Compositor comes to the front and brings it in, in one undo step:

    • as a new layer above the original, which is hidden rather than replaced;
    • with the canvas enlarged so an upscaled result shows at its full resolution. Only transforms change, so other layers keep their pixels.

    Both are on by default and can be turned off in the same submenu (Keep Original Layer, Enlarge Canvas to Fit Result). Closing the tab cancels the wait.

How to try it

  1. With Topaz Gigapixel AI installed, select an image layer and choose Filter › Edit in External App › Topaz Gigapixel AI; pick a folder when asked.
  2. Upscale ×2 in Gigapixel and save (its default name adds a suffix).
  3. Compositor comes forward with the result as a new layer at full size, the canvas twice as large, and the original hidden below; ⌘Z undoes it all at once.

In the code

  • IO/ExternalEditor.swift: the app presets (Topaz renamed its bundles over the years, so each is listed under every identifier), the folder bookmark, writing the PNG, and watching the folder for a finished result.
  • Document/EditorSession+ExternalEdit.swift: sending, importing (through the existing importer and its limits) and cancelling, and CanvasDocument.scaled(by:) for enlarging.
  • UI/ExternalEditBanner.swift, one submenu in CompositorApp.swift, and one entitlement (files.bookmarks.app-scope).
  • ExternalEditTests (12 tests): which files count as the result, safe unique names, the result as a new layer over the hidden original at full size or in place as one undo step, the layer mask resampled onto the new pixels, transparency restored when the app flattens it, a layer changed during the wait, a closed document, and the folder watcher waiting for a finished file.

Used with Topaz Gigapixel AI 8.0.3 while building it. Tested on macOS 26.6 (Apple silicon): the full test suite passes. Not yet tried on macOS 27.

🤖 Generated with Claude Code

Filter › Edit in External App writes the active image layer to a PNG in a
folder the person picks once (kept as a security-scoped bookmark), opens
it in Topaz Gigapixel AI, Topaz Photo AI or any app chosen with Other
App…, and waits. When a new file whose name starts with the original's
appears there and stops growing, it comes back as a new layer above the
original at its full size, the canvas scaled to fit it, in one undo
step, and Compositor comes to the front. A banner shows the wait, with
Import File… for a result saved elsewhere and Cancel; closing the tab
cancels it too.

This is the round trip Photoshop's Topaz plug-ins make, without a
plug-in API: Gigapixel's command line needs a Pro licence, its app
doesn't.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant