Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
How to save ui.image
-
I am new to python and Pythonista.
I would like to save ui.image and not create it very time from JPEG.
Is it possible?Thanks
-
Yes, that's possible, here's an example:
import ui img = ui.Image('test:Lenna') # Just load a sample image here... # Save as PNG: with open('test.png', 'wb') as f: f.write(img.to_png()) # Save as JPEG: with open('test.jpg', 'wb') as f: quality = 0.9 # From 0.0 (more compression) to 1.0 (better quality) f.write(img.to_jpeg(quality))
-
Thank you very much, I will try.
-
Thanks, it worked.
How would I load a JPG image ?
Img = ? -
img = ui.Image('test.jpg')
-
Thank you very much