A method performed by an electronic device for obtaining an image, the method comprising: obtaining, by a first camera of the electronic device, a first image corresponding to a first photographing area including a subject, wherein the first camera has a first viewing angle; obtaining, by a second camera of the electronic device, a second image corresponding to a maximum viewing angle image having a second photographing area including the subject, wherein the second camera has a second viewing angle greater than the first viewing angle, and wherein the second photographing area includes the first photographing area and surrounding environment information of the subject; after obtaining said first image and said second image, inputting the first image including the first photographing area and the second image including the second photographing area to an Artificial Intelligence, AI, recommendation model and outputting an optimal photographing composition from the AI recommendation model, and based on the optimal photographing composition, displaying, on a display of the electronic device, a preview image including the second photographing area which includes the first photographing area, the surrounding environment information of the subject and a first indicator representing the first photographing area; while displaying the preview image and the first indicator, receiving a user input to obtain a third image including the subject; and in response to receiving the user input, obtaining the third image including the subject, the third image corresponding to a photographing area of the preview image which corresponds to the first indicator. obtaining, by a first camera of the electronic device, a first image corresponding to a first photographing area including a subject, wherein the first camera has a first viewing angle; obtaining, by a second camera of the electronic device, a second image corresponding to a maximum viewing angle image having a second photographing area including the subject, wherein the second camera has a second viewing angle greater than the first viewing angle, and wherein the second photographing area includes the first photographing area and surrounding environment information of the subject; after obtaining said first image and said second image, inputting the first image including the first photographing area and the second image including the second photographing area to an Artificial Intelligence, AI, recommendation model and outputting an optimal photographing composition from the AI recommendation model, and based on the optimal photographing composition, displaying, on a display of the electronic device, a preview image including the second photographing area which includes the first photographing area, the surrounding environment information of the subject and a first indicator representing the first photographing area; while displaying the preview image and the first indicator, receiving a user input to obtain a third image including the subject; and in response to receiving the user input, obtaining the third image including the subject, the third image corresponding to a photographing area of the preview image which corresponds to the first indicator.