This wiki is very out of date, and only exists for historical reasons. For more modern information, see the new documentation and cookbook forum.


From Ren'Py Visual Novel Engine

Jump to: navigation, search

JCC - JPEG Compression of Character Art

JCC is a technique that replaces a single PNG image with two JPEG images, one for color data and one for alpha. Ren'Py recombines the JPG images, allowing the image to be reconstructed memory. As JPEG uses lossy compression, this technique allows one to trade small amounts of image quality for large reductions in disk space and download size.

before.png after.png
Comparison of images before (left) and after (right) JCC. The original image took 64 KB of disk space, while the compressed one takes 28 KB, for a reduction of 56%.


End User: The only requirement for the end user of JCC is that the game they're playing be made with Ren'Py 6.3.3 or greater.

Developer: The JCC tool requires:

It's expected that the developer knows how to run a Python script on his or her system.

Running JCC

To convert the images used in your game to use JCC, place the jcc.py script in the game directory of your project, and run it. This will do two things:

  • All PNG files with filenames like filename.png underneath the game directory will be moved to filename.png.bak, and will have filename.png.base.jpg and filename.png.mask.jpg created to store the JPEG-compressed data.
  • A script file, jcc.rpy, is added to the game directory. This file contains code that causes Ren'Py to use the compressed files.

Note that this will compress all PNG files in the game directory, losing some quality in the process. There are some files that you may not want compressed, such as the frame of the text window, or SFonts. You should restore these png files from the backups, and delete the corresponding jpg files.

Personal tools