Hold a stained section up to a lamp. Where there is little stain, most of the light gets through; where there is a lot, little does. In general, each equal layer of stain passes the same fraction of the light reaching it, so transmitted light falls off exponentially with the amount of stain, and a camera records that falling transmission as pixel values.
Optical density undoes the exponential with a logarithm. In general, OD = −log₁₀(I / I₀), where I is the transmitted intensity and I₀ the intensity with no sample in the way. An OD of 1 means 10% of the light gets through, and an OD of 2 means 1%.
StrataQuest's two operations sit in the Basic Operations Module under Color ConversionsLoading.... The Engines Reference says Convert RGB to Optical Density (OD) is based on the Beer-Lambert law and gives a representation of the tissue thickness based on the observed light; Convert Optical Density (OD) to RGB applies the inverse law. It calls both conversions lossless, so the inverse can be applied. In the reference examples an 8-bit, 3-channel brightfield image of colon goes in and an 8-bit, 3-channel image comes out.
One detail is easy to miss. The reference notes that the OD formula, in theory, belongs to a grayscale image, but the engine applies it to each of R, G and B independently. So an RGB image becomes three OD channels, one per color, and in general that per-color view is what lets different stains be told apart, since each absorbs different colors.
The reference doesn't print the formula StrataQuest uses, say what intensity it takes as I₀, or say how OD values, which are not whole numbers, are scaled into an 8-bit output.