c73dfb5b97d42ed47aa6e622698bddb7d86377be,mathics/builtin/image.py,ImageAdjust,apply_auto,#ImageAdjust#Any#Any#,661

Before Change


    def apply_auto(self, image, evaluation):
        "ImageAdjust[image_Image]"
        pixels = skimage.img_as_ubyte(image.pixels)
        return Image(numpy.array(PIL.ImageOps.equalize(PIL.Image.fromarray(pixels))), image.color_space)

    def apply_contrast(self, image, c, evaluation):
        "ImageAdjust[image_Image, c_?RealNumberQ]"
        enhancer_c = PIL.ImageEnhance.Contrast(image.pil())

After Change


        cmaxs, cmins = pixels.max(axis=axis), pixels.min(axis=axis)

        // normalise channels
        scales = cmaxs - cmins
        if not scales.shape:
            scales = numpy.array([scales])
        scales[scales == 0.0] = 1
        pixels -= cmins
        pixels /= scales
        return Image(pixels, image.color_space)

    def apply_contrast_brightness_gamma(self, image, c, b, g, evaluation):
        "ImageAdjust[image_Image, {c_?RealNumberQ, b_?RealNumberQ, g_?RealNumberQ}]"
        im = image.pil()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: mathics/Mathics
Commit Name: c73dfb5b97d42ed47aa6e622698bddb7d86377be
Time: 2016-08-16
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/image.py
Class Name: ImageAdjust
Method Name: apply_auto


Project Name: mathics/Mathics
Commit Name: 5b535939fb75e8ca7d174be58e6cb8fe52f86ef5
Time: 2016-09-15
Author: Bernhard.Liebl@gmx.org
File Name: mathics/builtin/image.py
Class Name: GaussianFilter
Method Name: apply_radius


Project Name: mathics/Mathics
Commit Name: 5b535939fb75e8ca7d174be58e6cb8fe52f86ef5
Time: 2016-09-15
Author: Bernhard.Liebl@gmx.org
File Name: mathics/builtin/image.py
Class Name: ImageRotate
Method Name: apply