***000***
***000***
***000***
pixels1[] =
(***000******000******000***)
I need to copy the star values
******
******
******
pixels2[] =
(******************)
Into a shorter array
Needs to be flexible i.e
****0000****
****0000****
****0000****
****0000****
-->
********
********
********
********
copy of 1 dimensional[] (theoretically 2d) based on height from pixels1[] --> pixels2[]
I don't know if this makes any sense, but any ideas would be helpful. There has to be some algorithm for it, but i can figure it out. Extra: how does one generate an algorithm for stuff like this?