Skip to content

use imageio for input/output tasks? #239

@tobyhodges

Description

@tobyhodges

Opening this issue so that there is an obvious place to find this discussion in future.

In #238, @mkcor wrote:

Getting to the gist of this PR, I'm following up on scikit-image/scikit-image#5036 (comment): The vision for scikit-image is to focus on actual image processing, delegating other functionalities (e.g., input/output, drawing, ...) to dedicated libraries. For reading and writing image data, this dedicated library is now available and stable, it is imageio.

Therefore, I'm thinking that, before releasing this lesson as 'stable,' we may want to consider making this change. If you agree with it, I'll propagate it to all subsequent episodes (episode 03 representing the biggest chunk). From an educational perspective, I can see how we may prefer sticking with only one library instead of two. I would argue that the proposed change doesn't add a dependency (you can readily import imageio once you have installed scikit-image); so the setup wouldn't be affected.

I could add a sentence to introduce the imageio library, if you deem it appropriate; the existing sentence seems almost sufficient and works well with the proposed change: "Let's load our image data from disk using the imread function from the imageio.v3 library and display it using ..."

Marianne tagged the other scikit-image maintainers, @stefanv @jni @alexdesiqueira @grlee77 @lagru, in that pull request so I am doing the same here.

Here is a list of pros and cons I can identify for making the change:

➕ reflects preferences of the scikit-image project
➕ reflects best practice for the scikit-image user community
➕ seems to require only very minor changes to function & argument names, no syntax changes
➕ those new names are no less intuitive than the skimage.io equivalents
➕ new dependency requires no additional setup steps

➖ introduces a new library that needs to be explained in the lesson
➖ the need to specifically import v3 implies the existence of (at least) a v2 and v1, which may need to be explained - why is it necessary to import imageio.v3 as iio and not "just" imageio as iio as I suspect many new users would try to do?
➖ learners have to develop a mental model of when it is appropriate to use imageio vs skimage

Overall, I am in favour of making this change. However, in addition to the adjustments @mkcor has already proposed in the #238, I think that we need more context for the new library. A few sentences explaining:

  • what imageio is (and isn't) for,
  • why you need to import v3 specifically,
  • and what the typical workflow might look like when switching between the two libraries
    • e.g. is it correct to think of it as "load image using a function from imageio, process it using functionality from skimage, then save any resulting images with another function from imageio"?

I'll leave this (and #238) open for a few days, to give @K-Meech @bobturneruk @quist00 and @uschille a chance to join the discussion.

Metadata

Metadata

Assignees

Labels

status:in progressContributor working on issuetype:discussionDiscussion or feedback about the lesson

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions