Convert .cbf to lossless image format with defined "dynamic range"
import os
from glob import glob
import fabio

path = '/Users/myuser/Documents/Crystals'

result = [y for x in os.walk(path) for y in glob(os.path.join(x[0], '*.cbf'))]

i = 0
command = ''
while i &lt; len(result):

    path = os.path.dirname(result[i])
    filename = os.path.splitext(result[i])[0]+'.tif'

    command = '/Applications/Adxv.app/Contents/MacOS/Adxv -smv32bits -sa -overload 500 '+result[i]+' '+filename
    os.system(command)

    i += 1



In the end I figured it out using Adxv in stand alone -sa and -overload N as dynamic range.