The imaging data was analyzed and visualized with an in-house developed Matlab (MathWorks, USA) based applica on. The image sets were first filtered with BM4D, a state-of-the-art unsupervised noise reduc on algorithm . Measurements of pure and dry PVPVA and RTV films and pH 6.8 phosphate buffer were then used to generate reference spectra for non-nega ve classical least squares (CLS) unmixing analysis of the data obtained during the in situ analyses. For (semi-)quan ta ve analysis, the resul ng CLS coefficients (scaling value of each reference spectra in a pixel) were scaled such that in each pixel the coefficients of the components (PVPVA, RTV, and buffer, depending on the measurement) sum to one (closure). Rela ve propor ons of each component were calibrated using a known concentra on loca on of a measurement and the calibra on was the same for each dissolu on experiment.