Changed readimage() to accept 3-frame image instead of input file and extension.