Repository navigation
Conversation
…, trimmed to its pixels, named after it
|
Thanks for putting this together, and for the thorough write-up and tests! The next release, out later today, adds right-click › Export Layer(s) as PNGs… in the Layers panel: each selected layer saved as its own PNG, trimmed to its pixels and named after the layer. That matches how Photoshop handles layer export, which is what most people are used to, so I'd like to keep layer export to that one item for now rather than add a second one beside it. That said, I'm curious what you're trying to achieve with the full Export As sheet for a layer. Is it a particular format (JPEG, TIFF, EXR), quality or size settings, or something else? If there's a workflow the trimmed PNG doesn't cover, I'd love to hear about it, and we can figure out the best way to fit it in. |
Summary
The Layers panel's right-click menu already has a quick PNG export; this adds the full Export As sheet for a single layer, as the File menu has for the canvas:
contextMenu(for row:) (UI/NativeLayerList.swift) Export Layer(s) as PNGs… + Export Layer As… (one selected layer) ProjectController.exportLayerAs() ImageExporter.layerExportRasters() (IO/ImageExporter.swift) render(isolating(id, in: snapshot)) → trim rect → crop + 16-bit / HDR flattenings cropped to the same rect ExportAsSheet(raster:, deepRaster:, hdrRaster:, snapshot: nil) formats: JPEG · PNG · TIFF · PDF, EXR with HDR pixels (no GIF, no Channel Pack) savePanel(for:, named: layer.name) → ImageExporter.writelayerExportRastersis shared by the existinglayerPNGData, so both exports trim through one path. An empty or adjustment layer alerts "has nothing to export"; several selected layers grey the new item out and keep the batch PNGs flow.Evidence
0673a4a).After:
xcodebuild buildsucceeds, andLayerExportTestspasses 3/3, including the newlayerExportRastersTrimToItsPixelsAndDepthFollows:scripts/ci-tests.sh:first,rest,windowsandfiltersall passed.Merge Danger
Door: two-way — additive menu item, sheet flow mirrors the canvas's; revert is a clean revert of one commit.
Blast Radius: export path only.
layerPNGData's trim now goes throughlayerExportRasters, covered by its existing tests; project save, canvas export and the batch layer export are untouched.