In Magento 2 How to filter the configurable products based on the child product's color. For example, if the parent has 4 children with Green, Red, Yellow and Black colors. If I select green in the filter. image of Relevant child product(green) should be visible in place of the parent product image.
You need to set Child product image from the backend,Edit Child product and set image specific to your color and when you click on child product color at that time they will display child product image instead of Main product image.