$ 0 0 As you can see your performance increased from 31159/100=311ms to 5168/100=50ms by choosing a different output format. But JPEG compression is lossy, what do you want to do with the image after you have written it?