Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python linux - display image with filename as viewer window title

when I display an image with PIL Image it opens an imagemagick window but the title is some gibberish name like 'tmpWbfj48Bfjf'. How do I make the image filename to be the title of the viewer window?

like image 741
Gil-Mor Avatar asked Apr 21 '17 15:04

Gil-Mor


1 Answers

Use the title attribute: Image.show(title="Your Title Here" [...]

From the documentation:

Image.show(title=None, command=None) Displays this image. This method is mainly intended for debugging purposes.

On Unix platforms, this method saves the image to a temporary PPM file, and calls the xv utility.

On Windows, it saves the image to a temporary BMP file, and uses the standard BMP display utility to show it (usually Paint).

Parameters: title – Optional title to use for the image window, where possible. command – command used to show the image

like image 179
rm-vanda Avatar answered Oct 09 '22 20:10

rm-vanda