An image pickup apparatus comprising: an image pickup device (25,28) adapted to pick up an image of an object and to output frames of image signal having color components; a light emitting unit adapted to emit light; a amplifying unit (21,22) adapted to amplify the image signal output from the image pickup device (25,28) for each color component; a setting unit adapted to set a gain for each color component to the amplifying unit (21,22); and a control unit adapted to generate image information based on the image signal amplified by the amplifying unit (21,22) to which the gain is set by the setting unit, and to store the image information into a storage medium; the apparatus characterized by further comprising a varying unit adapted to set different gain values to the amplifying unit (21,22), wherein the gain values are taken from a varying gain table linking the light source type to the gain values of color components; a detecting unit adapted to detect a type of the light source from a plurality of frames amplified by amplifying unit (21,22) in accordance with the gain values set by the varying unit; wherein the detecting unit is adapted (i) to count the number of white pixels on each of the plurality of frames, (ii) to determine the frame having the maximum number of detected white pixels, (iii) to decide a candidate light source type based on the gain values used for capturing the determined frame, and (iv) to determine the type of the light source when the same entry from said varying gain table is found as candidate for a predetermined number of times; the setting unit is further adapted to set the gains based on the type of the light source detected by the detecting unit; and the control unit is adapted to generate image information based on the image signal amplified with the gains corresponding to the detected light source. an image pickup device (25,28) adapted to pick up an image of an object and to output frames of image signal having color components; a light emitting unit adapted to emit light; a amplifying unit (21,22) adapted to amplify the image signal output from the image pickup device (25,28) for each color component; a setting unit adapted to set a gain for each color component to the amplifying unit (21,22); and a control unit adapted to generate image information based on the image signal amplified by the amplifying unit (21,22) to which the gain is set by the setting unit, and to store the image information into a storage medium; the apparatus characterized by further comprising a varying unit adapted to set different gain values to the amplifying unit (21,22), wherein the gain values are taken from a varying gain table linking the light source type to the gain values of color components; a detecting unit adapted to detect a type of the light source from a plurality of frames amplified by amplifying unit (21,22) in accordance with the gain values set by the varying unit; wherein the detecting unit is adapted (i) to count the number of white pixels on each of the plurality of frames, (ii) to determine the frame having the maximum number of detected white pixels, (iii) to decide a candidate light source type based on the gain values used for capturing the determined frame, and (iv) to determine the type of the light source when the same entry from said varying gain table is found as candidate for a predetermined number of times; the setting unit is further adapted to set the gains based on the type of the light source detected by the detecting unit; and the control unit is adapted to generate image information based on the image signal amplified with the gains corresponding to the detected light source. a varying unit adapted to set different gain values to the amplifying unit (21,22), wherein the gain values are taken from a varying gain table linking the light source type to the gain values of color components; a detecting unit adapted to detect a type of the light source from a plurality of frames amplified by amplifying unit (21,22) in accordance with the gain values set by the varying unit; wherein the detecting unit is adapted (i) to count the number of white pixels on each of the plurality of frames, (ii) to determine the frame having the maximum number of detected white pixels, (iii) to decide a candidate light source type based on the gain values used for capturing the determined frame, and (iv) to determine the type of the light source when the same entry from said varying gain table is found as candidate for a predetermined number of times; the setting unit is further adapted to set the gains based on the type of the light source detected by the detecting unit; and the control unit is adapted to generate image information based on the image signal amplified with the gains corresponding to the detected light source.