Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Save resulting grid of images #20

Open
marianatuma opened this issue Oct 28, 2020 · 3 comments · May be fixed by #21
Open

[Feature Request] Save resulting grid of images #20

marianatuma opened this issue Oct 28, 2020 · 3 comments · May be fixed by #21
Labels
enhancement New feature or request

Comments

@marianatuma
Copy link

Is it possible to save the result of ipyplot.plot_images( ) via python code? If not, I think that would be a useful feature to have.

@karolzak
Copy link
Owner

karolzak commented Nov 3, 2020

Hi @marianatuma
Currently there's no easy way to do it. You can export HTML that created the plot but that's it.
I did some research in that area and to convert HTML to images in python I would need to rely on something like imgkit which depends on some external tools as well. I will think about it and run some experiments

@karolzak karolzak changed the title Save resulting grid of images [Feature Request] Save resulting grid of images Nov 3, 2020
@karolzak karolzak added the enhancement New feature or request label Nov 3, 2020
@karolzak
Copy link
Owner

karolzak commented Nov 3, 2020

Similar/duplicate issue #14 but let's keep the thread going here since it went a bit in a different direction there

karolzak added a commit that referenced this issue Nov 4, 2020
@karolzak karolzak linked a pull request Nov 4, 2020 that will close this issue
@karolzak karolzak added this to In progress in Continuous improvements Dec 9, 2020
@karolzak karolzak moved this from In progress to Review in Continuous improvements Dec 11, 2020
@Joywalker
Copy link

Joywalker commented Dec 22, 2022

Is it possible to save the result of ipyplot.plot_images( ) via python code? If not, I think that would be a useful feature to have.

I've managed to save the generated HTML like this. As per saving the output directly to an image, this might be helpful https://gist.github.com/aspose-com-gists/2741bb268101fd3e5ec74a860abf717b

  1. In ipyplot __plotting.py
# ipyplot.__plotting
def plot_images(...)
      ...
      html = _create_imgs_grid(...)
      return html
  1. html = ipyplot.plot_images(...)
html = ipyplot.plot_images(...)
with open('view.html', 'w') as fin:
    fin.write(html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

3 participants