Created
December 24, 2021 12:14
-
-
Save companje/85e94ea96629ddaf1219f137b225fd69 to your computer and use it in GitHub Desktop.
16bit grayscale to separate 8 bit color channels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np, cv2 | |
src = cv2.imread("moon-elevation-8k-16bit.tif",cv2.IMREAD_UNCHANGED) | |
h,w = src.shape | |
dst = np.zeros((h,w,3), np.uint8) | |
dst[:,:,1] = (src & 0xff00) >> 8 | |
dst[:,:,2] = src & 0x00ff | |
cv2.imwrite("moon-bump.png",dst) |
Author
companje
commented
Dec 24, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment