(path)
| 397 | |
| 398 | |
| 399 | def _load_image(path): |
| 400 | img = Image.open(path) |
| 401 | # In an RGBA image, if the smallest value in the alpha channel is 255, all |
| 402 | # values in it must be 255, meaning that the image is opaque. If so, |
| 403 | # discard the alpha channel so that it may compare equal to an RGB image. |
| 404 | if img.mode != "RGBA" or img.getextrema()[3][0] == 255: |
| 405 | img = img.convert("RGB") |
| 406 | return np.asarray(img) |
| 407 | |
| 408 | |
| 409 | def compare_images(expected, actual, tol, in_decorator=False): |
no test coverage detected
searching dependent graphs…