Skip to content

Instantly share code, notes, and snippets.

@nimpy
Last active July 28, 2020 13:59
Show Gist options
  • Save nimpy/cfe51b3e30b7817d1c043c8614cc32f1 to your computer and use it in GitHub Desktop.
Save nimpy/cfe51b3e30b7817d1c043c8614cc32f1 to your computer and use it in GitHub Desktop.
Making 3 channel image by stacking a 1 channel image three times
import numpy as np
image_3ch = np.repeat(image_1ch, 3, axis=1).reshape((image_1ch.shape[0], image_1ch.shape[1], 3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment