You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While looking into #2923 I went through the generic_image reader code. All the images with A channel are converted to floats and NaNs are placed to the no data pixels. If there's no A but the image has a nodatavals metadata item present and nodata_handling is set to "fill_value" the image is kept as integer data. I'm not sure PNG supports the no data value (or fill value).
Maybe the generic_image reader should have a feature to force a fill_value that would replace the A band whether there is a fill value in the original image or not.
Saving to PNG with fill_value=0 using Satpy and reading the image back with rasterio, we can see that nodatavals are (None, None, None).
I think what we'd need is a set_fill_value kwarg that is used to set the nodatavals. A single value or a tuple. Then in .get_dataset() -> ._mask_image_data() we'd need to handle discarding of the A band for the case where set_fill_value is given.
While looking into #2923 I went through the
generic_image
reader code. All the images withA
channel are converted to floats andNaN
s are placed to the no data pixels. If there's noA
but the image has anodatavals
metadata item present andnodata_handling
is set to"fill_value"
the image is kept as integer data. I'm not sure PNG supports the no data value (or fill value).Maybe the
generic_image
reader should have a feature to force afill_value
that would replace theA
band whether there is a fill value in the original image or not.Originally posted by @pnuu in #2897 (comment)
The text was updated successfully, but these errors were encountered: