File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1616import quaternion as quat
1717import xarray as xr
1818from PIL import Image
19+
1920from .utils import download , is_notebook , pushd
2021
2122Image .MAX_IMAGE_PIXELS = None
@@ -1426,18 +1427,18 @@ def array_to_rgba(
14261427 if opacity <= 1.0 :
14271428 opacity = int (255 * opacity )
14281429 rgba [::, ::, 3 ] = opacity
1429- elif opacitymap is True : # ndarrays are incompatible with bool().
1430+ elif opacitymap is True : # ndarrays are incompatible with bool().
14301431 oarray = (array * 255 ).round ().astype (np .uint8 )
14311432 rgba [::, ::, 3 ] = oarray
1432- elif hasattr (opacitymap , ' __array__' ): # numpy compatible object
1433+ elif hasattr (opacitymap , " __array__" ): # numpy compatible object
14331434 oarray = normalise_array (opacitymap )
14341435 if flip :
14351436 oarray = np .flipud (np .array (oarray ))
14361437 if oarray .max () <= 1.0 :
14371438 oarray = (oarray * 255 ).round ().astype (np .uint8 )
14381439 rgba [::, ::, 3 ] = oarray
14391440 elif opacitymap :
1440- raise TypeError (' Unknown opacitymap type: Expected bool or ndarray' )
1441+ raise TypeError (" Unknown opacitymap type: Expected bool or ndarray" )
14411442
14421443 return rgba
14431444
You can’t perform that action at this time.
0 commit comments