@@ -281,9 +281,14 @@ def _update_converter():
281281
282282def comparable_formats ():
283283 """
284- Returns the list of file formats that compare_images can compare
284+ Return the list of file formats that `. compare_images` can compare
285285 on this system.
286286
287+ Returns
288+ -------
289+ supported_formats : list of str
290+ E.g. ``['png', 'pdf', 'svg', 'eps']``.
291+
287292 """
288293 return ['png' , * converter ]
289294
@@ -369,21 +374,41 @@ def compare_images(expected, actual, tol, in_decorator=False):
369374 ----------
370375 expected : str
371376 The filename of the expected image.
372- actual :str
377+ actual : str
373378 The filename of the actual image.
374379 tol : float
375380 The tolerance (a color value difference, where 255 is the
376381 maximal difference). The test fails if the average pixel
377382 difference is greater than this value.
378383 in_decorator : bool
379- If called from image_comparison decorator, this should be
380- True. (default=False)
384+ Determines the output format. If called from image_comparison
385+ decorator, this should be True. (default=False)
386+
387+ Returns
388+ -------
389+ comparison_result : None or dict or str
390+ Return *None* if the images are equal within the given tolerance.
391+
392+ If the images differ, the return value depends on *in_decorator*.
393+ If *in_decorator* is true, a dict with the following entries is
394+ returned:
395+
396+ - *rms*: The RMS of the image difference.
397+ - *expected*: The filename of the expected image.
398+ - *actual*: The filename of the actual image.
399+ - *diff_image*: The filename of the difference image.
400+ - *tol*: The comparison tolerance.
401+
402+ Otherwise, a human-readable multi-line string representation of this
403+ information is returned.
381404
382405 Examples
383406 --------
384- img1 = "./baseline/plot.png"
385- img2 = "./output/plot.png"
386- compare_images(img1, img2, 0.001):
407+ ::
408+
409+ img1 = "./baseline/plot.png"
410+ img2 = "./output/plot.png"
411+ compare_images(img1, img2, 0.001)
387412
388413 """
389414 if not os .path .exists (actual ):
0 commit comments