That might help a bit for the part of the code where it saves the image back to the stream, but I don't think that is the major timesink.