Performance of single images vs large file?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Aoide
Regular
Posts: 31
Joined: Sat Jun 11, 2011 2:40 am
Contact:

Performance of single images vs large file?

#1 Post by Aoide » Fri Nov 06, 2015 2:47 am

Which is better performance-wise: loading several individual images as displayables or loading all the images from a single file and using LiveCrop to make the individual displayables?

For example:

Code: Select all

image bg 1 = "bg1.jpg"
image bg 2 = "bg2.jpg"
vs:

Code: Select all

image bg 1 = LiveCrop((0, 0, 300, 300), "all_bgs.jpg")
image bg 2 = LiveCrop((300, 300, 300, 300), "all_bgs.jpg")
Also: does it make a difference if the images are used as part of a dynamic displayable?

User avatar
SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: Performance of single images vs large file?

#2 Post by SundownKid » Fri Nov 06, 2015 2:49 am

I haven't noticed any loading times period in any Renpy game I've played, so I kind of doubt that kind of nit-picking is necessary. Making everything separate images will be fine.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Performance of single images vs large file?

#3 Post by nyaatrap » Fri Nov 13, 2015 8:33 am

If you use im.Crop (and other im manipulators), it becomes certainly slow and takes more RAM usage.
On the other hand, LiveCrop is a same operation to Transform. In my test, the above codes work in the same performance.

Post Reply

Who is online

Users browsing this forum: Hojoo