<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_image_options(self, args=None, figsize="6x6", dpi=300, format="pdf", font="Helvetica", palette="deep", style="darkgrid", cmap="jet"):
 """ Add image format options for given command line programs. """

        from jcvi.graphics.base import ImageOptions, setup_theme

        allowed_format = ("emf", "eps", "pdf", "png", "ps", \
                          "raw", "rgba", "svg", "svgz")
        allowed_fonts = ("Helvetica", "Palatino", "Schoolbook", "Arial")
        allowed_styles = ("darkgrid", "whitegrid", "dark", "white", "ticks")
        allowed_diverge = ("BrBG", "PiYG", "PRGn", "PuOr", "RdBu", \
                           "RdGy", "RdYlBu", "RdYlGn", "Spectral")

        group = OptionGroup(self, "Image options")
        self.add_option_group(group)

        group.add_option("--figsize", default=figsize,
                help="Figure size `width`x`height` in inches [default: %default]")
        group.add_option("--dpi", default=dpi, type="int",
                help="Physical dot density (dots per inch) [default: %default]")
        group.add_option("--format", default=format, choices=allowed_format,
                help="Generate image of format [default: %default]")
        group.add_option("--font", default=font, choices=allowed_fonts,
                help="Font name")
        group.add_option("--style", default=style, choices=allowed_styles,
                help="Axes background")
        group.add_option("--diverge", default="PiYG", choices=allowed_diverge,
                help="Contrasting color scheme")
        group.add_option("--cmap", default=cmap, help="Use this color map")
        group.add_option("--notex", default=False, action="store_true",
                help="Do not use tex")

        if args is None:
            args = sys.argv[1:]

        opts, args = self.parse_args(args)

        assert opts.dpi > 0
        assert "x" in opts.figsize

        setup_theme(style=opts.style, font=opts.font, usetex=(not opts.notex))

        return opts, args, ImageOptions(opts)