'Save a clip\'s frame to an image file.
Saves the frame of clip corresponding to time ``t`` in
\'filename\'. ``t`` can be expressed in seconds (15.35), in
(min, sec), in (hour, min, sec), or as a string: \'01:03:05.35\'.
If ``withmask`` is ``True`` the mask is saved in
the alpha layer of the picture (only works with PNGs).'

@convert_to_seconds(['t'])
@convert_masks_to_RGB
def save_frame(self, filename, t=0, withmask=True):

    im = self.get_frame(t)
    if (withmask and (self.mask is not None)):
        mask = (255 * self.mask.get_frame(t))
        im = np.dstack([im, mask]).astype('uint8')
    else:
        im = im.astype('uint8')
    imsave(filename, im)
