Skip to content

Commit 059e1e5

Browse files
ImageView app: add support for grayscale images
1 parent 8819afd commit 059e1e5

File tree

1 file changed

+3
-1
lines changed
  • internal_filesystem/apps/com.micropythonos.imageview/assets

1 file changed

+3
-1
lines changed

internal_filesystem/apps/com.micropythonos.imageview/assets/imageview.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ def show_image(self, name):
214214
print(f"Raw image has width: {width}, Height: {height}, Color Format: {color_format}")
215215
stride = width * 2
216216
cf = lv.COLOR_FORMAT.RGB565
217-
if color_format != "RGB565":
217+
if color_format == "GRAY":
218+
cf = lv.COLOR_FORMAT.L8
219+
else:
218220
print(f"WARNING: unknown color format {color_format}, assuming RGB565...")
219221
self.current_image_dsc = lv.image_dsc_t({
220222
"header": {

0 commit comments

Comments
 (0)