From 6d9a3c3913ff6411929c062c3939f6f0493f3ace Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Wed, 6 Aug 2014 21:14:00 -0700 Subject: [PATCH] reformat comments to be standard format - clarified function names - comments in standard format - removed extra blank line - as per code review feedback --- skimage/io/_plugins/pil_plugin.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/skimage/io/_plugins/pil_plugin.py b/skimage/io/_plugins/pil_plugin.py index 9510f4d0..9e7bb499 100644 --- a/skimage/io/_plugins/pil_plugin.py +++ b/skimage/io/_plugins/pil_plugin.py @@ -19,13 +19,25 @@ from six import string_types def imread(fname, dtype=None): """Load an image from file. + Parameters + ---------- + fname : file name as string + dtype : numpy dtype object or string specifier + Specifies data type of array elements. + + """ im = Image.open(fname) return pil_to_ndarray(im, dtype) def pil_to_ndarray(im, dtype=None): - """import an image from a PIL Image object in memory + """Import a PIL Image object to an ndarray, in memory. + + Parameters + ---------- + Refer to ``imread``. + """ fp = im.fp if hasattr(im, 'fp') else None @@ -74,11 +86,11 @@ def _palette_is_grayscale(pil_image): def ndarray_to_pil(arr, format_str=None): - """Export an image as PIL object + """Export an ndarray to a PIL object. Parameters ---------- - See imsave + Refer to ``imsave``. """ arr = np.asarray(arr).squeeze() @@ -115,7 +127,6 @@ def ndarray_to_pil(arr, format_str=None): return img - def imsave(fname, arr, format_str=None): """Save an image to disk.