How to get colod id (HEX) from imported texture (animated RGB)

Hi Everyone.

Im new in this forum. I am a 3d artist with much experiences. but a beginner in UE.

My question is:

Is it possible to create a Material in UE, that can get color ID or HEX codes from imported texture?
So the ideaa is, i want to create a pixel art wall, where every big pixel get the color based on the imported image (animated). I also attach an example that i dit in 3ds max.

I am now trying many hours to find somethink online, but with no luck.
If somebody has time to give me a way to make this, this will be awsome.

Thanks!