Just to chip in here, I've also had issues with very large files.  My work
around in the past was to simply resize files with imagemagick before
loading them in pygame.

I've also done the "large chunks and lazy load" with some success, but only
after some preprocessing outside of pygame.

Best of luck!

On Thu, Sep 29, 2016 at 4:06 PM, herve <hc...@viva-vous.net> wrote:

> On 29/09/2016 18:43, mspaintmaes...@gmail.com wrote:
>
> From the programming side, what is the use case for an image that size?
> I'm imagining a background that pans with a sprite, which if it were me, I
> would personally slice the image into large chunks and lazy-load them on an
> as-needed basis. This would possibly lead to a better overall user
> experience as it doesn't consume lots of memory at once (assuming you clean
> up a cache) and generally doesn't cause noticeable pauses to load large
> images. But such a solution may or may not be doable depending on your use
> case.
>
> Another hybrid option is slicing the image file and then aggregating it
> after it's been decoded. If the JPEG decoder of pygame.image.load() is to
> blame, loading individual tiles into pygame.Surfaces and then creating one
> giant Surface and blitting them all onto it may get around this constraint.
>
> But I would personally do the lazy-load approach.
>
> That's the "Tell me what *you need*, and *I'll tell you* how to *get
> along without* it"... i like that joke. sorry.
>
> hervé
>

Reply via email to