X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 04 Sep 2019 12:22 PM by  MariM
Masking to reduce stored file size
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Morgan Bond



New Member


Posts:2
New Member


--
04 Sep 2019 11:20 AM
    I have a very large 8-band image (61704 x 339816, worldview-3). I am only interested in about 10% of this image, although the portions of the image I would like are scattered throughout. I have used this tutorial to crop and mask the image to the roi of my areas of interest:

    https://www.harrisgeospatial.com/Learn/Blogs/Blog-Details/ArtMID/10198/ArticleID/15326/Can-I-Subset-an-Image-Using-a-Shapefile

    This seems to work fine. All of my areas of interest look as they should, and the masked out areas are "white." I chose a no-data value of 0 (zero). However, then I save this file, as an ENVI data file, it is exactly the same size (in GB) as the original unmasked image. Should I choose a different no-data value? I thought this would reduce the file size drastically.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    04 Sep 2019 12:22 PM
    I can see why you might think this but a raster is a raster and it is always rectangular. Setting a 'nodata' value doesn't remove those pixels. The pixels are still present but transparent for display and excluded in many processing tools. Those pixels are also in the same data type (integer, float, etc) as the other "good' or 'on' pixels since you can only store pixels with one data type.
    The only real way to reduce the data size is to clip the image to a smaller size (subset data from ROI) or to use a data type that requires less storage space (int or float converted to byte). If you have ROIs that are scattered throughout the image, then your image will only be reduced (clipped) by the *smallest rectangle boundary that encompasses all ROIs*, so the size may not be reduced by that much at all.
    You are not authorized to post a reply.