An electronic device comprising: an image sensor configured to obtain raw image data corresponding to light in an infrared band and a visible band for an external object; and a processor; wherein the processor is configured to: receive a request to obtain the raw image data corresponding to the external object; generate an RGB image associated with the external object using a first raw image data by the processor being further configured to: if an illuminance corresponding to the raw image data falls within a first range, obtain the first raw image data using a first image data set corresponding to a first region among raw image data obtained through the image sensor; or if the illuminance corresponding to the raw image data falls within a second range, obtain the first raw image data using at least a part of the raw image data in which a component corresponding to infrared light included in the raw image data is corrected in the first image data set based at least on a second image data set corresponding to a second region among the raw image data obtained through the image sensor, wherein the first range is defined as being lower than a predetermined illuminance and the second range is defined as being higher or equal to the predetermined illuminance and generate the RGB image based on the request being set to be performed using a first function of the image sensor, wherein the RGB image generated according to the illuminance corresponding to the raw image data falling within the first range includes an infrared component, and the RGB image generated according to the illuminance corresponding to the raw image data falling within the second range does not include the infrared component; and perform biometric authentication associated with the external object using a second raw image data corresponding to the light in the infrared band obtained through the image sensor, based on the request being set to be performed using a second function of the image sensor. an image sensor configured to obtain raw image data corresponding to light in an infrared band and a visible band for an external object; and a processor; wherein the processor is configured to: receive a request to obtain the raw image data corresponding to the external object; generate an RGB image associated with the external object using a first raw image data by the processor being further configured to: if an illuminance corresponding to the raw image data falls within a first range, obtain the first raw image data using a first image data set corresponding to a first region among raw image data obtained through the image sensor; or if the illuminance corresponding to the raw image data falls within a second range, obtain the first raw image data using at least a part of the raw image data in which a component corresponding to infrared light included in the raw image data is corrected in the first image data set based at least on a second image data set corresponding to a second region among the raw image data obtained through the image sensor, receive a request to obtain the raw image data corresponding to the external object; generate an RGB image associated with the external object using a first raw image data by the processor being further configured to: if an illuminance corresponding to the raw image data falls within a first range, obtain the first raw image data using a first image data set corresponding to a first region among raw image data obtained through the image sensor; or if the illuminance corresponding to the raw image data falls within a second range, obtain the first raw image data using at least a part of the raw image data in which a component corresponding to infrared light included in the raw image data is corrected in the first image data set based at least on a second image data set corresponding to a second region among the raw image data obtained through the image sensor, if an illuminance corresponding to the raw image data falls within a first range, obtain the first raw image data using a first image data set corresponding to a first region among raw image data obtained through the image sensor; or if the illuminance corresponding to the raw image data falls within a second range, obtain the first raw image data using at least a part of the raw image data in which a component corresponding to infrared light included in the raw image data is corrected in the first image data set based at least on a second image data set corresponding to a second region among the raw image data obtained through the image sensor, wherein the first range is defined as being lower than a predetermined illuminance and the second range is defined as being higher or equal to the predetermined illuminance and generate the RGB image based on the request being set to be performed using a first function of the image sensor, wherein the RGB image generated according to the illuminance corresponding to the raw image data falling within the first range includes an infrared component, and the RGB image generated according to the illuminance corresponding to the raw image data falling within the second range does not include the infrared component; and perform biometric authentication associated with the external object using a second raw image data corresponding to the light in the infrared band obtained through the image sensor, based on the request being set to be performed using a second function of the image sensor.