• lars@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    This story is a nightmare and I’m not sure if it’s better or worse now knowing that it was ancient ICO files that tipped you off.

    Open question to you or the world: for every lossless compression I ever perform, is the only way to verify lossless compression to generate before and after bitmaps or XCFs and that unless the before-bitmap and after-bitmap are identical files, then lossy compression has occurred?

    • The_Decryptor@aussie.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      22 hours ago

      Pretty much, you can use something like ImageMagick’s compare tool to quickly check if the round trip produced any differences.

      It can be a bit muddled because even if the encoding is lossless, the decoding might not be (e.g. subtle differences between using non-SIMD vs. SIMD decoding), and it’s not like you can just check the file hashes since e.g. PNG has like 4 different interchangeable ways to specify a colour space. So I’d say it’s lossless if the resulting images differ by no more than +/- 1 bit error per pixel (e.g. 127 becoming 128 is probably fine, becoming 130 isn’t)

      • lars@lemmy.sdf.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        16 hours ago

        Hey wow! Thank you!!

        This explains a lot—including, likely, your username. Cheers!