11 votes

Is there a FLAC equivalent for digital comics?

I’ve bought enough digital comic bundles now that they’re starting to take up a decent chunk of storage space.

What I’d love to do, if possible, is losslessly compress them all down to their minimum sizes, in the same way that FLAC does with music. Is this a thing? And if so, what’s the best way to do it?

If lossless compression isn’t possible, is there a lossy compression that’s effectively lossless in that I won’t be able to tell the difference anyway? Lossless compression gives me good piece of mind, but the storage savings from an invisible lossy one are honestly quite appealing too.

7 comments

  1. ShamedSalmon
    Link
    You're probably looking for a comic book archive format like .cbz. It's just a standard zip container, but the image files you store within it remain untouched. So if you have a source where all...

    You're probably looking for a comic book archive format like .cbz. It's just a standard zip container, but the image files you store within it remain untouched.

    So if you have a source where all the images are lossless .pngs, you can wrap them in a zip archive, rename the extension to cbz, and open it with an ereader program to enjoy both the space savings of zip compression and the original quality of your images.

    4 votes
  2. Akir
    Link
    I am not aware of an image format that is optimized for comic books. But there are hundreds of different compression algorithms for images so there are probably ones that I am unaware of. To that...

    I am not aware of an image format that is optimized for comic books. But there are hundreds of different compression algorithms for images so there are probably ones that I am unaware of. To that extent I would consider the most important thing is compatibility with the software and hardware you want to use.

    Compression is a bit of an art in and of itself. Producers usually put some care into the way their files are prepared for delivery so if you have legally acquired comic books, the main recommendation is to retain the encoding it already has.

    If you are scanning in images yourself, then I would honestly say you’re probably fine using the efficient image compression du jour. HEIC was the big one the last time I checked, WebP was another big one earlier, and the last one I remember reading about was one I can’t remember the name of which used AV1’s compression tech. I heard rumblings of AV2 being in development so maybe there’s a still image format coming out for that too. The real difficulty is figuring out what settings to use for the compression to balance compression and quality. This is an area with no definitive answer, and it varies on a per-image basis if you want the absolute best compression:quality ratio.

    If you do want lossless compression and you’re only going to view on displays, then honestly PNG ain’t half bad. I honestly wouldn’t bother with lossless image compression these days unless you are dealing with low resolutions where pixel precision is necessary. For example, I can’t stand looking at Octopath Traveller Zero (on Switch 2 at least) because of the compression ruining the pixel aesthetic. It’s a noisy mess. For any image stored in a greater resolution than your average display, lossy compression is more than adequate and newer encoding techniques are massive improvements over the JPEGs of our youth.

    3 votes
  3. xk3
    (edited )
    Link
    WAV is pretty unique in that it almost always is uncompressed (there are ways like ACM but usually people use a different file extension so that it isn't confusing). FLAC can recreate a WAV file...

    WAV is pretty unique in that it almost always is uncompressed (there are ways like ACM but usually people use a different file extension so that it isn't confusing). FLAC can recreate a WAV file bit for bit (or at least the PCM part) and it actually has a compression option which is why it's so much better than WAV.

    I think audio gets away with this because audio is so small. Purely uncompressed image pixel matricies are huge which is probably why it isn't very common.

    For images I think you can find an analogy of TIFF to PNG. You can convert between them losslessly, depending on your settings. But the results might be much less impressive as TIFF is a much more robust format with many compression options built-in. So your file might even increase in size if the TIFF compression algorithm of the original file is better than PNG.

    For a lossy option you might try this, I wrote a multi-file optimizer that will, among other things, convert images and even CBZ/CBR archives to AVIF images. This can reduce file sizes A LOT. The default settings might be too extreme but you can override them with flags like setting the max image width/height:

    https://github.com/chapmanjacobd/shrink

    1 vote
  4. unkz
    Link
    What kind of format are they in now? Are they scanned or like, digital art? Do you have an example of even a single page you could share?

    What kind of format are they in now? Are they scanned or like, digital art? Do you have an example of even a single page you could share?

    1 vote
  5. Chemslayer
    Link
    I sort my comics using Calibre (which is just a book organizing tool). I usually convert my comics to Epubs if they aren't already (using Kindle Comic Converter). Then, open the comic in question...

    I sort my comics using Calibre (which is just a book organizing tool). I usually convert my comics to Epubs if they aren't already (using Kindle Comic Converter). Then, open the comic in question with Calibres "Edit Book" function, go to File>Edit Pictures Losslessly, and when the menu pops up select "Allow lossy compression" with a quality of 80%.

    In doing this I cut the size massively, usually 30-50% for mangas, and surprisingly 80% for most western-style comics (going from 300-400MB down to usually 30-50MB). And I really can't tell any difference; my e-reader is 11", so larger than most comic pages in real life, and I notice zero issues in the art or anything that only it was compressed at all.

    Calibre does also have the option to Losslessly compress, but that cuts size by 5-10% at most usually, and given that I can't tell even looking for it it's much worth it to lossy compression instead

  6. Durinthal
    Link
    Other people have already covered the obvious paths, so that reminds me of someone creating a new comic file format a few months ago. However, that was more about performance rather than size...

    Other people have already covered the obvious paths, so that reminds me of someone creating a new comic file format a few months ago. However, that was more about performance rather than size (though they mention deduplication which could save space in some cases) and it's likely going to be a while before it sees any significant amount of adoption in reader software if it ever takes off.

  7. kacey
    Link
    May I ask what the format of the files is right now? I'm guessing they're already JPEGs at some high quality setting, given that comics probably don't compress well with PNGs (they're not mostly...

    May I ask what the format of the files is right now? I'm guessing they're already JPEGs at some high quality setting, given that comics probably don't compress well with PNGs (they're not mostly flat, textureless colours).

    Once they're JPEG'd, if you want to keep the conversions lossless, you'll have to stick with JPEG optimization tools: mozjpeg can crunch a few percent off of most JPEGs (similar to PNGcrush), and if you're willing to jump formats, JPEG-XL can push that another few percent further. The wildly optimistic numbers I've seen say that you can take off up to ~20% that way without any decrease in quality.