def get_screenshot_as_image(self, element=None, exclude=None):
        """

        :param WebElement element: Crop image to element (Optional)
        :param list exclude: Elements to exclude
        :return:
        """

        image = self.get_screenshot(element)

        # Mask elements in exclude if element is not included
        if isinstance(exclude, (list, tuple)) and exclude and not element:

            # Gather all elements to exclude
            elements = [self._find_element(element) for element in exclude]
            elements = [element for element in elements if element]

            canvas = ImageDraw.Draw(image)

            window_size = self._get_window_size()

            image_size = image.size

            ratio = self._get_ratio(image_size, window_size)

            for ele in elements:
                canvas.rectangle([point * ratio for point in self._get_element_rect(ele)],
                                 fill=ImageColor.getrgb('black'))

            del canvas

        return image