numpngw | create PNG and animated PNG files

 by   WarrenWeckesser Python Version: Current License: BSD-2-Clause

kandi X-RAY | numpngw Summary

kandi X-RAY | numpngw Summary

null

Functions that create PNG and animated PNG files from numpy arrays.
Support
    Quality
      Security
        License
          Reuse

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of numpngw
            Get all kandi verified functions for this library.

            numpngw Key Features

            No Key Features are available at this moment for numpngw.

            numpngw Examples and Code Snippets

            No Code Snippets are available at this moment for numpngw.

            Community Discussions

            QUESTION

            How to save a very large numpy array as an image, loading as little as possible into memory
            Asked 2020-Jun-18 at 11:13

            My program is often working with numpy arrays that are very large ((819200, 460800, 4), uint8). To store this in memory (as just pure zeros) I would need over 1.3TB of memory which is absurd. My goal is to be able to save these numpy arrays as an image. I also want it to be as fast as it can, but speed is less of an issue.

            What I was doing at the very beginning was storing the numpy array in an HDF5 file (using H5PY), then I would do processing on that array, then use CV2 to save. Not only was it slow, CV2 seems to load the image into memory, so that idea went out of the window very quickly. Now, I have tried over 20 different methods of saving these large arrays, so to shorten the post, I'll just mention some of the latest one.

            After using CV2, I found a library called 'numpngw'. Its a numpy and python based png writer. This was my code:

            ...

            ANSWER

            Answered 2020-Jun-07 at 20:26

            Standard TIFF cannot be used to store a 100000x100000 RGB image unless maybe if it is extremely compressible. The size of TIFF files is limited to 4 GB due to the usage of 32-bit offsets. BigTIFF uses 64-bit offsets. To enable tifffile writing BigTIFF, use the bigtiff=True parameter with memmap or imwrite. However, not many software/libraries will be able to read the files because BigTIFF and/or large strip sizes are not supported.

            Images this large are commonly stored tiled, often with compression and multiple resolutions (pyramids). Tifffile can create tiled (Big)TIFF from a memory-mapped numpy array or a generator of tiles, e.g.:

            Source https://stackoverflow.com/questions/62245475

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install numpngw

            No Installation instructions are available at this moment for numpngw.Refer to component home page for details.

            Support

            For feature suggestions, bugs create an issue on GitHub
            If you have any questions vist the community on GitHub, Stack Overflow.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries