problem to save and load a grayscale image

anyone help me out of the question below? thanks .
a file is created by the “Snapshot on Face Detection Example” in IDE:
sensor.snapshot().save(“snapshot-%d.jpg” % pyb.rng())
that sensor is in grayscale mode:
now, this file is loaded:
img = image.Image("/snapshot-173375695.jpg")
but this img could not be used by “find_features”, since it is not “grayscale”
objects = img.find_features(face_cascade, threshold=0.5, scale=1.5)
Should I add some arguments in “” or “image.Image()”?

you should save the image as pgm if you want to do image processing on that image later.

sensor.snapshot().save("snapshot-%d.pgm" % pyb.rng())

Also between the saving and loading you’ll need to reset the camera so it can see the changes to the filesystem.

yes, it works.
Thanks a lot.

Use .bmp instead of .ppm or .pgm. It’s a better format.