A lightweight wrapper for image normalization implemented by DIAGNijmegen, which used deconvolution based methods from Faryna et al. and Tellez et al..
pip install stainaug
import PIL.Image as Image
import numpy as np
from stainaug import Augmentor
# read in image
image_filepath = </path/to/image.jpeg>
img = np.asarray(Image.open(image_filepath))
# initialize augmentor
augmentor = Augmentor()
# transform image
augmented_img = augmentor.augment_HE(img)
For more examples see notebook here