Assume grid_sheet is an array (1000, 1000, 3)
and
array2 is numpy array shaped (13k-ish, 3).
We're basically treating this array2 like a list. A list of rgb value combinations. Each combination is unique.
And grid_sheet should be treated like a screenshot as if you've used snipping tool to create the image.
blank_sheet = np.zeros((grid_sheet.shape[0], grid_sheet.shape[1]))
for data in array2:
blank_sheet = np.where(((grid_sheet[:,:,2] == data[2]) & (grid_sheet[:,:,1] == data[1]) & (grid_sheet[:,:,0] == data[0])), blank_sheet+1, blank_sheet)
The output would be like a boolean array the same size as the grid_sheet. I don't want to use a for loop on array2 because it's just too slow.
I've tried splitting the channels to compare to their corresponding columns but when dstacking and summing it all back together just shows it marks nearly then entire grid with 1s. Results are the same if i merge the values together flatten then compare and then reshape to an image representable way. There are a number of other idea's i've tried, plenty of stackoverflow solutions i've tried to merge with others. I hardly see any point in nditer. someone tried suggesting itertools but i don't think the 2 mesh well together.