how to properly save what I see (on my monitor)

Hi. I am pretty much a beginner in Python and scikit-image. Thank you for all the great resources! I am using sci-kit image for a hobby project involving images of medieval illuminated manuscripts. Here is my question: How do I save images like I see -- in many of your examples, in matplotlib? For example: 1. The last image of colored, segmented coins in https://scikit-image.org/docs/stable/auto_examples/applications/plot_coins_s... 2. Or the three results in https://scikit-image.org/docs/dev/auto_examples/segmentation/plot_marked_wat... 3. Or even the three results in https://scikit-image.org/docs/stable/auto_examples/filters/plot_hysteresis.h... . I have some test scripts that successfully save using skimage.io.imsave. But the results like in the examples above don't save the color; and/or the results are very dark (like mostly or all black-looking). I also get a lot of warnings about lossy-ness. I've tried a number of things, including matplot's saving methods. But the results are still what I've described. Any help on this would be super-appreciated! Sincerely, Scott PS I can also save what I see pop up when running a script, hitting the disk symbol and saving. But as you probably know, the results not only have the axes and words and such, but they also are very small and poor resolution (though I'm not confident "resolution" is the right term).

Hi Scott, On Sat, Oct 10, 2020, at 15:09, Scott Bryant wrote:
I am using sci-kit image for a hobby project involving images of medieval illuminated manuscripts.
That's awesome!
How do I save images like I see -- in many of your examples, in matplotlib?
It could be that the plugin we use by default doesn't work for you. Could you try: `io.imsave(..., plugin="matplotlib")`. There are some other plugins too, but matplotlib should be safe. What would help us debug is if you could provide a minimal code snippet of what does not work on your machine. Best regards, Stéfan

Hey Scott, I think the issue is that you want to save a matplotlib figure rather than the actual image. To save a matploltib figure, use the fig.savefig method, documented here: https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.figure.Figure.html?highl... <https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.figure.Figure.html?highl...> By the way, please subscribe to the list before posting, as otherwise you will may not receive replies (see Stéfan’s response below in case you missed it), and we also have to manually approve each of your messages. As Stéfan said, your use case is so cool! =D Juan.
On 11 Oct 2020, at 12:09 pm, Stefan van der Walt <stefanv@berkeley.edu> wrote:
Hi Scott,
On Sat, Oct 10, 2020, at 15:09, Scott Bryant wrote:
I am using sci-kit image for a hobby project involving images of medieval illuminated manuscripts.
That's awesome!
How do I save images like I see -- in many of your examples, in matplotlib?
It could be that the plugin we use by default doesn't work for you. Could you try: `io.imsave(..., plugin="matplotlib")`. There are some other plugins too, but matplotlib should be safe.
What would help us debug is if you could provide a minimal code snippet of what does not work on your machine.
Best regards, Stéfan
_______________________________________________ scikit-image mailing list -- scikit-image@python.org <mailto:scikit-image@python.org> To unsubscribe send an email to scikit-image-leave@python.org <mailto:scikit-image-leave@python.org> https://mail.python.org/mailman3/lists/scikit-image.python.org/ <https://mail.python.org/mailman3/lists/scikit-image.python.org/> Member address: jni@fastmail.com <mailto:jni@fastmail.com>
participants (3)
-
Juan Nunez-Iglesias
-
Scott Bryant
-
Stefan van der Walt