Optimising the benefits of spectral x-ray imaging in material decomposition