You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created a script which takes in a list of image files and generates a series of grid images based on a logical matrix of those original inputs, with optional x/y axis labels, etc. There is a max size each grid image can reach, at which point the current one will be saved and a new one will be created with input files not yet processed. It's using the Python PIL library for image creation, combining and saving.
I'm using tqdm to show progress on processing logic that combines the input image files for each grid (because those are for loops and have defined ranges), but the relatively long and undefined wait time for each file to be saved has no such display of progress - it just hangs until done:
Again, being a novice with Python, it seemed the only thing I read which might possibly be related to showing progress for the PIL image save activity might be where tqdm can be piped for I/O operations. But maybe that doesn't apply in this case for my script?
My code for saving is pretty simple:
image.save(image_filename)
Still, I thought it might be helpful to ask this question, as I didn't find similar questions yet in my searching.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, novice Python user here.
I've created a script which takes in a list of image files and generates a series of grid images based on a logical matrix of those original inputs, with optional x/y axis labels, etc. There is a max size each grid image can reach, at which point the current one will be saved and a new one will be created with input files not yet processed. It's using the Python PIL library for image creation, combining and saving.
I'm using tqdm to show progress on processing logic that combines the input image files for each grid (because those are for loops and have defined ranges), but the relatively long and undefined wait time for each file to be saved has no such display of progress - it just hangs until done:
https://pillow.readthedocs.io/en/stable/_modules/PIL/Image.html#Image.save
Again, being a novice with Python, it seemed the only thing I read which might possibly be related to showing progress for the PIL image save activity might be where tqdm can be piped for I/O operations. But maybe that doesn't apply in this case for my script?
My code for saving is pretty simple:
image.save(image_filename)
Still, I thought it might be helpful to ask this question, as I didn't find similar questions yet in my searching.
Beta Was this translation helpful? Give feedback.
All reactions