A method and apparatus where the output from a high intensity lightsource is controlled to produce well-exposed images/videos and to reduceautomatically the intensity when an unsafe issue is detected in medicaldevices such as endoscopes and the like. The method and apparatusovercome problems to control light sources that have high-frequency noise,slow-response time, nonlinearity, and non-monotonic response time and toprotect the patients tissues from possible overheating /burning and the eyesof personnel and patients from possible direct exposure to high intensitylightused in medical devices such as endoscopes and the like.