'Optional arguments are added to self.jpeg_options for pickup when saving.
More information about options:
http://effbot.org/imagingbook/format-jpeg.htm'

def setSaveOptionsJPEG(self, quality=None, optimize=None, progressive=None):

    if (quality is not None):
        self.jpeg_options['quality'] = int(quality)
    if (optimize is not None):
        self.jpeg_options['optimize'] = bool(optimize)
    if (progressive is not None):
        self.jpeg_options['progressive'] = bool(progressive)
