This might be a silly question, but...
I have several thousand images that I would like to load into Python and then convert into numpy arrays. Obviously this goes a
I have run some timing tests and I am sorry to say I don't think you can get much faster than the PIL crop command. Even with manual seeking/low level reading you still have to read the bytes. Here is the timing results:
%timeit im.crop((1000-50,1000-50,1000+50,1000+50))
fid = open('003.png','rb')
%timeit fid.seek(1000000)
%timeit fid.read(1)
print('333*100*100/10**(9)*1000=%.2f ms'%(333*100*100/10**(9)*1000))
100000 loops, best of 3: 3.71 us per loop
1000000 loops, best of 3: 562 ns per loop
1000000 loops, best of 3: 330 ns per loop
333*100*100/10**(9)*1000=3.33 ms
As can be seen the bottom calculation we have a read 1 byte *10000 bytes (100x100 subimage)*333ns per byte=3.33ms which is the same as the crop command above