A method and apparatus where the output from a high intensity light source is controlled to produce well-exposed images/videos and to reduce automatically the intensity when an unsafe issue is detected in medical devices such as endoscopes and the like. The method and apparatus overcome problems to control light sources that have highfrequency noise, slow-response time, nonlinearity, and non-monotonic response time and to protect the patients tissues from possible overheating /burning and the eyes of personnel and patients from possible direct exposure to high intensity light used in medical devices such as endoscopes and the like.