with Image.open("test.png") as im: print(im.format, im.size, im.mode) im = im.convert("CMYK")I now have picture data converted to CMYK.
I can then do something like
Make double for loops and extract all cyan data such as...
cyan=[] for x in range(0, xsize) for y in range(0, ysize) cyan = im[x, y,][0]where [0] is for Cyan, the first of four
I now have a list of cyan pixels.
Note, if the im pixel size is a few million, the above can take many seconds.
For all four colors, it can take minutes.
Is there a way to extract my cyan list and other four colors from im without having to count through the large im object?
My end goal is to use the Multiprocess python feature and do some pixel processing/math on all four colors at the same time.