Is there a way to compress images in Ren'Py?

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
plaster
Regular
Posts: 89
Joined: Thu Jul 11, 2013 1:03 am
Tumblr: plasterbrain
Soundcloud: plasterbrain
Location: Chicago
Contact:

Is there a way to compress images in Ren'Py?

#1 Post by plaster »

Right now I have some some script which takes screenshots like this:

Code: Select all

renpy.take_screenshot((1280, 720))
photo = renpy.game.interface.get_screenshot()

f = open(fn_path, "wb")
f.write(photo)
f.close()
which works, but the resulting images are 3mb each. 😬 Is there a built-in method to compress png or jpg files in Ren'Py, or if not, is there an incredibly simple pure Python module I could import and use instead? Thaaaaanks ;~;

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Is there a way to compress images in Ren'Py?

#2 Post by PyTom »

This is not a documented API.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Google [Bot], henne