@manipulative
    def fx(self, expression, channel=None):
        if not isinstance(expression, string_type):
            raise TypeError('expected basestring for expression, not' +
                            repr(expression))
        c_expression = binary(expression)
        if channel is None:
            new_wand = library.MagickFxImage(self.wand, c_expression)
        elif channel in CHANNELS:
            new_wand = library.MagickFxImageChannel(self.wand,
                                                    CHANNELS[channel],
                                                    c_expression)
        else:
            raise ValueError('expected string from CHANNELS, not ' +
                             repr(channel))
        if new_wand:
            return Image(image=BaseImage(new_wand))
        self.raise_exception()
Manipulate each pixel of an image by given expression.
dataset/ETHPy150Open dahlia/wand/wand/image.py/BaseImage.fx