Skip to content

Commit

Permalink
Fix histogram for RGBA images
Browse files Browse the repository at this point in the history
  • Loading branch information
kra-mo committed Sep 17, 2024
1 parent 6cc0b66 commit 7131227
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ class SlyImage {
/// Returns a short list representing the RGB colors across the image,
/// useful for building a histogram.
Uint8List getHistogramData() {
final resizedImage = img.copyResize(_image, width: 20, height: 20);
final resizedImage =
img.copyResize(_image, width: 20, height: 20).convert(numChannels: 3);

return resizedImage.buffer.asUint8List();
}
Expand Down

0 comments on commit 7131227

Please sign in to comment.