Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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
  • Loading branch information
matmen and claude committed Oct 15, 2026
commit 378b4a5019e0827a7b85b5f2ba86a13c4379cd11
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
run length encoded 24/32 bit files.
- **`colorToAlpha(color, options)`** (#39): makes a color transparent like GIMP's "Color to Alpha", antialiased edges
become translucent instead of keeping a fringe of the removed color. Without a color, the top left pixel's is used.
The color is removed everywhere in the image, not only from a connected background.

### Deprecated

Expand Down
4 changes: 3 additions & 1 deletion src/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,9 @@ export class Image {
/**
* Makes a color transparent, like GIMP's "Color to Alpha": the color is removed from every pixel and replaced by
* transparency, so pixels that are partly the color (e.g. antialiased edges against a background) become
* semi-transparent instead of keeping a fringe of it
* semi-transparent instead of keeping a fringe of it.
* The color is removed everywhere in the image, not only from a connected background: removing a white
* background also makes white areas inside the subject (e.g. eyes in a logo) transparent
* @param color The color to remove, by default the color of the top left pixel (e.g. a background)
* @param options See {@link ColorToAlphaOptions}
*/
Expand Down
Loading