• @zerofk@lemm.ee
    link
    fedilink
    English
    83 months ago

    “And while Spectral JPEG XL dramatically reduces file sizes, its lossy approach may pose drawbacks for some scientific applications.”

    This is the part that confuses me. First of all, many applications that need spectral data need it to be as accurate as possible. Lossy compression in that might not be acceptable.

    More interestingly (and I’ll read the actual paper for this): which data will be more compressed? Simply put, JPEG achieves its best compression by keeping the brightness but discarding colour. Which dimension in which spectral space do the researchers think can be more compressed than others? In this case there is no human visual system to base the decision on.

    • @hera@feddit.uk
      link
      fedilink
      English
      13 months ago

      I literally can’t think of a scientific use case where lossy compression would be acceptable?

  • @AbouBenAdhem@lemmy.world
    link
    fedilink
    English
    83 months ago

    Spectral JPEG XL utilizes a technique used with human-visible images, a math trick called a discrete cosine transform (DCT), to make these massive files smaller […] it then applies a weighting step, dividing higher-frequency spectral coefficients by the overall brightness (the DC component), allowing less important data to be compressed more aggressively.

    This all sounds like standard jpeg compression. Is it just jpeg with extra channels?

    • @Prok@lemmy.world
      link
      fedilink
      English
      103 months ago

      Yeah, it compresses better too though, and jpeg XL can be configured to compress lossless, which I imagine would also work here

    • @wischi@programming.dev
      link
      fedilink
      English
      5
      edit-2
      3 months ago

      It’s not just like jpeg with extra channels. It’s technically far superior, supports loss less compression, and the way the decompression works would make thumbnails obsolete. It can even recompress already existing JPEGs even smaller without additional generation loss. It’s hard to describe what a major step this format would be without getting very technical. A lot of operating systems and software already support it, but the Google chrome team is practically preventing widespread adoption because of company politics.

      https://issues.chromium.org/issues/40168998

        • @wischi@programming.dev
          link
          fedilink
          English
          6
          edit-2
          3 months ago

          JPEG does not support lossless compression. There was an extension to the standard in 1993 but most de/encoders don’t implement that and it never took off. With JPEG XL you get more bang for your buck and the same visual quality will get you a smaller file. There would be no more need for thumbnails because of improved progressive decoding.

          https://youtu.be/UphN1_7nP8U

          • @uis@lemm.ee
            link
            fedilink
            English
            23 months ago

            Then same can be said about JPEG LS and JPEG XL. Most browsers don’t implement that.

        • @wischi@programming.dev
          link
          fedilink
          English
          23 months ago

          JPEG does not support lossless compression. There was an extension to the standard in 1993 but most de/encoders don’t implement that and it never took off. With JPEG XL you get more bang for your buck and the same visual quality will get you a smaller file. There would be no more need for thumbnails because of improved progressive decoding.

          https://youtu.be/UphN1_7nP8U

  • pelya
    link
    fedilink
    English
    23 months ago

    What, pickle.dump your enormous Numpy array not good enough for you anymore? Not even fancy zlib.compress(pickle.dumps(enormousNumpyArray)) will satisfy you? Are you a scientist or a spectral data photographer?

    • @KingRandomGuy@lemmy.world
      link
      fedilink
      English
      13 months ago

      I guess part of the reason is to have a standardized method for multi and hyper spectral images, especially for storing things like metadata. Simply storing a numpy array may not be ideal if you don’t keep metadata on what is being stored and in what order (i.e. axis order, what channel corresponds to each frequency band, etc.). Plus it seems like they extend lossy compression to this modality which could be useful for some circumstances (though for scientific use you’d probably want lossless).

      If compression isn’t the concern, certainly other formats could work to store metadata in a standardized way. FITS, the image format used in astronomy, comes to mind.

      • pelya
        link
        fedilink
        English
        13 months ago

        Saving arbitrary metadata is the exact use case for pickle module, you just put it together with your numpy array into a tuple. jpeg format has support for storing metadata, but they are an afterthought like .mp3 tags, half of applications do not support them.

        I can imagine multichannel jpeg to be used in photo editing software, so you can effortlessly create false-color plots of your infrared data, maybe even apply a beauty filter to your Eagle Nebula microwave scans.

  • @rdri@lemmy.world
    link
    fedilink
    English
    13 months ago

    Last I checked, JPEG XL takes a lot of time and resources to encode (create) an image, if you actually want it to be far more optimized than JPEG.