I am using configurable product with size and color attributes. I want to change the main-image on configurable-product view as per the options chosen Like If I choose red-color
There is also extension which changes configurable image according to the selected option Configurable Image Switcher.
This Extension adds feature on product page for configurable products. When customer select option of configurable product on product page, main image changes to the image from selected simple product.
If your associated simple prodcut doesnt have any image upliaded, it may change to the default image placholer or didnt change image (it may be configured in extension's admin settings)
Also extension support integration with custom zoom modules with different image size from base template.
Make sure that you have compilation disabled before installing extension. System > Tools > Compilation page and click on Disable button. After Installation you can enable compilation back.