I'm using Landsat 8 imagery in Python and want to make true color images that would look good in a publication. I have many images, so ideally this would be an automated process where each image comes out looking not too dark, not overexposed, and with good contrast.
What I've been using is a linear stretch of 1.25%, but some of the images still look washed out.
from skimage import exposure import matplotlib.pyplot as plt import numpy as np r = np.random.randint(0, 255, size=10000).reshape((100, 100)) g = np.random.randint(0, 255, size=10000).reshape((100, 100)) b = np.random.randint(0, 255, size=10000).reshape((100, 100)) rgb = np.dstack((r, g, b)) def linearStretch(input, percent): pLow, pHigh = np.percentile(input[~np.isnan(input)], (percent, 100 - percent)) img_rescale = exposure.rescale_intensity(input, in_range=(pLow, pHigh)) return img_rescale img_rescaled = linearStretch(rgb, 1.25) plt.figure() plt.imshow(img_rescaled)
Is there a known image enhancement technique that can be used to reliably process images automatically without much/any individual tweaking?
All of my images have had clouds removed and replaced with NaN.