What about screenshot of LCR160CR being saved to picture file (.jpeg, .png., etc) on internal flash or external flash (microSD) ? Has anybody implemented this feature ?
Maybe using the framebuffer, converting the frame buffer format to a picture format.
Yes, I know that the LCD160 module can show jpeg pictures.
Screenshot of LCR160CR ?
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Screenshot of LCR160CR ?
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
Re: Screenshot of LCR160CR ?
See
Note that buf holds pixels in RGB565 format.
Code: Select all
LCD160CR.screen_dump(buf, x=0, y=0, w=None, h=None)
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: Screenshot of LCR160CR ?
Thanks.chuckbook wrote: ↑Wed Jan 03, 2018 9:27 amSeeNote that buf holds pixels in RGB565 format.Code: Select all
LCD160CR.screen_dump(buf, x=0, y=0, w=None, h=None)
So the buffer could be saved to a binary file in RGB565 format.
Then I can copy the RGB565 files to a PC and use a PC tool (imagemagic, ffmpeg, etc) to convert the format to PNG, etc.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Screenshot of LCR160CR ?
There's a bit more to it than that. A binary file provides no clues about the screen dimensions (in pixels). My approach would be to do as you suggest, but then to write a utility in Python to run on the PC to convert the file to a standard graphics format. Go for a simple uncompressed format like BMP.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: Screenshot of LCR160CR ?
Good idea to convert RGB565 to bmp.
I'll look at OpenMV MicroPython source code to try to get MicroPython code to save in BMP format (in the image module) :
http://docs.openmv.io/library/omv.image ... image.save
But I guess it is implemented in C/C++ :
https://github.com/openmv/openmv/tree/master/src/omv/py
I'll look at OpenMV MicroPython source code to try to get MicroPython code to save in BMP format (in the image module) :
http://docs.openmv.io/library/omv.image ... image.save
But I guess it is implemented in C/C++ :
https://github.com/openmv/openmv/tree/master/src/omv/py
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: Screenshot of LCR160CR ?
It seems PPM image file format is simpler than BMP, easier to code even in MicroPython. For example :
PPM image from scratch in Python 3
nicholasRutherford/ppmFile.py
MANDELBROT FRACTAL IMAGE OUTPUT TO PPM FILE (PYTHON RECIPE)
PPM image from scratch in Python 3
nicholasRutherford/ppmFile.py
MANDELBROT FRACTAL IMAGE OUTPUT TO PPM FILE (PYTHON RECIPE)
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
PPM image format
Thanks for that - I'm sure that will come in handy. Converting to PPM looks very easy and Gimp can process the file.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.