def execute(self, context):
        """Render the point cloud and export the result as image."""
        log_report("INFO", "Export opengl render as image: ...", self)
        scene = context.scene
        save_point_size = scene.opengl_panel_settings.save_point_size

        filename_ext = scene.opengl_panel_settings.render_file_format
        ofp = self.filepath + "." + filename_ext
        log_report("INFO", "Output File Path: " + ofp, self)

        # Used to cache the results
        image_name = "OpenGL Export"

        cam = get_selected_camera()
        draw_manager = DrawManager.get_singleton()
        coords, colors = draw_manager.get_coords_and_colors(visible_only=True)
        render_opengl_image(image_name, cam, coords, colors, save_point_size)

        save_alpha = scene.opengl_panel_settings.save_alpha
        save_image_to_disk(image_name, ofp, save_alpha)

        log_report("INFO", "Save opengl render as image: Done", self)
        return {"FINISHED"}
Render the point cloud and export the result as image.
photogrammetry_importer/panels/render_operators.py