Skip to content

Import: a picture on a transparent background keeps all of itself (#1199) - #1352

Merged
henmedia merged 1 commit into
henmedia:mainfrom
plazmabokor:png-alpha2
Nov 5, 2026
Merged

henmedia merged 1 commit into
henmedia:mainfrom
plazmabokor:png-alpha2

Conversation

@plazmabokor

Copy link
Copy Markdown
Contributor

Discussion #1199: a logo on a transparent background - black text under a large light blue oval, mid-blue letters round it - came in as the oval and a few flecks of the letters, without the text.

Why: the import traces either the dark or the light part of a picture. On a transparent background it chose the part with more pixels (pictureShapePart), here the light oval, so the black text and the mid-blue letters dropped out.

The fix: on a transparent background the transparency already says what the picture is, so every pixel that is not transparent is now the shape, whatever its colour (importedPictureTrace in pictureIcon.ts, byOpacity in rasterTrace.ts). On #1199's logo all the lettering comes in. An opaque picture is traced as before. The icon tag and the trace in sketch mode are unchanged; the icon tag keeps its Dark / Light choice.

Tests: tests/unit/pictureIcon.test.ts: the transparent edge is seen; a logo like #1199's (light oval, mid-blue letters, black text on transparency) keeps all nine outlines; black on white is traced as before. Run together with the other fix on main 1.134.0 (4d70503): npm test 489 files, 4246 tests pass; npm run test:e2e 99 files, 866 tests pass; tsc --noEmit is clean. Main has moved on since; the three code files here are untouched there, and only the docs/CHANGELOG.md line was moved onto the newest main.

🤖 Generated with Claude Code

https://claude.ai/code/session_018PZgw7hpWq3uABHCn8iZMo

@henmedia
henmedia merged commit 0398e0d into henmedia:main Nov 5, 2026
1 check passed
@henmedia

henmedia commented Nov 5, 2026

Copy link
Copy Markdown
Owner

@plazmabokor thank you, merged and out in layerling 1.145.0: a logo on a transparent background now comes in whole.

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.

2 participants