colormap 0 from left to right, and top to bottom

I would like to be able to do create set of color going from top left to bottom right in the order of the title from a existing image. How would I do that?

For context, I’m trying to create the artistic version(this means it uses image instead of existing palettes or random colours) of my latest rectangle-square fill command, and it takes into account of colour space options. So, I would need to extract the colours to get to where I need as I plan to remap it.