I am getting a strange error saving a tiff file (stack grayscale), any idea?:

> 
> File
>  "C:\Users\ptyimg\_np.MT00200169\Anaconda3\lib\site-packages\tifffile\tifffile.py",
>  line 1241, in save
>  sampleformat = {'u': 1, 'i': 2, 'f': 3, 'c': 6}[datadtype.kind] KeyError: 'b'
> 
> 
> 

my code is

```
 #!/usr/bin/env python
# -*- coding: utf-8 -*-
from skimage.morphology import watershed
from skimage.feature import peak_local_max
from scipy import ndimage
from skimage import img_as_float
from skimage import exposure,io 
from skimage import external 
from skimage.color import rgb2gray
from skimage.filters import threshold_local  , threshold_niblack
import numpy as np
import  tifffile 
from joblib import Parallel, delayed 
import sys

# Load an example image
input_namefile = sys.argv[1]
output_namefile = 'seg_'+ input_namefile  

#Settings 
block_size = 25 #Size block of the local thresholding 

img = io.imread(input_namefile, plugin='tifffile') 
thresh =  threshold_niblack(img, window_size=block_size , k=0.8) # 
res = img > thresh
res = np.asanyarray(res)
print("saving segmentation")
tifffile.imsave(output_namefile, res , photometric='minisblack' )

```