We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2065af4 commit 2f64596Copy full SHA for 2f64596
lib/src/formats/jpeg_encoder.dart
@@ -123,7 +123,7 @@ class JpegEncoder extends Encoder {
123
return fp.getBytes();
124
}
125
126
- static const _black = const ConstColorRgb8(0, 0, 0);
+ static const _backgroundColor = const ConstColorRgb8(255, 255, 255);
127
128
void _calculateYUV(
129
Image image,
@@ -157,7 +157,7 @@ class JpegEncoder extends Encoder {
157
p = p.convert(format: Format.uint8);
158
159
if (p.length > 3) {
160
- final backgroundColor = image.backgroundColor ?? _black;
+ final backgroundColor = image.backgroundColor ?? _backgroundColor;
161
final a = p.aNormalized;
162
final invA = 1.0 - a;
163
p..r = (p.r * a + backgroundColor.r * invA).round()
0 commit comments