Because of the memory limitations on a raspberry pi, I discovered that if I 
use Pillow to read the image and scale it to the screen dimensions instead 
of the photo untouched dimensions it would work really well.  Since doing 
that, I haven't run out of memory putting a large image into a sprite.  

So basically I do something like this:

   1. A schedule fires off and calls the image load method
   2. Image load =
      1. tmp_pilimage = PIL.Image.open(path_to_image)
      2. If the orientation of the image needs to be adjusted, do so then
      3. tmp_pilimage.thumbnail((target_width, 
      target_height),PIL.Image.LANCZOS)
   3. curpic_image = pyglet.image.load(path_to_image)
   4. curpic_sprite = pyglet.sprite.Sprite(curpic_image)

What does release the GIL mean?


On Friday, November 29, 2019 at 5:33:02 PM UTC-5, Greg Ewing wrote:
>
> On 30/11/19 8:50 am, Rick Bonafied wrote: 
> > It'd be nice if I could load the image into a sprite in 
> > the "background" without affecting the countdown. 
>
> What are you using to load the image? You'll have to do it in 
> another thread using something that releases the GIL during 
> the load. 
>
> -- 
> Greg 
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyglet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyglet-users/f575898f-c5ab-474a-99e4-d84e95ebb9cc%40googlegroups.com.

Reply via email to