Placing Specific Objects On Colored Surface

Hello. I need a way to fill a surface with certain objects depending on the color in the texture underneath. Say the objects are plants and I want roses on green and bushes on red, trees on yellow, small trees on orange..

I could pic a random position. But how to determine the color on that position?

have an Idea?

ok I have an idea:

  1. shoot rayIntersect on the surface to get 3d coords and UV-coords
  2. get color from the texture via colorAtPoint on the spot

other ideas?

how about extract the individual colors as separate masks and use paint objects aritsan tool with the import presure map option?

This may be too slow, but you could consider converting texture to particles, then query per particle color (rgbpp), then place your objects. Good thing is you get position for free from particle attribute