Colours per cel/tile

I’m working on some tiles for a game I’m making and I was wondering if there was any way to check how many colours are used per tile so I know it meets the restrictions. I just need anything that can do this, like a script or something, because checking manually is taking me hours. I’m not using conventional restrictions like gameboy, zx, snes etc, so tools designed for a specific console wont work.
Thank you

More details will be helpful. How many colors per tile do you need? What is your tile size? Are tiles placed by grid of tile size? Why it’s hard to control amount of colors per tile? Do you use too many colors, but then why do you need color restriction per tile? Do you create large images of tiles? Etc.