Skip to content

Commit

Permalink
fix: Make MemoryImage.hasAlpha return true for 2 channel images
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor-pelykh committed Feb 3, 2024
1 parent 94d2abd commit 195f331
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/image/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export class MemoryImage implements Iterable<Pixel> {
* Indicates whether this MemoryImage has an alpha channel.
*/
public get hasAlpha(): boolean {
return this.numChannels === 4;
return this.numChannels === 2 || this.numChannels === 4;
}

/**
Expand Down

0 comments on commit 195f331

Please sign in to comment.