[PyQt] Massive inflation of .qrc files

Scott Harvey bundito at gmail.com
Sun Dec 24 20:55:43 GMT 2017


Hi all, and happy holidays!

I've noticed that compiling a .qrc file into a qrc.py file results in a
massive increase in size, especially when containing an image.

I've got two, a big one that holds all the textures and graphics for my
main app. I've got another one I use for a quick splash screen.

It holds one image and I make sure it loads only what's necessary, displays
itself, then the rest of the app continues to load. However, here's some
details:

File            Size
-------                          -----------
splash.png       97244
splash.qrc          86
splash_qrc.py   402588

If you look in the .py file, it's got a ton of hexadecimal values, which
I'm guessing form the bytecode for the image. Uncompressed? There's
supposedly a "-compress" option for pyrcc5, but none of the values (1
through 9) seem to make a difference. I can load the .png file directly to
a QPixmap (e.g. not through a resource file), but this fails when I compile
my app with PyInstaller.

Obviously, my interest is in getting my splash screen up as quickly as
possible while the rest of the app loads. But when I've got to suck in
400Kb for a 97Kb image, the point is kind of lost.

I've tried putting "splash.hide()" as late in the execution order as
possible, but it's still fast. I'm not going to cheat and use "sleep()"  :-)

Does anyone have any insight? I can reduce the quality of the image (since
it's shown so briefly), but if the resulting resource file is so large,
there's not much point. And 97Kb is hardly a large image.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20171224/06656dbf/attachment.html>


More information about the PyQt mailing list