Does compressed png takes longer time to load?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
FloatingBanana
Prole
Posts: 22
Joined: Sat Mar 02, 2019 4:57 pm
Contact:

Does compressed png takes longer time to load?

Post by FloatingBanana »

I don't know much about image compression/decompression, so please be clear if possible :3

I'm using Lily to load some big resources (pre-rendered 3D animations), but my game frequently freezes for a long time and even crashes sometimes while loading them. I found the site https://tinypng.com that compresses images and saves a lot of space, but i'm not sure if it would really improve the loading speed or do the opposite.

Code: Select all

if anyMistake(self.english) then
    print("Sorry, english is not my first language")
end
User avatar
Varkas
Citizen
Posts: 83
Joined: Mon Mar 09, 2020 2:26 pm

Re: Does compressed png takes longer time to load?

Post by Varkas »

It depends. If reading (IO speed) the files is the limit, smaller files will load faster. If CPU power is the limit, less compressed images will be faster to load.
In soviet russia, code debugs you.
User avatar
AuahDark
Party member
Posts: 107
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: Does compressed png takes longer time to load?

Post by AuahDark »

"Crash" sounds like very unspecific. Compressiong your PNG further (in the website you linked, it performs lossy compression) doesn't really affect the loading times much, but if you're size constraint then compressing it more may give you benefits.
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
Nelvin
Party member
Posts: 124
Joined: Mon Sep 12, 2016 7:52 am
Location: Germany

Re: Does compressed png takes longer time to load?

Post by Nelvin »

During development I recently moved over to tga as those load a lot faster on my pc. Originally I used tga because I worked/debugged my asset pipeline/tools and, obviously writing pngs is a lot slower than just dumping to uncompressed tgas. Out of curiosity I tried those in the game and the startup time improved a lot. I do lazy asset loading already and the typical dev level I usually work on required about 3-4 seconds to start but with tgas it's probably less than a second. May not sound like a lot but to me one of the huge benefits of using Löve/Lua is extremely fast iteration times so this improved my happiness even more.
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Does compressed png takes longer time to load?

Post by pgimeno »

Crashes while loading are likely to come from VRAM exhaustion. Further compressing the PNGs will save nothing in that respect, because Löve needs to expand them while loading in order to send them to VRAM.

There is an image format that is compressed even in VRAM. That is DXT. That would help saving VRAM, and probably also reducing load time because no CPU-side decompression is necessary (besides the default zip compression in .love files, which you can avoid by forcing zip to store the images without compression).
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Majestic-12 [Bot] and 51 guests