Load image from flash memory

I’m sorry for this question… maybe it can be a stupid question, but I’m newbe to this system,

How I can load an JPG from flash memory?

import sensor, image, time

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()

myImage = image.Image("solar_eclipse.jpg", True)

while(True):
    clock.tick()
    img = sensor.flush()
    # Do machine vision algorithms on the image here.

    print(clock.fps())

Where I’m wrong?

Hi,

myImage = image.Image("solar_eclipse.jpg", copy_to_fb = True)

All keyword arguments need the keyword, e.g. the “copy_to_fb” part. Note that the internal flash drive can’t really hold a JPG image. Please store JPG images on the SD card. Finally, what do you plan to do with the JPG image? Machine Vision methods can’t operate on JPG images. You can only save and load them.

As first step I would want to load JPG and put in the frame buffer (to show in the IDE).
The second step will be take the image from frame buffer and manipulate.

Okay, just use a BMP file or PPM/PGM file. Sometimes BMP might not work. However, PGM and PPM should always work. If you have a non-working BMP file please send it to me and I can figure out why.