Lines Matching refs:Image
9 Calulate differences between image pairs, and store them in a database.
18 from PIL import Image, ImageChops
48 expected image
50 expected image within storage_root (probably including a checksum to
53 actual image
55 actual image within storage_root (probably including a checksum to
68 # Generate the diff image (absolute diff at each pixel) and
77 # Generate the whitediff image (any differing pixels show as white).
85 .convert('1', dither=Image.NONE))
117 """Returns a weighted measure of image diffs, as a float between 0 and 100
128 """ Calculates differences between image pairs, maintaining a database of
158 expected image
160 expected image within storage_root (probably including a checksum to
163 actual image
165 actual image within storage_root (probably including a checksum to
183 """Returns the DiffRecord for this image pair.
185 Raises a KeyError if we don't have a DiffRecord for this image pair.
194 """Given the histogram of a diff image (per-channel diff at each
200 num_pixels: integer; the total number of pixels in the diff image
218 """Given the histogram of an image, return the maximum value of each band
219 (a.k.a. "color channel", such as R/G/B) across the entire image.
224 Returns the maximum value of each band within the image histogram, as a list.
252 image1: a PIL image object
253 image2: a PIL image object
255 Returns: per-pixel diffs between image1 and image2, as a PIL image object
265 """Open the image at local_filepath; if there is no file at that path,
269 local_filepath: path on local disk where the image should be stored
270 url: URL from which we can download the image if we don't have it yet
272 Returns: a PIL image object
282 """Wrapper for Image.open(filepath) that yields more useful error messages.
285 filepath: path on local disk to load image from
287 Returns: a PIL image object
290 return Image.open(filepath)
292 logging.error('IOError loading image file %s' % filepath)
295 def _save_image(image, filepath, format='PNG'):
296 """Write an image to disk, creating any intermediate directories as needed.
299 image: a PIL image object
300 filepath: path on local disk to write image to
301 format: one of the PIL image formats, listed at
305 image.save(filepath, format)
321 expected_image_locator: locator string pointing at expected image
322 actual_image_locator: locator string pointing at actual image