1. Encode each pixel’s color into a string:
-a. Start with the top left pixel.
-b. Write the color of the pixel in hexcode (#rrggbb).
-c. If there is pixel to the right of the current pixel, move onto that pixel. Otherwise, move to the leftmost pixel of the next row. Either way, continue again from step b.
2. Analyze the resulting string for runs.
-a. A run is defined as a sequence of identical pixel colors.
-b. For each run, count the number of times the color appears.
-c. Then replace the entire run with one instance of the pixel color, followed by “:n” where n is the number of consecutive pixels of that that color in the run.
im supposed to use this algorithm to complete an assignment but I'm not following at all can some one help me out and explain it a little better
What I have tried:
I have read this thing over and over but cant get a hold of it