Skip to content

Commit 60a2107

Browse files
Make Image.hasAlpha return true for 2 channel images
1 parent 9f39c25 commit 60a2107

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/image/image.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ class Image extends Iterable<Pixel> {
554554
int get bitsPerChannel => data?.bitsPerChannel ?? 0;
555555

556556
/// True if the Image has an alpha channel.
557-
bool get hasAlpha => numChannels == 4;
557+
bool get hasAlpha => numChannels == 2 || numChannels == 4;
558558

559559
/// Remap the color channels to the given [order]. Normally Image color
560560
/// channels are stored in rgba order for 4 channel images, and

0 commit comments

Comments
 (0)