Python Forum
hatching based of maximum of 3 different arrays
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hatching based of maximum of 3 different arrays
#2
untested
import numpy as np

A = np.random.randint(0, 255, size=(72,144))
B = np.random.randint(0, 255, size=(72,144))
C = np.random.randint(0, 255, size=(72,144))

colormap = np.zeros((72,144,3), dtype='uint8')
colormap[(A>B) & (A>C),0] = 255 # red
colormap[(B>A) & (B>C),1] = 255 # green
colormap[(C>A) & (C>B),2] = 255 # blue
Reply


Messages In This Thread
RE: hatching based of maximum of 3 different arrays - by ThomasL - Jun-24-2019, 02:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  hatching not working properly with matplotlib Staph 3 3,015 Jul-28-2019, 07:17 AM
Last Post: ThomasL

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020