- Home /
Question by
HitarthPadaliya · Jan 06, 2021 at 05:02 AM ·
c#texture2dpixels
Sort pixels according to their color in Texture2D in Unity
Recently, I was learning Texture2D
in Unity
. I have a custom empty class called ImageTest
and I want all the pixels to be sorted according to their color. For example, all the pixels with white color should be arranged as follows :-
class ImageTest
{
Color pixelColor = Color.white;
List <int> pixels = new List <int> () { 1, 5, 6, 14, 23, 25 }
}
Here, pixels
are all the pixels of the image that have white color and I stored them as numbers. Is there any way I can do this?
Thanks in advance.
Comment