Skip to content

Commit 24da5fe

Browse files
matmenclaude
andcommitted
document that colorToAlpha removes the color everywhere
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ljnxm1Qjrocq1izGajLx8J
1 parent 22c7825 commit 24da5fe

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- **`colorToAlpha(color, options)`** (#39): makes a color transparent like GIMP's "Color to Alpha", antialiased edges
88
become translucent instead of keeping a fringe of the removed color. Without a color, the top left pixel's is used.
9+
The color is removed everywhere in the image, not only from a connected background.
910

1011
## 3.0.0
1112

‎src/image.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,9 @@ export class Image {
11791179
/**
11801180
* Makes a color transparent, like GIMP's "Color to Alpha": the color is removed from every pixel and replaced by
11811181
* transparency, so pixels that are partly the color (e.g. antialiased edges against a background) become
1182-
* semi-transparent instead of keeping a fringe of it
1182+
* semi-transparent instead of keeping a fringe of it.
1183+
* The color is removed everywhere in the image, not only from a connected background: removing a white
1184+
* background also makes white areas inside the subject (e.g. eyes in a logo) transparent
11831185
* @param color The color to remove, by default the color of the top left pixel (e.g. a background)
11841186
* @param options See {@link ColorToAlphaOptions}
11851187
*/

0 commit comments

Comments
 (0)