[SciPy-Dev] Fwd: Imsave and imwrite

Warren Weckesser warren.weckesser at gmail.com
Mon Nov 9 15:41:39 EST 2015


On Sat, Nov 7, 2015 at 4:32 PM, Ralf Gommers <ralf.gommers at gmail.com> wrote:

>
>
> On Wed, Nov 4, 2015 at 12:31 AM, Alan Wu <alan.c.wu at gmail.com> wrote:
>
>> I moved imsave into imwrite and wrapped imsave to call imwrite for
>> backwards compatibility,
>> in order to be consistent in naming read/write and with other packages
>> like matlab and opencv.
>>
>
>> I would like to submit it and related test as a pull request.
>>
>
> Alan submitted this PR at https://github.com/scipy/scipy/pull/5458
>
> On the PR I commented already that the name change doesn't really warrant
> a deprecation imho. Both "imsave" and "imwrite" are pretty clear. The
> latter may be slightly more precise and consistent with OpenCV and Matlab,
> but on the other hand Matplotlib also uses "imsave".
>
> However: we do want to get rid of scipy.misc. At least I do. So the useful
> stuff in there (not that much) needs to move. We recently discussed
> "imread" on a PR, and that has two versions - one in misc and one in
> ndimage. Warren suggested that the most logical place for it would actually
> be scipy.io. Which makes sense.
>
> If we add an image read and save function to scipy.io, then we're free to
> choose the names of those functions. So:
> - long-term, do we want to keep an imread and an imsave/write function?
> - if so, what's the preferred name?
>
>

I prefer the read/write verb pairing over read/save, so I'd be fine with
moving `imread` and `imsave` from `misc` to `io` and renaming `imsave` to
`imwrite`.  (The `misc` versions would have the usual deprecation cycle, of
course.)

For comparison, the other I/O functions in `scipy.io` that use either
read/write or load/save are (sorry if the following doesn't come out
properly formatted in your email viewer):

Format         Input          Output
WAV            wavfile.read   wavfile.write
Matrix market  mmread         mmwrite
IDL            readsav
Matlab files   loadmat        savemat
ARFF           arff.loadarff


Warren

P.S. As long as we're on the subject of writing image files, I'll put in a
plug for the package "numpngw" for writing numpy arrays to PNG files,
including animated PNG: https://github.com/WarrenWeckesser/numpngw



>
> My previous emails messed up on my phone after sending.  I'm sending
>> this message again
>> on my desktop as plain text, hopefully with better formatting.  Is
>> there a way to remove the previous
>> posted messages?
>>
>
> There's no way to remove posted messages.
>
> Cheers,
> Ralf
>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20151109/2016a3a0/attachment.html>


More information about the SciPy-Dev mailing list