I am very new to Processing and coding in general. I am studying art in the Netherlands and started learning about the basics of processing in the past few weeks to include it into my art practice. So please bear with me.
What I would like to achieve is to make a programme that would take any image and sort all the pixels by color according to its value on the gradient, from white to black or the other way around.
Here is what I had in mind on how the programme could function: it takes the "whitest" pixel out of the image and stores its RGB value somewhere. There would be one empty pixel space anywhere on the image where the whitest pixel was. All the other pixels would be pushed "to the right" or +1. There would be one empty pixel space on position 1 (top-left). So you could place the stored whitest pixel on empty position 1. And so on and so on. This way you could see the process of pixel displacement.
I had in mind to sort them by hue but I figured that the black pixels and white pixels would be left out.
I had an attempt at coding something but I don't get to the result I want. Maybe my project is a bit too ambitious for a beginner...!