Repository navigation
Open a layer capture's upscale as a new document at full size - #177
Merged
Merged
Conversation
Upscaling a captured layer imported the result as a floating layer in the artist's document. Photoshop's default "Resize Image During Place" shrinks anything larger than the canvas to fit, so a 4x result of a 1024 px layer came back at 25% and looked exactly like the layer it came from (G4 smoke run 2026-11-05, finding 2). With the preference off it overflows the canvas on every side instead, which a3ea019 already called a bug. Growing the document, as a canvas capture does, is wrong for a layer: it would resample every other layer by a factor that means nothing to them. So a layer capture's result now opens as a document of its own, made at the result's exact size and the source document's resolution, with the result placed in it at 100%. Nothing in the artist's document changes. The place has nothing to shrink whichever way the preference is set, and a bounds check proves it; on any failure the new document is closed unsaved. Canvas captures, and every other fallback, are unchanged. Smoke step 2.3 and the landing-page Upscale caption now describe what happens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MehranMarxian
marked this pull request as ready for review
November 5, 2026 12:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes finding (2) from the 2026-11-05 G4 smoke run: "Upscale of a layer capture imports as a 4096 px smart object placed at 25%, so the layer is not visibly larger."
What the artist should get, and why
Proposal: upscaling a captured layer opens the result as a new document at its true size, for example 4096 × 4096 for a 1024 px layer with 4x-UltraSharp. Their own document is left untouched. Upscaling a captured canvas stays as it is: the document grows to meet the result.
Why not the other options:
What changed
src/photoshop/photoshopAdapter.ts: newimportUpscaleResultAsNewDocument.app.createDocument, at the result's exact size and the source document's resolution. The placed PNG is stamped with that same resolution, the Place results at the document's resolution (fixes imports into non-72 ppi documents) #156 rule.src/photoshop/upscaleResize.ts: two pure helpers.createUpscaleNewDocumentPlangives the result's size, or null when it can't be read, in which case the import falls back to the floating layer as before.resolveUpscaleDocumentResolutiongives the source ppi, or 72.src/ui/App.ts: +30 lines, only in the layer-capture branch ofimportUpscaleResult.Not changed: the Import to Layers button label (panel markup is its own PR under CLAUDE.md), the agent bridge (it only triggers generation), and README /
llms.txt, which say "Enlarge a layer 4x". That's still true.What was verified
5 new tests in
tests/photoshop/upscaleResize.test.tscover the plan size, rounding, unusable sizes, and the resolution fallback.In Photoshop 2025 (Windows 11), by Claude through computer-use, on this branch's
dist/(UXP Developer Tool › Reload), ComfyUI 0.44.0 on 8188, in new test documents only:OpenLayer_Upscale_20261105_1531 @ 25% (RGB/8). The status bar read 144.5 cm x 144.5 cm (72 ppi), which is 4096 px. History showed New, then Place Embedded Smart Object. There was one layer, the upscale: Photoshop's Place replaced the empty starting layer, as expected.Both test documents were closed without saving.
What could NOT be verified
Open questions
What Mehran should check in Photoshop
Test this branch: GitHub Desktop › Current Branch ›
fix/upscale-layer-new-document, thennpm run build, then UXP Developer Tool › OpenLayer › Reload. ComfyUI has to be running.Smoke checklist blocks to re-check (
docs/uxp-smoke-checklist.md)🤖 Generated with Claude Code