mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Resampling read the pixels beyond a layer's content as the default pixel (transparent for layers, white for masks). For content that reaches the canvas edge, such as a Background or any full-canvas layer, the filter taps past the border mixed that in, so after Image Size the outermost rows and columns were translucent: a white Background enlarged 200 % came out with alpha 162/255 in the corners and 203/255 along the edges. Export As at any scale other than 100 %, and Generate Image Assets at 200 %, run Image Size first, so every such export had a translucent frame. Channels, the quick mask and the selection faded the same way. Image Size now resamples layers, masks, channels and the selection with resize_surface_in_canvas: taps past the canvas edge (or past a layer's own pixels where they extend beyond the canvas) read the nearest edge sample. Inside the canvas nothing changes, so a layer away from the edge keeps its soft border. resize_surface itself, used by transforms and placing, is unchanged. Tests: canvas_edges_repeat_instead_of_fading (algo: every filter, up and down, 8, 16 and 32 bits; inner layers unchanged) and image_size_keeps_canvas_edges_opaque (engine; fails before: corner alpha 0.635), which also checks a full selection stays full to the edge. Co-authored-by: EthanSuquet <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>