Apply filter to resource
        :param resource: Image
        :return: Image

def apply(self, resource):
        """
        Apply filter to resource
        :param resource: Image
        :return: Image
        """
        if not isinstance(resource, Image.Image):
            raise ValueError('Unknown resource format')

        resource_format = resource.format
        resource = resource.rotate(self.angle, expand=True)
        resource.format = resource_format

        return resource