Lines Matching defs:Image
44 # 2006-06-17 Nicko: Test suite with various image generators.
95 for Red, Green, Blue, the components of a colour image; *A* stands for
109 Consider an image that is 3 pixels wide by 2 pixels high, and each pixel
131 The entire image is one single giant sequence of colour values.
154 by the PNG image format) each pixel value is decomposed into 2 bytes
157 format, but may be just right if the source data for the PNG image
191 __all__ = ['Image', 'Reader', 'Writer', 'write_chunks', 'from_array']
343 Image size in pixels, as two separate arguments.
345 Image size (w,h) in pixels, as single argument.
353 Create a palette for a colour mapped image (colour type 3).
363 Create an interlaced image.
367 The image size (in pixels) can be specified either by using the
373 an image is greyscale (or colour), and whether it has an
383 precision of the source image. In this case the supplied pixel
396 PNG image with a palette and an ``sBIT`` chunk, but the meaning
400 The `palette` option, when specified, causes a colour mapped image
404 mapped image is created, the pixel values are palette indexes
421 a simple integer (or singleton tuple) for a greyscale image.
437 If `interlace` is true then an interlaced image is created
442 browser to give a rough view of the image that is successively
443 refined as more image data appears.
447 Enabling the `interlace` option requires the entire image
451 compressing the image. In order to avoid using large amounts of
627 """Write a PNG image to the output file. `rows` should be
629 The rows should be the rows of the original image, so there
633 normal image order; the interlacing is carried out internally.
637 Interlacing will require the entire image to be in working memory.
653 Write a PNG image to the output file.
795 # mark the first row of a reduced pass image; that means we
843 This method should not be used when the source image bit depth
895 pixel. The number of pixels to read is taken from the image
897 per value is implied by the image `bitdepth`.
933 the full source image in flat row flat pixel format. The
946 # Pixels per row (of reduced image)
948 # number of values in reduced image row.
1051 # of the image simpler. "up" becomes "none"; "paeth" becomes
1074 """Create a PNG :class:`Image` object from a 2- or 3-dimensional array.
1088 and the third axis is the channel number. Thus an RGB image that is
1091 is ``width*channels``, so an RGB image that is 16 pixels high and 8
1095 *mode* is a string that specifies the image colour format in a
1103 colour image (3 channel)
1105 colour image with alpha (4 channel)
1113 channels the image has, and so allows the width to be derived from
1264 return Image(a, info)
1269 class Image:
1270 """A PNG image.
1271 You can create an :class:`Image` object from an array of pixels by calling
1285 """Save the image to *file*. If *file* looks like an open file
1290 been called the first time and the PNG image has been saved, the
1448 images, it is the previous scanline in the reduced image, which
1449 in general is not the previous pixel row in the final image).
1451 straightlaced image, or the first row in one of the passes in an
1452 interlaced image), then this argument should be ``None``.
1562 # Values per row (of the target image)
1581 # Pixels per row (reduced pass image)
1671 # line of image.
1702 Extract the image metadata by reading the initial part of the PNG
1963 there is a ``tRNS`` chunk. Assumes that the image is colour type
1972 "Required PLTE chunk is missing in colour type 3 image.")
1981 """Returns the image data as a direct representation of an
1996 they have in the source image, but when the source PNG has an
2002 image will be rescaled to 6-bit RGB666).
2005 format and not the original source image. For example, an RGB
2006 source image with a ``tRNS`` chunk to represent a transparent
2008 source image, but the *meta* dictionary returned by this method
2015 All the other aspects of the image data are not changed.
2085 """Return image pixels as per :meth:`asDirect` method, but scale
2117 """Return the image data as an RGB pixels with 8-bits per
2121 source image has a bit depth < 8 the transformation preserves
2122 all the information; where the source image has bit depth
2125 in the source image will raise an exception.
2137 """Return the image data as RGBA pixels with 8-bits per
2147 """Return image as RGB pixels. RGB colour images are passed
2151 An alpha channel in the source image will raise an
2156 source image. In particular, for this method
2162 raise Error("will not convert image with alpha channel to RGB")
2176 """Return image as RGBA pixels. Greyscales are expanded into
2180 source image. In particular, for this method
2395 """Convert a grayscale image to RGBA. This method assumes the alpha
2402 """Convert an RGB image to RGBA. This method assumes the alpha
2622 For each test image in the PngSuite, write an interlaced
2685 """Create an LA image with bitdepth 4."""
2712 """Test that bitdepth can be used to fiddle with pallete image."""
2744 """Create greyscale image with tRNS chunk."""
3602 channels in the image; for PBM and PGM it is synthesized as 1, for
3682 # Rudely, the number of image planes can be used to determine
3815 # the source image to determine which one we have. We do not
3844 raise ValueError("alpha channel image size mismatch"