I need to save picture without losing any data. Using PNG is not an option as it takes more than 5 seconds to save and this is too slow for my project.

I used campera.capture('image01.data','yuv') as suggested by official documents to store data without compression.

Then I used the same document to read files and convert YUV format to RGB. Document link: Pi camera offical document

but this is what I get: enter image description here


If you want your data to be stored in RGB rather than YUV, you could try

camera.capture('image.data', 'rgb')
| improve this answer | |
  • 1
    Using RGB doubles the size of files, so it takes again more than 5 seconds to capture and write data on SD card, specially with max resolution on camera V2. RGB files are about 22mb in this case. – Hadi Oct 7 '19 at 10:06
  • You can use a RAM drive to eliminate the time it takes to save the image. – kwasmich Mar 5 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.