CBZ has no specification: it is a convention, started by the CDisplay reader, that a ZIP archive of images is a comic. What follows is how the common readers (ComicRack, CDisplayEx, YACReader, Komga, Kavita, calibre) treat the files, which in practice defines the format.
The ZIP container
- The file is an ordinary ZIP archive and starts with
50 4B 03 04(PK\3\4). There is nomimetypeentry or other marker; a reader should check the signature, since files named.cbzare sometimes RAR or 7z archives. - Images are usually stored without compression (method 0), since JPEG and PNG do not compress further; Deflate (method 8) is also common. Readers support whatever their ZIP library does; Deflate64, LZMA and others may fail in some.
- Encrypted entries are not supported by most readers.
- File names are UTF-8 when general-purpose flag bit 11 is set; older archives use the code page of the computer that made them, which can garble non-ASCII names.
- A ZIP64 archive is needed for files over 4 GB, rare for comics.
Images
Each page is one image file. JPEG and PNG are universal; GIF, WebP, AVIF and JPEG XL
are read by newer readers, and BMP and TIFF by some. Readers decide what is an image
from the extension (.jpg, .jpeg, .png,
.gif, .webp and so on), ignoring other files such as
.txt, .nfo, .xml and Thumbs.db,
and folders such as __MACOSX. A two-page spread is usually one wide
image.
Page order
- Pages are shown in the order of their names, not their order in the archive.
- Most readers sort “naturally”, comparing runs of digits as numbers, so
page2.jpgcomes beforepage10.jpg. Some older readers sort plainly by character, so creators pad numbers with zeros:001.jpg,002.jpg…010.jpg. - Images may sit in a folder, or in several (for example one per chapter); the full path is sorted, so folders keep pages together.
- Case is usually ignored when sorting.
- The first image is the cover, unless ComicInfo.xml
marks another page as
FrontCover. Some readers instead pick an image namedcover. - Right-to-left reading for manga is set by ComicInfo’s
Mangaelement (YesAndRightToLeft) or by the user; the file order stays the reading order.
Metadata
Three conventions exist, and a file may carry more than one.
| Convention | Where | Format |
|---|---|---|
| ComicInfo | ComicInfo.xml in the archive root | XML, from ComicRack. By far the most used. |
| ComicBookInfo | The ZIP file comment, at the end of the archive | JSON, from the ComicBookLover program; see below. |
| CoMet | A file such as comet.xml in the archive | XML with Dublin Core-like elements; rarely used now. |
ComicBookInfo
The ZIP archive’s comment holds one JSON object. Its key
ComicBookInfo/1.0 holds the metadata; appID names the
program that wrote it and lastModified when. Inside, the fields are
series, title, publisher,
publicationMonth, publicationYear, issue,
numberOfIssues, volume, numberOfVolumes,
rating, genre, language, country,
credits (a list of objects with person, role
and, optionally, primary), tags (a list) and
comments. Because it lives in the comment, it can be changed without
rewriting the archive. ComicTagger reads and writes it.
{"appID": "ComicTagger/1.0",
"lastModified": "2024-05-01 10:00:00",
"ComicBookInfo/1.0": {
"series": "Harbour Lights", "issue": "3", "publicationYear": 2024,
"credits": [{"person": "Ana Ruiz", "role": "Writer", "primary": true}],
"tags": ["noir"]}}