I developed a module that can select kaywords from the post content and then use those keywordS as the image of post's alt tags. I'v seen many sites use several keywords as image alt tag and got good ranking,however,I'v also heard of Google would punish website use that way. Please could anyone told me how to use image tag but avoid punishment from Google.
I would use only ONE key prhase in a single image's alt attribute. Using more keyphrases, and especially repeated key phrases in an alt attribute may lead to being penalized for key word stuffing.
Google doesnt 'punish' you for alt tags, it is in fact very recommended and is a good practice, just keep the length of the alt tag to a manageabel limit and you should be fine.
put ALT tags on related image. In ALT put only keyword if you want ranking in Google images. Make Word 3 or 4 character ALT Don't repeat second time same ALT in page