i think a more natural behavior of optimize=true would be to also fit a shape to make it consistent with the automatic peak picking. This is also important for many techniques such as XPS or XRD where we actually also want to know the width of the peak. I.e., i would call https://github.com/mljs/global-spectral-deconvolution/blob/985d9aa4d539c2ccf5afd84c51b49d58037da5ac/src/post/optimizePeaks.js#L23 and not simply look for the closest min/max
what do you think @lpatiny