Disc image compression

Systems from the 5th and 6th console generation often use optical discs like CD or DVD to store game data. Disc image sizes range from 700 MB (CD), 1.4 GB (GC Mini-DVD), 4.7 GB (single-layered DVD) and even 25 GB (Blu-Ray) for newer systems. Often times only a fraction of the actual disc size is used for game data and the rest is filled with dummy data to be optimized for read access by the optical drive laser.

The Super Mario 25th Anniversary Wii disc itself is a 4.7GB, when really the actual game data is only a single SNES ROM (12 MB of useful data). Disc compression helps to save more than 99% of hard disk space and can speed up loading time on emulators.

On the other side systems like the Sony PlayStation often use multi-track images (data and audio tracks) containing several *.bin and *.cue files which can become cumbersome in daily usage with Batocera or other emulation frontends.

Choosing the right disc image compression can help in both cases and should be the preferred format for most of the disc based systems. This page will help you to find the suitable compression method and toolset.

If you are not familiar with using command line tools there are is also a GUI-based helper tool available:

CHD is short for (C)ompressed (H)unks of (D)ata. It is a lossless compression format originally developed for MAME, for the hard-drive contents of certain arcade machines. It has since been used in several other emulators as a means of storing disc based game data. It compresses the contents of a disc image to a handy single .chd file. Here's a comparison between 7z file compression and CHD (originally an 700 MB image):

Over 60 MB saved compared to 7z! It's like magic!

CHD is supported by many systems and the recommended format for the following systems:

If you have one of the PAL PlayStation games that features LibCrypt copy protection, you have a .sbi file in addition to the .bin/.cue file. The CHD creation process doesn't process the .sbi file. Therefore you will need the .sbi file in the same directory as the .chd file for the game to run.

CHD files can be created using the chdman program, developed by the MAME project.

chdman is a commmand line application. You can create a .chd file by targeting *.cue, *.iso or *.gdi files.

If there is a *.cue file available, always use this for creating the .chd. Otherwise choose the *.iso (Sony PlayStation 2) or *.gdi (Dreamcast) file. Note that GameCube/Wii have their own compressed format.

Open the command line in either Windows with cmd.exe or in Linux with your favorite terminal emulator. Put both chdman and the game file in the same folder, navigate to that folder in your terminal and run:

chdman createcd -i <game.cue> -o <game.chd>

For example, if the file structure was like so:

/totally-rad-folder-name/
 ├─ chdman
 ├─ Spiderman.cue
 └─ Spiderman.bin

then first cd /totally-rad-folder-name then run:

chdman createcd -i Spiderman.cue -o Spiderman.chd

Then make yourself a cup of tea. This can take a while. After that you'll have <game.chd> and you can delete the *.cue/*.bin, *.iso or *.gdi/*.bin file(s).

The compression is fully lossless so it is possible to redo the compression and get the original files back:

chdman extractcd -i <game.chd> -o <game.cue>

CHD batch converting

You can batch convert all files in a directory like following (replace .cue with the correct file type you want to convert):

Linux/macOS:

On Linux you can install the mame-tools package on most distributions. On macOS use brew to install the package rom-tools. Then you can navigate to the folder that has all your game ROMs and run the following for loop to convert all the files in one go:

for i in *.cue; do chdman createcd -i "${i}" -o "${i%.*}.chd"; done

replacing *.cue as needed. If you're converting a lot of files, practice some yoga poses. This may take a while.

Windows:

Just place the chdman.exe into the directory where you have your disc images. The official MAME package contains a copy of the executable file. You can download the EXE file and open it up like an archive with 7-zip, then extract chdman.exe.

Here's some handy BAT scripts you can just double-click to instantly convert all the games in the current folder to CHD:

For *.cue:

cue-to-chd.bat
for %i in (*.cue) do chdman.exe createcd -i "%i" -o "%~ni.chd"

For *.iso:

iso-to-chd.bat
for %i in (*.iso) do chdman.exe createcd -i "%i" -o "%~ni.chd"

For *.gdi:

gdi-to-chd.bat
for %i in (*.gdi) do chdman.exe createcd -i "%i" -o "%~ni.chd"

If you're converting a lot of files, play some tunes on your guitar. This may take a while.

CSO is a compression method for the ISO image format and is the short form for Compressed ISO. It also called CISO.

It was originally used to compress PlayStation Portable UMD disc images.

CSO/CISO is supported by multiple systems and the recommended format for the following systems:

  • ps2 (prior to Batocera v31)

The Wii/Gamecube also support a CSO/CISO format, that is unrelated to the compression method explained here. More information can be found at the wit: Wiimms ISO Tool.

There are different tools to create CSO files. maxcso is a free command line application that is available to Linux, macOS and Windows.

To compress an ISO file just use:

maxcso <game.iso>

This will create a <game.cso> file in the same folder. Afterwards you can delete the .iso files to free up space.

The compression is fully lossless so it is possible to redo the compression and get the original files back:

maxcso --decompress <game.cso>

CSO batch converting

Batch conveting can be done with a simple for loop.

Linux/macOS:

for i in *.iso; do maxcso "${i}"; done

Windows:

for %i in (*.iso) do maxcso.exe "%i"

The Dolphin team developed a new compression format based on WIA called RVZ. Unlike all the previous formats, RVZ is lossless and can preserve the padding data on Wii discs as well as the necessary files needed by the Wii's IOS. Usage is very similar to GCZ in Dolphin itself, but it only works on newer Dolphin versions.

RVZ is only supported by the Dolphin emulator and therefore the recommended format for the following systems:

You need the Dolphin emulator (minimum version 5.0-12188+) to compress ISO files. At the moment the compression has to be done via the User interface:

Find your game in Dolphins game list, right click and select “Convert File…”

The default settings should be fine. If you want you can raise the compression level.

You can convert your game image back to ISO from RVZ when you want to restore it back to an exact replica of your game ISO the same way.

RVZ batch converting

Just multi-select with pressing the CTRL key to choose multiple games and select “Convert File…”

  • disk_image_compression.txt
  • Last modified: 3 weeks ago
  • by atari