in fact,
for several loops we need a value of 256 for the 8bit version, while the ``maxbin``returned by ``_handle_input`` is only 255,

before I implemented the lines
```python
maxbin_list = [0, 0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096]
midbin_list = [0, 0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]
```
then using it with

```python
# set maxbin and midbin
cdef Py_ssize_t maxbin = maxbin_list[bitdepth]
cdef Py_ssize_t midbin = midbin_list[bitdepth]
```

maybe the ``_handle_input`` could return the maxbin+1 value...