From 1e726ea36a517b041a7543a8e4d2516ffd728023 Mon Sep 17 00:00:00 2001 From: Stephen Johnson Date: Fri, 11 Oct 2013 22:46:57 -0700 Subject: [PATCH] Remove old ImageChops comments; redundant with docstrings --- PIL/ImageChops.py | 149 ---------------------------------------------- 1 file changed, 149 deletions(-) diff --git a/PIL/ImageChops.py b/PIL/ImageChops.py index 4ddaf05c3..ba5350e02 100644 --- a/PIL/ImageChops.py +++ b/PIL/ImageChops.py @@ -17,28 +17,6 @@ from PIL import Image -## -# The ImageChops module contains a number of arithmetical image -# operations, called channel operations ("chops"). These can be -# used for various purposes, including special effects, image -# compositions, algorithmic painting, and more. -#

-# At this time, channel operations are only implemented for 8-bit -# images (e.g. "L" and "RGB"). -#

-# Most channel operations take one or two image arguments and returns -# a new image. Unless otherwise noted, the result of a channel -# operation is always clipped to the range 0 to MAX (which is 255 for -# all modes supported by the operations in this module). -## - -## -# Return an image with the same size as the given image, but filled -# with the given pixel value. -# -# @param image Reference image. -# @param value Pixel value. -# @return An image object. def constant(image, value): """Fill a channel with a given grey level. @@ -48,11 +26,6 @@ def constant(image, value): return Image.new("L", image.size, value) -## -# Copy image. -# -# @param image Source image. -# @return A copy of the source image. def duplicate(image): """Copy a channel. Alias for :py:meth:`PIL.Image.Image.copy`. @@ -62,12 +35,6 @@ def duplicate(image): return image.copy() -## -# Inverts an image -# (MAX - image). -# -# @param image Source image. -# @return An image object. def invert(image): """ @@ -83,16 +50,6 @@ def invert(image): image.load() return image._new(image.im.chop_invert()) -## -# Compare images, and return lighter pixel value -# (max(image1, image2)). -#

-# Compares the two images, pixel by pixel, and returns a new image -# containing the lighter values. -# -# @param image1 First image. -# @param image1 Second image. -# @return An image object. def lighter(image1, image2): """ @@ -110,16 +67,6 @@ def lighter(image1, image2): image2.load() return image1._new(image1.im.chop_lighter(image2.im)) -## -# Compare images, and return darker pixel value -# (min(image1, image2)). -#

-# Compares the two images, pixel by pixel, and returns a new image -# containing the darker values. -# -# @param image1 First image. -# @param image1 Second image. -# @return An image object. def darker(image1, image2): """ @@ -137,15 +84,6 @@ def darker(image1, image2): image2.load() return image1._new(image1.im.chop_darker(image2.im)) -## -# Calculate absolute difference -# (abs(image1 - image2)). -#

-# Returns the absolute value of the difference between the two images. -# -# @param image1 First image. -# @param image1 Second image. -# @return An image object. def difference(image1, image2): """ @@ -163,17 +101,6 @@ def difference(image1, image2): image2.load() return image1._new(image1.im.chop_difference(image2.im)) -## -# Superimpose positive images -# (image1 * image2 / MAX). -#

-# Superimposes two images on top of each other. If you multiply an -# image with a solid black image, the result is black. If you multiply -# with a solid white image, the image is unaffected. -# -# @param image1 First image. -# @param image1 Second image. -# @return An image object. def multiply(image1, image2): """ @@ -193,15 +120,6 @@ def multiply(image1, image2): image2.load() return image1._new(image1.im.chop_multiply(image2.im)) -## -# Superimpose negative images -# (MAX - ((MAX - image1) * (MAX - image2) / MAX)). -#

-# Superimposes two inverted images on top of each other. -# -# @param image1 First image. -# @param image1 Second image. -# @return An image object. def screen(image1, image2): """ @@ -218,16 +136,6 @@ def screen(image1, image2): image2.load() return image1._new(image1.im.chop_screen(image2.im)) -## -# Add images -# ((image1 + image2) / scale + offset). -#

-# Adds two images, dividing the result by scale and adding the -# offset. If omitted, scale defaults to 1.0, and offset to 0.0. -# -# @param image1 First image. -# @param image1 Second image. -# @return An image object. def add(image1, image2, scale=1.0, offset=0): """ @@ -245,16 +153,6 @@ def add(image1, image2, scale=1.0, offset=0): image2.load() return image1._new(image1.im.chop_add(image2.im, scale, offset)) -## -# Subtract images -# ((image1 - image2) / scale + offset). -#

-# Subtracts two images, dividing the result by scale and adding the -# offset. If omitted, scale defaults to 1.0, and offset to 0.0. -# -# @param image1 First image. -# @param image1 Second image. -# @return An image object. def subtract(image1, image2, scale=1.0, offset=0): """ @@ -272,15 +170,6 @@ def subtract(image1, image2, scale=1.0, offset=0): image2.load() return image1._new(image1.im.chop_subtract(image2.im, scale, offset)) -## -# Add images without clipping -# ((image1 + image2) % MAX). -#

-# Adds two images, without clipping the result. -# -# @param image1 First image. -# @param image1 Second image. -# @return An image object. def add_modulo(image1, image2): """Add two images, without clipping the result. @@ -296,15 +185,6 @@ def add_modulo(image1, image2): image2.load() return image1._new(image1.im.chop_add_modulo(image2.im)) -## -# Subtract images without clipping -# ((image1 - image2) % MAX). -#

-# Subtracts two images, without clipping the result. -# -# @param image1 First image. -# @param image1 Second image. -# @return An image object. def subtract_modulo(image1, image2): """Subtract two images, without clipping the result. @@ -320,9 +200,6 @@ def subtract_modulo(image1, image2): image2.load() return image1._new(image1.im.chop_subtract_modulo(image2.im)) -## -# Logical AND -# (image1 and image2). def logical_and(image1, image2): """Logical AND between two images. @@ -338,9 +215,6 @@ def logical_and(image1, image2): image2.load() return image1._new(image1.im.chop_and(image2.im)) -## -# Logical OR -# (image1 or image2). def logical_or(image1, image2): """Logical OR between two images. @@ -356,9 +230,6 @@ def logical_or(image1, image2): image2.load() return image1._new(image1.im.chop_or(image2.im)) -## -# Logical XOR -# (image1 xor image2). def logical_xor(image1, image2): """Logical XOR between two images. @@ -374,10 +245,6 @@ def logical_xor(image1, image2): image2.load() return image1._new(image1.im.chop_xor(image2.im)) -## -# Blend images using constant transparency weight. -#

-# Same as the blend function in the Image module. def blend(image1, image2, alpha): """Blend images using constant transparency weight. Alias for @@ -388,10 +255,6 @@ def blend(image1, image2, alpha): return Image.blend(image1, image2, alpha) -## -# Create composite using transparency mask. -#

-# Same as the composite function in the Image module. def composite(image1, image2, mask): """Create composite using transparency mask. Alias for @@ -402,18 +265,6 @@ def composite(image1, image2, mask): return Image.composite(image1, image2, mask) -## -# Offset image data. -#

-# Returns a copy of the image where data has been offset by the given -# distances. Data wraps around the edges. If yoffset is omitted, it -# is assumed to be equal to xoffset. -# -# @param image Source image. -# @param xoffset The horizontal distance. -# @param yoffset The vertical distance. If omitted, both -# distances are set to the same value. -# @return An Image object. def offset(image, xoffset, yoffset=None): """Returns a copy of the image where data has been offset by the given