:param resource: Image
        :return: Image

def apply(self, resource):
        """
        :param resource: Image
        :return: Image
        """
        if isinstance(resource, Image.Image):
            return getattr(self, '_' + self.method)(resource)
        else:
            raise ValueError('Unsupported resource format: %s' % str(type(resource)))