diff --git a/scikits/image/io/_plugins/fits_plugin.py b/scikits/image/io/_plugins/fits_plugin.py index 5c673bb3..84215d96 100644 --- a/scikits/image/io/_plugins/fits_plugin.py +++ b/scikits/image/io/_plugins/fits_plugin.py @@ -11,15 +11,13 @@ except ImportError: "for further instructions.") -def imread(fname, as_grey=True, dtype=None): +def imread(fname, dtype=None): """Load an image from a FITS file. Parameters ---------- fname : string Image file name, e.g. ``test.fits``. - as_grey : bool - For FITS images, this is ignored (treated as True). dtype : dtype, optional For FITS, this argument is ignored because Stefan is planning on removing the dtype argument from imread anyway. diff --git a/scikits/image/io/_plugins/freeimage_plugin.py b/scikits/image/io/_plugins/freeimage_plugin.py index 0109e371..8c67c888 100644 --- a/scikits/image/io/_plugins/freeimage_plugin.py +++ b/scikits/image/io/_plugins/freeimage_plugin.py @@ -496,25 +496,20 @@ def _array_to_bitmap(array): raise -def imread(filename, as_grey=False): +def imread(filename): """ - img = imread(filename, as_grey=False) + img = imread(filename) Reads an image from file `filename` Parameters ---------- filename : file name - as_grey : Whether to convert to grey scale image (default: no) Returns ------- img : ndarray """ img = read(filename) - if as_grey and len(img) == 3: - # these are the values that wikipedia says are typical - transform = numpy.array([ 0.30, 0.59, 0.11]) - return numpy.dot(img, transform).astype('uint8') return img def imsave(filename, img): diff --git a/scikits/image/io/_plugins/pil_plugin.py b/scikits/image/io/_plugins/pil_plugin.py index 5b87b34b..7fc3a0fc 100644 --- a/scikits/image/io/_plugins/pil_plugin.py +++ b/scikits/image/io/_plugins/pil_plugin.py @@ -9,7 +9,7 @@ except ImportError: "Please refer to http://pypi.python.org/pypi/PIL/ " "for further instructions.") -def imread(fname, as_grey=False, dtype=None): +def imread(fname, dtype=None): """Load an image from file. """ @@ -20,10 +20,6 @@ def imread(fname, as_grey=False, dtype=None): else: im = im.convert('RGB') - if as_grey and not \ - im.mode in ('1', 'L', 'I', 'F', 'I;16', 'I;16L', 'I;16B', 'LA'): - im = im.convert('F') - if 'A' in im.mode: im = im.convert('RGBA') diff --git a/scikits/image/io/_plugins/test_plugin.py b/scikits/image/io/_plugins/test_plugin.py index d17a91ec..2956f14f 100644 --- a/scikits/image/io/_plugins/test_plugin.py +++ b/scikits/image/io/_plugins/test_plugin.py @@ -1,7 +1,7 @@ # This mock-up is called by ../tests/test_plugin.py # to verify the behaviour of the plugin infrastructure -def imread(fname, as_grey=False, dtype=None): +def imread(fname, dtype=None): assert fname == 'test.png' assert dtype == 'i4'