stmol icon indicating copy to clipboard operation
stmol copied to clipboard

save the image

Open WenchangLu opened this issue 3 years ago • 7 comments

Can we save or download the image from streamlit?

WenchangLu avatar Jun 18 '22 03:06 WenchangLu

Hi @WenchangLu thanks for your question. At the moment this is not implemented, but let me figure out what I can do in this regard. Could you explain a little more about your use case? Cheers!!

napoles-uach avatar Jun 18 '22 03:06 napoles-uach

Hi Napoles, I implemented an webinterface for our Real space multigrid package to plot charge density and atomic structure with py3dmol, stmol with streamlit. I can view them through browser but I also like to save the picture for other usage. For other implementation with matplotlib, I can save the image to a file but I did not find a way to save the image with stmol and py3dmol. Here is the link to my streamlit app with stmol and py3dmol. Basically, I created a viewer object by py3dmol and am able to show with showmol from stmol package. I would like to save this image. https://share.streamlit.io/rmgdft/rmgwebpostprocess/main.py

Thanks a lot for your help. Wenchang

On Fri, Jun 17, 2022 at 11:38 PM José Manuel Nápoles Duarte < @.***> wrote:

Hi @WenchangLu https://github.com/WenchangLu thanks for your question. At the moment this is not implemented, but let me figure out what I can do in this regard. Could you explain a little more about your use case? Cheers!!

— Reply to this email directly, view it on GitHub https://github.com/napoles-uach/stmol/issues/16#issuecomment-1159353107, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXCDDTU746ZFM5UKIJW63DVPVACRANCNFSM5ZECDUOA . You are receiving this because you were mentioned.Message ID: @.***>

WenchangLu avatar Jun 18 '22 13:06 WenchangLu

I see why you want this. Btw, your app is amazing!! I love it!! Looking into the guts of py3dmol, I saw that there is a png method that in principle retrieves a png image, but I haven't had luck by now. I'll try something else later, and will let you know. Regards!

napoles-uach avatar Jun 18 '22 13:06 napoles-uach

Thanks a lot. I tried view.png() but it doesn't work for me. It has view.pngURI() but I don't know how to save image from that. Best, Wenchang

On Sat, Jun 18, 2022 at 9:40 AM José Manuel Nápoles Duarte < @.***> wrote:

I see why you want this. Btw, your app is amazing!! I love it!! Looking into the guts of py3dmol, I saw that there is a png method that in principle retrieves a png image, but I haven't had luck by now. I'll try something else later, and will let you know. Regards!

— Reply to this email directly, view it on GitHub https://github.com/napoles-uach/stmol/issues/16#issuecomment-1159467123, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXCDDTVSR46SWNL23KM3ZTVPXGTNANCNFSM5ZECDUOA . You are receiving this because you were mentioned.Message ID: @.***>

WenchangLu avatar Jun 18 '22 14:06 WenchangLu

Hi any idea to solve the save image issue?

WenchangLu avatar Jun 26 '22 22:06 WenchangLu

Hi @WenchangLu, not at the moment, I've been trying some ideas with 3Dmol.js, but not totally successful yet. Sorry for that, as soon as I find something I'll let you know!

napoles-uach avatar Jun 26 '22 23:06 napoles-uach

Thanks a lot!

On Sun, Jun 26, 2022 at 7:06 PM José Manuel Nápoles Duarte < @.***> wrote:

Hi @WenchangLu https://github.com/WenchangLu, not at the moment, I've been trying some ideas with 3Dmol.js, but not totally successful yet. Sorry for that, as soon as I find something I'll let you know!

— Reply to this email directly, view it on GitHub https://github.com/napoles-uach/stmol/issues/16#issuecomment-1166672243, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXCDDRDB5LHYFA5SSP7DT3VRDPARANCNFSM5ZECDUOA . You are receiving this because you were mentioned.Message ID: @.***>

WenchangLu avatar Jun 27 '22 02:06 WenchangLu