• 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.