Question

I have a Python script that displays images fullscreen on a BeagleBoard with the GUI disabled. The script is started when the board boots. For this I use PyGame which works perfectly fine. Except for some reason the image qwality is scaled down. Because the images are stored in HQ I assume that PyGame resamples the image. I was unable to find out where this can be changed so I decided to replace PyGame, it also seems a bit much to "just" display an image.

I have the code below to display the image. According to documentation the default image viewer will show the image. (Which is supposed to be XV). But as soon as I run the code below where image is a filepath I get "sh: xv: not found".

from PIL import Image
im = Image.open(image)
im.show()

So I tried to install the XV package but can't find how to install it for Angstrom.

My question could either be "How to display images fullscreen with Python?" (To which the answer was supposed to be the code above). Or the question is "How can I get XV installed on Angstrom?" (What is the package name for opkg install)

I did search, but haven't found something that works...

Was it helpful?

Solution

Image.show() in PIL is more intended for debugging than actual, production use. It is hardcoded to call xv <temp-image-file-pil-creates>. You can hack around this (make a symbolic link called xv that will call some other image viewer), but it's still a rather bad way to go about it.

I don't know enough about the BeagleBoard to tell you the best/canonical way to display an image fullscreen, but if you got halfway there with PyGame, perhaps you can post your code and the community can help you fix the quality problem.

If the image is getting downscaled to fit the screen, you might look into using transform.smoothscale to scale the image manually (to avoid losing quality).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top