First, we understand that some machine learning examples are hard-coded to handle only jpg or png, but converting the original data to an 8 bit format truncates the dynamic range and is probably a bad idea.
That out of the way, you can use the ScreenCapture module’s slice sweep mode to catpure the images. Here’s an example doing this from a python script.
The batch processing examples will get you started applying this to a set of images.