Skip to content

Instantly share code, notes, and snippets.

@Vadbeg
Created February 29, 2020 17:40
Show Gist options
  • Save Vadbeg/a6a0faadfe70ebdafb24941b0ae4c18b to your computer and use it in GitHub Desktop.
Save Vadbeg/a6a0faadfe70ebdafb24941b0ae4c18b to your computer and use it in GitHub Desktop.
def create_blank_image(height, width, rgb_color=(0, 0, 255)):
"""
Creates np.array, each channel of which is filled with value from rgb_color
Was stolen from:
:source: https://stackoverflow.com/questions/4337902/how-to-fill-opencv-image-with-one-solid-color
"""
image = np.zeros((height, width, 3), np.uint8)
color = tuple(reversed(rgb_color))
image[:] = color
return image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment