Electronic device for generating image, and operating method thereof

ZA202607833APending Publication Date: 2026-08-26SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
ZA202607833
Authority / Receiving Office
ZA · ZA
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-11
Filing Date
2026-07-30
Publication Date
2026-08-26

AI Technical Summary

Technical Problem

Existing electronic devices lack efficient methods for high-quality image editing, particularly in transforming or replacing specific objects within images using generative AI models.

Method used

The electronic device employs a generative AI model to identify and transform or replace specific objects within images based on real-time preview images captured by the camera, utilizing a feature extraction model to generate new images that reflect user preferences and shooting conditions.

Benefits of technology

Enables easy and effective editing of images by transforming or replacing objects, such as faces, in real-time, enhancing image quality and user experience.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

NOT VISIBLE DUE TO STATUS OF PATENT
Need to check novelty before this filing date? Find Prior Art

Description

Electronic device for generating images and method of operating the same

[0001] The present disclosure relates to an electronic device for generating an image and a method of operating the same.

[0002] Thanks to remarkable advancements in information and communication technology and semiconductor technology, the proliferation and use of various electronic devices is rapidly increasing. Electronic devices are being developed to enable users to carry and communicate with one another. An electronic device can refer to any device that performs a specific function based on its embedded software, such as a mobile communication terminal, tablet PC, audio / video device, desktop / laptop computer, or in-car navigation system.

[0003] Recently, users have become increasingly interested in acquiring high-quality images, beyond simply capturing them using electronic devices. Electronic devices offer image editing capabilities. Using image editing applications, electronic devices can provide users with an environment where they can edit images stored on their devices.

[0004] According to one embodiment, an electronic device may include a camera, a display, at least one processor, and a memory including instructions. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display a first image including a first object stored in the memory through the display. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display a preview image acquired from the camera together with the first image through the display. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to identify a second object corresponding to the first object included in the preview image. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to identify a first object related to the second object in the first image based on at least a portion of the second object. In one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to generate a second image by editing the first image using a generative AI model such that at least a portion of the first object is deformed based on at least a portion of the second object. In one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display the second image through the display.

[0005] According to one embodiment, a method of operating an electronic device may include an operation of displaying a first image including a first object stored in the electronic device through a display included in the electronic device. According to one embodiment, the method of operating the electronic device may include an operation of displaying a preview image acquired from a camera included in the electronic device together with the first image through the display. According to one embodiment, the method of operating the electronic device may include an operation of identifying a second object included in the preview image. According to one embodiment, the method of operating the electronic device may include an operation of identifying a first object related to the second object in the first image based on at least a portion of the second object. According to one embodiment, the method of operating the electronic device may include an operation of generating a second image by editing the first image using a generative AI model such that at least a portion of the first object is deformed based on at least a portion of the second object. According to one embodiment, the method of operating the electronic device may include an operation of displaying the second image through the display.

[0006] In one embodiment, a non-transitory recording medium may store instructions that may execute an operation of displaying a first image including a first object stored in an electronic device through a display included in the electronic device, an operation of displaying a preview image acquired from a camera included in the electronic device together with the first image through the display, an operation of identifying a second object included in the preview image, an operation of identifying a first object related to the second object in the first image based on at least a portion of the second object, an operation of generating a second image by editing the first image using a generative AI model such that at least a portion of the first object is deformed based on at least a portion of the second object, and an operation of displaying the second image on the display.

[0007] The above and other aspects, features and advantages of specific embodiments of the present disclosure will become more apparent from the following description taken in conjunction with the accompanying drawings.

[0008] FIG. 1 is a block diagram of an electronic device within a network environment, according to one embodiment.

[0009] FIG. 2 is a block diagram illustrating a schematic configuration of an electronic device according to one embodiment.

[0010] Figure 3 is a schematic block diagram of an image generation model according to one embodiment.

[0011] FIG. 4A is a flowchart illustrating a method for an electronic device to acquire a second image based on displaying a first image and a preview image, according to one embodiment.

[0012] FIG. 4b is a flowchart illustrating a method for an electronic device to acquire a second image using an image generation model, according to one embodiment.

[0013] FIG. 4C is a flowchart illustrating a method for an electronic device to edit a first image to obtain a second image, according to one embodiment.

[0014] FIGS. 5A, 5B, and 5C are drawings illustrating a method for an electronic device to acquire a second image based on displaying a first image and a preview image, according to one embodiment.

[0015] FIG. 6 is a flowchart illustrating a method for an electronic device to capture a preview image based on capture information of a first image, according to one embodiment.

[0016] FIG. 7 is a diagram illustrating a method for an electronic device to capture a preview image based on capture information of a first image, according to one embodiment.

[0017] FIG. 8 is a drawing illustrating a method for an electronic device to obtain a second image using a first image and a preview image including a plurality of objects, according to one embodiment.

[0018] FIGS. 9A, 9B, and 9C are drawings illustrating a method for an electronic device to acquire a second image according to various embodiments.

[0019] FIG. 10 is a diagram illustrating a method for multiple electronic devices to edit a first image stored on a server according to one embodiment.

[0020] FIG. 11 is a flowchart illustrating a method for an electronic device to edit a video using a preview image, according to one embodiment.

[0021] FIG. 12 is a drawing illustrating a method for an electronic device to edit a first image using an image captured by a camera, according to one embodiment.

[0022] FIG. 13 is a diagram illustrating a method for obtaining a second image when the electronic device is a video see-through (VST) device according to one embodiment.

[0023] FIG. 14 is a diagram illustrating a method for an electronic device to edit a first image using a preview image captured by an external electronic device, according to one embodiment.

[0024] FIG. 15 is a diagram illustrating a method for an electronic device to obtain a second image based on a preview image having a different quality from a first image, according to one embodiment.

[0025] FIG. 16 is a diagram illustrating a method for an electronic device to edit multiple images containing the same object stored in a memory using a preview image captured by a camera, according to one embodiment.

[0026] FIG. 1 is a block diagram of an electronic device (101) within a network environment (100) according to various embodiments. Referring to FIG. 1, in the network environment (100), the electronic device (101) may communicate with the electronic device (102) via a first network (198) (e.g., a short-range wireless communication network), or may communicate with at least one of the electronic device (104) or the server (108) via a second network (199) (e.g., a long-range wireless communication network). In one embodiment, the electronic device (101) may communicate with the electronic device (104) via the server (108). According to one embodiment, the electronic device (101) may include a processor (120), a memory (130), an input module (150), an audio output module (155), a display module (160), an audio module (170), a sensor module (176), an interface (177), a connection terminal (178), a haptic module (179), a camera module (180), a power management module (188), a battery (189), a communication module (190), a subscriber identification module (196), or an antenna module (197). In some embodiments, the electronic device (101) may omit at least one of these components (e.g., the connection terminal (178)), or may have one or more other components added. In some embodiments, some of these components (e.g., the sensor module (176), the camera module (180), or the antenna module (197)) may be integrated into one component (e.g., the display module (160)).

[0027] The processor (120) may, for example, execute software (e.g., a program (140)) to control at least one other component (e.g., a hardware or software component) of the electronic device (101) connected to the processor (120) and perform various data processing or operations. According to one embodiment, as at least a part of the data processing or operations, the processor (120) may store commands or data received from other components (e.g., a sensor module (176) or a communication module (190)) in a volatile memory (132), process the commands or data stored in the volatile memory (132), and store result data in a non-volatile memory (134). According to one embodiment, the processor (120) may include a main processor (121) (e.g., a central processing unit or an application processor) or an auxiliary processor (123) (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor) that can operate independently or together with the main processor (121). For example, when the electronic device (101) includes the main processor (121) and the auxiliary processor (123), the auxiliary processor (123) may be configured to use less power than the main processor (121) or to be specialized for a given function. The auxiliary processor (123) may be implemented separately from the main processor (121) or as a part thereof.

[0028] The auxiliary processor (123) may control at least a portion of functions or states associated with at least one component (e.g., a display module (160), a sensor module (176), or a communication module (190)) of the electronic device (101), for example, on behalf of the main processor (121) while the main processor (121) is in an inactive (e.g., sleep) state, or together with the main processor (121) while the main processor (121) is in an active (e.g., application execution) state. In one embodiment, the auxiliary processor (123) (e.g., an image signal processor or a communication processor) may be implemented as a part of another functionally related component (e.g., a camera module (180) or a communication module (190)). In one embodiment, the auxiliary processor (123) (e.g., a neural network processing unit) may include a hardware structure specialized for processing artificial intelligence models. The artificial intelligence models may be generated through machine learning. This learning can be performed, for example, in the electronic device (101) itself where artificial intelligence is performed, or can be performed through a separate server (e.g., server (108)). The learning algorithm can include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model can include multiple artificial neural network layers.The artificial neural network may be one of a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to, or alternatively to, a hardware structure, an artificial intelligence model may include a software structure.

[0029] The memory (130) can store various data used by at least one component (e.g., processor (120) or sensor module (176)) of the electronic device (101). The data can include, for example, software (e.g., program (140)) and input data or output data for commands related thereto. The memory (130) can include volatile memory (132) or non-volatile memory (134).

[0030] The program (140) may be stored as software in the memory (130) and may include, for example, an operating system (142), middleware (144), or an application (146).

[0031] The input module (150) can receive commands or data to be used in a component of the electronic device (101) (e.g., a processor (120)) from an external source (e.g., a user) of the electronic device (101). The input module (150) can include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).

[0032] The audio output module (155) can output audio signals to the outside of the electronic device (101). The audio output module (155) can include, for example, a speaker or a receiver. The speaker can be used for general purposes, such as multimedia playback or recording playback. The receiver can be used to receive incoming calls. In one embodiment, the receiver can be implemented separately from the speaker or as part of the speaker.

[0033] The display module (160) can visually provide information to an external party (e.g., a user) of the electronic device (101). The display module (160) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling the device. According to one embodiment, the display module (160) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of a force generated by the touch.

[0034] The audio module (170) can convert sound into an electrical signal, or vice versa, convert an electrical signal into sound. According to one embodiment, the audio module (170) can acquire sound through the input module (150), output sound through the sound output module (155), or an external electronic device (e.g., electronic device (102)) (e.g., speaker or headphone) directly or wirelessly connected to the electronic device (101).

[0035] The sensor module (176) can detect the operating status (e.g., power or temperature) of the electronic device (101) or the external environmental status (e.g., user status) and generate an electrical signal or data value corresponding to the detected status. According to one embodiment, the sensor module (176) can include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.

[0036] The interface (177) may support one or more designated protocols that may be used to directly or wirelessly connect the electronic device (101) with an external electronic device (e.g., the electronic device (102)). In one embodiment, the interface (177) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.

[0037] The connection terminal (178) may include a connector through which the electronic device (101) may be physically connected to an external electronic device (e.g., electronic device (102)). According to one embodiment, the connection terminal (178) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).

[0038] The haptic module (179) can convert electrical signals into mechanical stimuli (e.g., vibration or movement) or electrical stimuli that a user can perceive through tactile or kinesthetic sensations. According to one embodiment, the haptic module (179) can include, for example, a motor, a piezoelectric element, or an electrical stimulation device.

[0039] The camera module (180) can capture still images and videos. According to one embodiment, the camera module (180) may include one or more lenses, image sensors, image signal processors, or flashes.

[0040] The power management module (188) can manage power supplied to the electronic device (101). According to one embodiment, the power management module (188) can be implemented as, for example, at least a part of a power management integrated circuit (PMIC).

[0041] A battery (189) may power at least one component of the electronic device (101). In one embodiment, the battery (189) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.

[0042] The communication module (190) may support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between the electronic device (101) and an external electronic device (e.g., electronic device (102), electronic device (104), or server (108)), and the performance of communication through the established communication channel. The communication module (190) may operate independently from the processor (120) (e.g., application processor) and may include one or more communication processors that support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (190) may include a wireless communication module (192) (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module (194) (e.g., a local area network (LAN) communication module, or a power line communication module). Among these communication modules, the corresponding communication module can communicate with an external electronic device (104) via a first network (198) (e.g., a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network (199) (e.g., a long-range communication network such as a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN)). These various types of communication modules can be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (192) can verify or authenticate the electronic device (101) within a communication network such as the first network (198) or the second network (199) by using subscriber information (e.g., an international mobile subscriber identity (IMSI)) stored in the subscriber identification module (196).

[0043] The wireless communication module (192) can support 5G networks and next-generation communication technologies following the 4G network, such as NR access technology (new radio access technology). The NR access technology can support high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and connection of multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency communications)). The wireless communication module (192) can support, for example, a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate. The wireless communication module (192) can support various technologies for securing performance in a high-frequency band, such as beamforming, massive multiple-input and multiple-output (MIMO), full dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large scale antenna. The wireless communication module (192) can support various requirements specified in the electronic device (101), an external electronic device (e.g., the electronic device (104)), or a network system (e.g., the second network (199)). According to one embodiment, the wireless communication module (192) can support a peak data rate (e.g., 20 Gbps or more) for eMBB realization, a loss coverage (e.g., 164 dB or less) for mMTC realization, or a U-plane latency (e.g., 0.5 ms or less for downlink (DL) and uplink (UL), or 1 ms or less for round trip) for URLLC realization.

[0044] The antenna module (197) can transmit or receive signals or power to or from an external device (e.g., an external electronic device). In one embodiment, the antenna module (197) may include an antenna including a radiator formed of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). In one embodiment, the antenna module (197) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as the first network (198) or the second network (199), may be selected from the plurality of antennas by, for example, the communication module (190). A signal or power may be transmitted or received between the communication module (190) and an external electronic device via the at least one selected antenna. In some embodiments, in addition to the radiator, another component (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as a part of the antenna module (197).

[0045] In one embodiment, the antenna module (197) may generate a mmWave antenna module. In one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent a first side (e.g., a bottom side) of the printed circuit board and capable of supporting a designated high frequency band (e.g., a mmWave band), and a plurality of antennas (e.g., an array antenna) disposed on or adjacent a second side (e.g., a top side or a side side) of the printed circuit board and capable of transmitting or receiving signals in the designated high frequency band.

[0046] At least some of the above components can be interconnected and exchange signals (e.g., commands or data) with each other via a communication method between peripheral devices (e.g., a bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)).

[0047] According to one embodiment, commands or data may be transmitted or received between the electronic device (101) and an external electronic device (104) via a server (108) connected to a second network (199). Each of the external electronic devices (102 or 104) may be the same or a different type of device as the electronic device (101). According to one embodiment, all or part of the operations executed in the electronic device (101) may be executed in one or more of the external electronic devices (102, 104, or 108). For example, when the electronic device (101) is to perform a certain function or service automatically or in response to a request from a user or another device, the electronic device (101) may, instead of or in addition to executing the function or service itself, request one or more external electronic devices to perform the function or at least a part of the service. One or more external electronic devices that receive the request may execute at least a portion of the requested function or service, or an additional function or service related to the request, and transmit the result of the execution to the electronic device (101). The electronic device (101) may process the result as is or additionally and provide it as at least a portion of a response to the request. For this purpose, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used, for example. The electronic device (101) may provide an ultra-low latency service by using distributed computing or mobile edge computing, for example. In another embodiment, the external electronic device (104) may include an Internet of Things (IoT) device. The server (108) may be an intelligent server utilizing machine learning and / or a neural network. According to one embodiment, the external electronic device (104) or the server (108) may be included in the second network (199).The electronic device (101) can be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology.

[0048] FIG. 2 is a block diagram illustrating a schematic configuration of an electronic device according to one embodiment.

[0049] Referring to FIG. 2, according to one embodiment, an electronic device (201) may include a camera (210), a processor (220), a memory (230), a display (260), and a communication circuit (290). For example, the electronic device (201) may be implemented in the same or similar manner as the electronic device (101) of FIG. 1.

[0050] According to one embodiment, the processor (220) (e.g., the processor (120) of FIG. 1) may control the overall operation of the electronic device (201). The processor (220) according to one embodiment may execute software (e.g., the program (140) of FIG. 1) to control at least one other component (e.g., a hardware or software component) of the electronic device (201) connected to the processor (220), and may perform data processing or calculation based on the instruction. The instruction according to one embodiment may include a command configured in a machine language that can be processed by the electronic device (201) or the processor (220). For example, the instruction may include a command corresponding to an operation instruction used in a program.

[0051] Although FIG. 2 illustrates the electronic device (201) as including one processor (220), this is merely exemplary and the technical concept of the present invention may not be limited thereto. For example, the electronic device (201) may include at least one processor. For example, the processor (220) may be implemented as at least one processor (e.g., multiple processors).

[0052] According to one embodiment, the memory (230) (e.g., the memory (130) of FIG. 1) may store at least one instruction (or command) that, when executed, causes at least one operation of the electronic device (201). The at least one instruction, when executed collectively or individually by the processor (220), may cause the electronic device (201) to perform a corresponding operation.

[0053] According to one embodiment, the processor (220) may convert (or acquire, generate, convert) a first image into a second image using an image generation model (e.g., an image generation model (310) of FIG. 3). For example, the processor (220) may generate a second image using a generative artificial intelligence (AI) model (320) such that at least a portion of a first object (e.g., a face) included in the first image is transformed based on at least a portion of a second object (e.g., a face) included in an image (e.g., a preview image or a live preview image) acquired in real time through the camera (210). For example, the processor (220) may acquire or generate a second image in which at least a portion of a first object included in the first image is transformed into at least a portion of a second object included in an image (e.g., a preview image) acquired through the camera (210). For example, the first image may represent an image to be edited. The second image may represent an edited image. For example, the first image may be, It may be stored in the memory (230) (e.g., the memory (130) of FIG. 1) or in an external server (e.g., a cloud server, server (108) of FIG. 1). For example, if the first image is stored in an external server, the processor (220) may receive the first image through the communication circuit (290) (e.g., the communication module (190) of FIG. 1). In addition, the processor (220) may store the received first image in the memory (230) to edit the received first image.

[0054] According to one embodiment, the image generation model (310) may generate a new image based on an existing image using at least one artificial intelligence (AI) model. For example, the image generation model (310) may be stored in memory (230) or an external server.

[0055] According to one embodiment, the image generation model (310) may include at least one artificial intelligence (AI) model. For example, the at least one AI model may include a generative AI model. For example, the generative AI model may use existing content, such as text, audio, and / or images, to generate new content similar to the existing content. For example, the generative AI model may learn patterns in the content and generate new content as an inference result. For example, the image generation model (202) may perform at least one of an in-painting operation or an out-painting operation on a first image to generate (or acquire, output) a second image.

[0056] In one embodiment, the in-painting operation may refer to an operation (or function) of creating (or coloring) a deleted portion of an image to match its surroundings using an AI model. Alternatively, the in-painting operation may refer to an operation of creating (or coloring) a portion of an image obscured by some object to match its surroundings using an AI model.

[0057] In one embodiment, an out-painting operation may represent an operation (or function) of expanding an outer area of ​​an image using an AI model, and creating (or coloring) the expanded portion to match the existing image.

[0058] According to one embodiment, at least some of the operations of the electronic device (201) (or processor (220)) to generate or obtain a second image based on the first image may be performed using the image generation model (310) (or generative AI model) described above.

[0059] According to one embodiment, the processor (220) may display a first image stored in the memory (230) on a display (260) (e.g., the display module (160) of FIG. 1). For example, the first image may include at least one object. For example, the at least one object may include a person (e.g., a person's face), an animal, an object, and / or a background.

[0060] According to one embodiment, the processor (220) may identify a first object that is a target of editing among at least one object included in the first image. For example, the first object may include the face of a person included in the first image.

[0061] According to one embodiment, the processor (220) may detect a user's face included in the first image as a first object based on performing a face detection function on the first image.

[0062] According to one embodiment, the processor (220) may identify a first object based on a user input. For example, the processor (220) may identify a user's face as the first object based on a user input (e.g., a touch input) regarding the user's face included in a first image.

[0063] According to one embodiment, the processor (220) may, based on an operation of identifying a first object, display an image that is an enlarged version of the first image based on a portion corresponding to the first object. For example, the processor (220) may display an enlarged version of the first image on the display (260) instead of the first image. For example, if the first object is the face of a person included in the first image, the processor (220) may enlarge the first image based on the face of the person.

[0064] According to one embodiment, the processor (220) may confirm a command to edit the first image. For example, when a specified user input (e.g., a touch input, a gesture input, or a voice input) is confirmed, the processor (220) may confirm a command to edit the first image. For example, the processor (220) may display a graphic object for editing the first image on the display (260) using an image (hereinafter, a preview image) captured by the camera (210) (e.g., the camera module (180) of FIG. 1). For example, the camera (210) may be a camera disposed on the front or rear of the electronic device (201). The processor (220) may confirm a command to edit the first image based on a user input for the graphic object. For example, the processor (220) may display a preview image corresponding to an image captured by the camera (210) on the display (260) based on a user input for the graphic object. For example, the camera (210) may include a camera (e.g., a front camera) for photographing a user.

[0065] According to one embodiment, the processor (220) may verify shooting information for the first image. For example, the processor (220) may verify metadata (or metadata information) of the first image or analyze the first image to verify shooting information for the first image. For example, the shooting information may include information about the focal length, brightness, white balance, and / or shutter speed at which the first image was captured. Additionally, the metadata (or metadata information) may include location information indicating the location of an object included in the first image.

[0066] According to one embodiment, the processor (220) may generate or obtain a second image based on metadata (or shooting information) for the first image and a second object included in the preview image.

[0067] According to one embodiment, the processor (220) may control the camera (210) to acquire a preview image in real time based on metadata (or shooting information) for the first image. For example, the processor (220) may control the focal length of the camera (210) based on the focal length at which the first image was captured. The processor (220) may control the focal length of the camera (210) based on the focal length of the first image, and then acquire the preview image.

[0068] According to one embodiment, the processor (220) may display a preview image captured or acquired in real time through the camera (210) together with the first image on the display (260). For example, the processor (220) may display the preview image through a pop-up window. For example, the processor (220) may display the preview image over the first image so as not to overlap with the first object included in the first image.

[0069] According to one embodiment, the processor (220) may analyze the first image (or original image) based on learning results about the user's preferred facial information or the user's existing shooting conditions (e.g., shooting angle, shooting composition, brightness setting, white balance setting, and / or sensitivity setting). The processor (220) may analyze an area (e.g., mouth shape) that the user is likely to want to edit in the first image (or original image), and recommend a shooting guide (e.g., an expression image preferred by the user) to the user, or provide an object (or user interface (UI)) that displays a recommended expression shape (or guide expression shape) in the preview image. When providing the shooting guide, the processor (220) may provide a guide UI that guides the area (e.g., face) to be edited in the preview image to be centered. For example, when a guide UI that guides the user's face to be centered is displayed, the processor (220) may provide a highlight effect to the user's face (or the guide UI) if the user's face is located in an area corresponding to the guide UI. In addition, the processor (220) may control a notification (e.g., vibration) to be generated by an external device (e.g., a smartwatch, a smart ring, a video see-through (VST) device, and / or wireless earphones) linked with the electronic device (201) if the user's face is located in an area corresponding to the guide UI. It can be transmitted to the corresponding external device.

[0070] According to one embodiment, the processor (220) may identify a first object included in the first image and a second object corresponding to the first object included in the preview image. For example, the preview image may include at least one image. For example, the preview image may include a second object corresponding to the first object included in the first image. For example, if the first object included in the first image is a user's face, the preview image may include the face of the same user. The processor (220) may identify a second object (e.g., the user's face) corresponding to the first object (e.g., the user's face) in the preview image.

[0071] According to one embodiment, the processor (220) may identify a face corresponding to a first face included in the preview image among at least one face included in the first image as the first object based on performing a face recognition function on the preview image.

[0072] According to one embodiment, the processor (220) may input information about a first image and a second object (e.g., feature information about the second object) into a generative AI model stored in the memory (230) to obtain a second image in which at least a portion of the first object is transformed into at least a portion of the second object. For example, the processor (220) may obtain a second image in which at least a portion of the user's face in the first image is transformed into at least a portion of the user's face in the preview image. For example, the user's face in the second image may have at least one of a changed expression, a changed posture, an changed angle, a changed brightness, or a changed hairstyle compared to the user's face in the first image.

[0073] In another embodiment, the processor (220) may transmit information about the first image and the second object (e.g., feature information about the second object) to the external server so that the information about the first image and the second object (e.g., feature information about the second object) may be input into a generative AI model stored in the external server. The processor (220) may receive or acquire the second image from the external server.

[0074] According to one embodiment, the processor (220) may display a second image on the display. For example, the processor (220) may display a preview image together with the second image. The processor (220) may display a preview image captured in real time using the camera (210). For example, the processor (220) may reflect or display a second object changed in real time through the preview image. The processor (220) may reflect at least a portion of the second object changed in real time in the preview image to the second image.

[0075] According to one embodiment, the processor (220) may, in response to a user input for a preview image displayed together with a second image, obtain or store an image file corresponding to the second image. For example, the user input for the preview image may indicate an input indicating completion of editing of the first image.

[0076] According to another embodiment, the processor (220) may modify (or change) the first image without using an image generation model (e.g., an image generation model (310) of FIG. 3). For example, the processor (220) may obtain or generate an image (e.g., a modified first image) in which at least a part of a first object included in the first image is modified or replaced with at least a part of a second object included in an image (e.g., a preview image) acquired through the camera (210) without using an image generation model (e.g., an image generation model (310) of FIG. 3). For example, the processor (220) may generate and display a modified first image in which a first object (or an area corresponding to the first object) (e.g., a face or a face area) of the first image is replaced with a second object (or an area corresponding to the second object) (e.g., a face or a face area) included in the preview image. The processor (220) may display the modified first image together with the preview image. The modified first image may include: In general, the result (e.g., an image) in which a face is modified, altered, or replaced may be included. For example, the processor (220) may generate or obtain a modified first image by changing a first object (or an area corresponding to the first object) of the first image to at least a portion of a second object (or an area corresponding to the second object) included in the preview image using a known image editing algorithm. Thereafter, the processor (220) may obtain and / or store a second image generated by editing the first image using the generative AI model in response to a user input indicating completion of editing the first image. In addition, the processor (220) may obtain and / or store an image file corresponding to the second image. For example, a method for generating a second image obtained by editing the first image using the generative AI model may be based on the method described above.

[0077] Figure 3 is a schematic block diagram of an image generation model according to one embodiment.

[0078] Referring to FIG. 3, according to one embodiment, the image generation model (310) may include a generative AI model (320) and a feature extraction model (330). For example, the generative AI model (320) and the feature extraction model (330) may be implemented as AI models.

[0079] According to one embodiment, the feature extraction model (330) may extract or obtain feature information of a second object included in the preview image from the preview image. For example, the feature information may include information for replacing at least a part of a first object in the first image with at least a part of a second object. For example, the feature information may include information representing a feature of the second object included in the preview image. For example, the feature information may include information on at least one of a color, a shape, a form, an angle, a background, or a composition of the second object. For example, when the second object is a user's face, the feature information may include information on features of the face (e.g., a size, a form, an angle, a pose, an expression, a makeup style, a color, and / or a brightness), features of a facial feature included in the face (e.g., a position, a size, a form, a color, and / or an angle of a facial feature), and / or information on a hairstyle.

[0080] In one embodiment, the feature extraction model (330) may obtain prompt information (e.g., text prompts) based on feature information. For example, the feature extraction model (330) may generate at least two text prompts for features of a second object.

[0081] The feature extraction model (330) can provide feature information to the generative AI model. Furthermore, the feature extraction model (330) can provide prompt information along with the feature information to the generative AI model (320). Alternatively, the feature extraction model (330) can provide prompt information as feature information to the generative AI model (320).

[0082] According to one embodiment, the generative AI model (320) may generate (e.g., reproduce, color, or add) a second image using feature information of a first image and a second object. Alternatively, the generative AI model (320) may generate, output, or obtain the second image using prompt information (e.g., a text prompt) that commands the generation of the first image and the second image. Alternatively, the second image may be generated using the first image, feature information of the second object, and the prompt information. For example, the text prompt (or text command) may include a command in the form of text that the generative AI model (320) can recognize. For example, the text prompt may include a command for the generative AI model (320) to generate the second image. For example, the second image may be an image in which at least a portion of a first object of the first image is transformed or replaced with at least a portion of a second object. For example, the electronic device (201) may generate a second image based on at least two text prompts and a second object using the generative AI model (320). For example, the generative AI model (320) may perform a painting operation on the first image while transforming or replacing at least a portion of the first object of the first image with at least a portion of the second object. For example, the processor (220) may perform an in-painting operation to generate a first portion of the first image when generating the second image. For example, the first portion may represent a portion that is removed when replacing at least a portion of the first object with at least a portion of the second object (e.g., a portion that is to be additionally filled in while replacing a segment corresponding to at least a portion of the first object with at least a portion of the second object). Additionally, the processor (220) may perform an out-painting operation to generate a second portion of the first image using the image generation model (202).For example, the second part may represent a newly added part (e.g., a part to be added depending on lighting or angle, a shadow or shading) that transforms or replaces at least a part of the first object with at least a part of the second object.

[0083] Through the above-described method, the electronic device (201) according to one embodiment can easily edit the first image using the image captured through the camera (210). For example, the electronic device (201) can easily and effectively edit the first image including the user's face into the user's face captured instantly through the camera (210). In addition, the electronic device (201) can obtain an image in which a specific object (e.g., the user's face) is naturally transformed into an object captured through the camera (210) using the generative AI model (320).

[0084] At least some of the operations of the electronic device (201) described below may be performed by the processor (220) or the image generation model (310). However, for convenience of explanation, the operations below will be described as being performed by the electronic device (201).

[0085] FIG. 4A is a flowchart illustrating a method for an electronic device to acquire a second image based on displaying a first image and a preview image, according to one embodiment.

[0086] Referring to FIG. 4A, according to an embodiment, in operation 401, the electronic device (201) may display a first image stored in a memory (e.g., the memory (230) of FIG. 2) on a display (e.g., the display (260) of FIG. 2). The electronic device (201) may perform an operation for editing the first image based on a specified user input (e.g., a touch input for a graphic object for editing the first image). For example, the first image may include a first object (or a first specific region). For example, the first object may include a face of a user included in the first image. For example, the first specific region may include a region corresponding to a first object (e.g., the face of the user) included in the first image. However, when the first object is not distinguished (or identified) in the first image, the first specific region may not correspond to the first object.

[0087] According to one embodiment, in operation 403, the electronic device (201) may display a preview image acquired from a camera (e.g., the camera (210) of FIG. 2) together with the first image. For example, the electronic device (201) may display the preview image captured by the camera (210) together with (or simultaneously with) the first image on the display (260) based on a specified user input. For example, when the electronic device (201) includes a foldable display or a rollable display, the electronic device (201) may divide the area where the first image and the preview image are displayed on the unfolded or expanded screen so that the first image and the preview image do not overlap. For example, the electronic device (201) may display the first image in a first area of ​​the display and display the preview image in a second area of ​​the display so that the first image and the preview image do not overlap.

[0088] According to one embodiment, in operation 404, the electronic device (201) may identify a second object (or a second specific region) included in the preview image. The second object may include a face of a user (e.g., the same user) included in the second image. For example, the second specific region may include an area corresponding to the second object (e.g., the face of the same user) included in the preview image. However, when the second object is not distinguishable in the preview image, the second specific region may not correspond to the second object.

[0089] According to one embodiment, in operation 405, the electronic device (201) may identify a first object (or a first specific region) related to a second object (or a second specific region) in the first image based on the second object. For example, the electronic device (201) may identify a first object (or a first specific region) corresponding to a face identical to or similar to a face corresponding to the second object (or the second specific region) in the first image. For example, the second object may include a face of a user included in a preview image. For example, the second specific region may include an region corresponding to a second object (e.g., a face of a user) included in the preview image. However, when the second object is not distinguished (or identified) in the preview image, the second specific region may not correspond to the second object.

[0090] According to other embodiments, the order in which operation 405 is performed may vary. For example, the operation of identifying the first object (or the first specific region) may be performed before displaying the preview image or before identifying the second object (or the second specific region) included in the preview image. For example, the electronic device (201) may identify the first object (or the first specific region) not based on the second object (or the second specific region) included in the preview image. For example, the electronic device (201) may identify the first object (or the first specific region) corresponding to the editing target based on a user input in the first image.

[0091] According to one embodiment, in operation 407, the electronic device (201) may generate a second image using the generative AI model to transform at least a portion of the first object (or the first specific region) based on at least a portion of the second object (or the second specific region). For example, the electronic device (201) may generate the second image by editing the first image using the generative AI model. The electronic device (201) may input information about the first image and the second object (e.g., feature information of the user's face included in the preview image) into the generative AI model (e.g., the generative AI model (320) of FIG. 3) to obtain a second image in which at least a portion of the first object is transformed into at least a portion of the second object. For example, the generative AI model (320) may be stored in the memory (230) or an external server. For example, if the generative AI model (320) is stored in an external server, the electronic device (201) may transmit information about the first image and the second object to the external server and receive the second image from the external server. For example, the electronic device (201) may transmit information including at least a portion of the first image and the second object to the external server to generate the second image using the generative AI model stored in the external server, at least as part of an operation of generating the second image.

[0092] According to one embodiment, in operation 409, the electronic device (201) may display a second image on the display (260). For example, the second image may be an image generated or acquired by editing the first image using a generative AI model. For example, the electronic device (201) may display a preview image over the second image. For example, the electronic device (201) may reflect changes in a second object (e.g., a user's face) (or a second specific region) included in the preview image in real time on the second image.

[0093] According to one embodiment, in operation 411, the electronic device (201) may obtain (or store) an image file corresponding to the second image based on a user input. For example, the electronic device (201) may obtain an image file corresponding to the second image at the time in response to a user input (e.g., a touch input) for an object included in a preview image (e.g., an object for completing editing of the first image). For example, the image file may include an image in which at least a part of a first object (or a first specific region) included in the first image obtained at the time when the user input is confirmed is transformed into at least a part of a second object (or a second specific region) included in the preview image.

[0094] Hereinafter, an embodiment of transforming at least a portion of a first object included in a first image into a second object included in a preview image will be described. However, the technical idea of ​​the present invention can also be applied to an embodiment of transforming at least a portion of a first specific region instead of the first object into at least a portion of a second specific region included in the preview image.

[0095] FIG. 4b is a flowchart illustrating a method for an electronic device to acquire a second image using an image generation model, according to one embodiment.

[0096] Referring to FIG. 4B, according to one embodiment, an electronic device (e.g., the electronic device (201) of FIG. 2) may, in operation 451, confirm a request to edit a first image. That is, the electronic device (201) may determine the first image to be edited. For example, the electronic device (201) may determine or confirm the first image as an image to be edited based on a specified user input (e.g., a touch input to a graphic object for editing the first image).

[0097] According to one embodiment, in operation 453, the electronic device (201) may analyze features of a first object (e.g., a user's face included in the first image) included in the first image. For example, the electronic device (201) may analyze features of a face included in the first image (e.g., a size of the face, a shape of the face, features of facial skin, features of facial features, makeup style, and / or features of a hairstyle) using a feature extraction model (e.g., a feature extraction model (330) of FIG. 3 ).

[0098] According to one embodiment, in operation 455, the electronic device (201) may obtain feature information about a second object (e.g., a user's face included in the preview image) included in a preview image acquired through a camera (e.g., the camera (210) of FIG. 2) based on features of a first object. The electronic device (201) may identify a second object corresponding to the first object included in the preview image based on features of the first object. The electronic device (201) may extract, obtain, or identify feature information about the second object using a feature extraction model (e.g., the feature extraction model (330) of FIG. 3). For example, the feature information may include features of a face included in the preview image (e.g., size, shape, angle, posture, expression, makeup style, color, and / or brightness), features of a facial feature included in the face (e.g., location, size, shape, color, and / or angle of the facial feature), and / or information about a hairstyle.

[0099] According to one embodiment, in operation 457, the electronic device (201) may input feature information about the first image and the second object into a generative AI model (e.g., the generative AI model (320) of FIG. 3) to generate or obtain an image that has at least a portion of the second object transformed.

[0100] According to one embodiment, in operation 459, the electronic device (201) may obtain a second image by correcting the generated image to match the first image. For example, the operation of correcting the generated image to match the first image may be performed by a generative AI model. In this case, the electronic device (201) may obtain the second image based on the user's preference (e.g., angle, composition, brightness, and / or setting values ​​specified by the user and stored in the electronic device (201). Alternatively, the electronic device (201) may additionally correct the second image obtained by the generative AI model based on user input.

[0101] According to one embodiment, the electronic device (201) may display an object (e.g., a button-shaped object) that commands completion (or termination) of editing of the first image with the acquired second image after the user's desired facial shape is reflected in the first image (or original image) using a preview image. The electronic device (201) may complete (or terminate) editing of the first image based on a user input for the object. The electronic device (201) may additionally store frames (e.g., a specified number of frames acquired through the camera (210)) before and / or after the time point at which the user input for the object is confirmed. For example, when the image acquired through the camera (210) is reflected in real time in the first image (or original image) and the user inputs a user input (e.g., a touch input) for the object, the second image that is generated or stored may not reflect the user's desired facial shape due to the user's hand tremors. Alternatively, the second image may not reflect the face shape desired by the user, such as when the pupil position changes momentarily due to a change in the user's gaze. Accordingly, the electronic device (201) may additionally acquire and store frames before and / or after the time point at which the user input for the object is input (e.g., a specified number of frames (e.g., 3) acquired before and after the time point, or frames acquired before and after a specified time (e.g., 2 seconds) from the time point). The electronic device (201) may provide a UI that provides the additionally acquired frames together with the second image, thereby allowing the user to select a final result related to the second image (e.g., an image finally selected from among the additionally acquired frames).Alternatively, the electronic device (201) may provide a UI that recommends an image selected from among the second image and additionally acquired frames according to a specified condition (e.g., an image that satisfies the optimal condition) as a recommended image. For example, when selecting a recommended image, the electronic device (201) may consider the result of learning the user's preferred facial expression or may reflect a criterion preset in the electronic device (201) (e.g., a priority set by the user). For example, the electronic device (201) may input the first image (or original image) and images (or frames) acquired in real time through the camera (210) into a generative AI model to generate or acquire recommended images. For example, the electronic device (201) may display the recommended images in a thumbnail format. The recommended images displayed in a thumbnail format may be generated in a low resolution, thereby reducing the time it takes for the generative AI model to generate the recommended images. The electronic device (201) may provide a UI that allows the user to select one of the recommended images displayed in thumbnail format. When the user selects one of the recommended images, the electronic device (201) may convert or regenerate the recommended image selected by the user into a high-resolution image corresponding to the first image (or original image).

[0102] According to one embodiment, the electronic device (201) may check or determine whether the finally generated second image contains a shape or expression (e.g., a facial shape or expression) that the user does not prefer based on the user's previously learned shooting status. For example, if the electronic device (201) determines that the finally generated second image contains a shape or expression that the user does not prefer, the electronic device (201) may provide a UI that prompts the user to retake the image. For example, the UI may provide a message using text and / or voice that the second image contains a shape or expression that the user does not prefer and / or a message prompting the user to retake the image. In addition, the electronic device (201) may generate a guide UI with a shape or expression that the user prefers and provide it in the preview image. When a user wears a wearable electronic device (e.g., a smartwatch, a smart ring, a VST device, and / or wireless earphones) linked to an electronic device (201), the electronic device (201) may transmit a control signal to the corresponding wearable electronic device to provide feedback or a shooting guide through the wearable electronic device. In this case, the wearable electronic device may provide feedback or a shooting guide based on the control signal.

[0103] According to one embodiment, the electronic device (201) may reflect the lighting characteristics of the first image (or the original image) when generating the second image. For example, if the user's head posture acquired through the preview image is different from the user's head posture included in the first image, the lighting characteristics of the first image (or the original image) may not be reflected, resulting in an awkward result. For example, if the face in the original image is dark due to a shadow and the face in the preview image is bright due to light, if the lighting characteristics of the first image are not reflected in the second image, an awkward result may be generated. The electronic device (201) may provide a function of confirming or extracting the lighting characteristics of the first image (or the original image) when generating the second image, and applying the lighting characteristics of the first image to the head area or the area around the head area.

[0104] Through the above-described method, the electronic device (201) according to one embodiment can easily edit the first image, which is the target of editing, using an image captured by the camera (210). For example, the electronic device (201) can easily and effectively edit the first image including the user's face into the user's face captured instantly by the camera (210). In addition, the electronic device (201) can obtain an image in which a specific object (e.g., the user's face) is naturally transformed into an object captured by the camera (210) using the generative AI model (330).

[0105] FIG. 4C is a flowchart illustrating a method for an electronic device to edit a first image to obtain a second image, according to one embodiment.

[0106] Referring to FIG. 4A, according to an embodiment, in operation 471, the electronic device (201) may display a first image stored in a memory (e.g., the memory (230) of FIG. 2) on a display (e.g., the display (260) of FIG. 2). The electronic device (201) may perform an operation for editing the first image based on a specified user input (e.g., a touch input for a graphic object for editing the first image). For example, the first image may include a first object (or a first specific region). For example, the first object may include a face of a user included in the first image. For example, the first specific region may include a region corresponding to a first object (e.g., the face of the user) included in the first image. However, when the first object is not distinguished (or identified) in the first image, the first specific region may not correspond to the first object.

[0107] According to one embodiment, in operation 473, the electronic device (201) may display a preview image acquired from a camera (e.g., the camera (210) of FIG. 2) together with the first image. For example, the electronic device (201) may display a preview image (or a live preview image) captured by the camera (210) together with (or simultaneously with) the first image on the display (260) based on a specified user input.

[0108] According to one embodiment, in operation 475, the electronic device (201) may identify a first object (or a first specific region) related to a second object (or a second specific region) in the first image based on the second object. For example, the electronic device (201) may identify a first object (or a first specific region) corresponding to a face that is identical or similar to a face corresponding to the second object (or the second specific region) in the first image. For example, the second object may include a face of a user included in a preview image. For example, the second specific region may include an region corresponding to a second object (e.g., a face of a user) included in the preview image. However, when the second object is not distinguished (or identified) in the preview image, the second specific region may not correspond to the second object.

[0109] Depending on the implementation, the order in which operation 475 is performed may vary. For example, the operation of identifying the first object (or the first specific region) may be performed before displaying the preview image or before identifying the second object (or the second specific region) included in the preview image. For example, the electronic device (201) may identify the first object (or the first specific region) not based on the second object (or the second specific region) included in the preview image. For example, the electronic device (201) may identify the first object (or the first specific region) corresponding to the editing target based on a user input in the first image.

[0110] According to one embodiment, in operation 477, the electronic device (201) may modify the first image by changing at least a portion of a first object (or a first specific region) of the first image based on at least a portion of a second object (or a second specific region) of the preview image while displaying the preview image (or the live preview image) together with the first image. For example, the modified first image may be an image in which the face of the user included in the first image is replaced (or changed) with the face of the user included in the preview image. For example, the electronic device (201) may obtain the modified first image in real time without using a generative AI model. In operation 479, the electronic device (201) may display (e.g., in real time) the modified first image together with the preview image. For example, the modified first image may roughly include an image in which the face of the preview image is reflected in the first image. The electronic device (201) may display the modified first image more quickly than when using a generative AI model.

[0111] According to one embodiment, in operation 481, the electronic device (201) may generate a second image by editing the first image using a generative AI model such that at least a portion of the first object is transformed based on at least a portion of the second object, based on a user input (e.g., a user input to complete editing of the first image). For example, operation 481 may be performed identically or similarly to operation 407 of FIG. 4A.

[0112] According to an embodiment, in operation 483, the electronic device (201) may display a second image on the display (260). For example, the second image may be an image generated or acquired by editing the first image using a generative AI model. For example, the electronic device (201) may display a preview image over the second image. At this time, the modified first image may be replaced with the second image. For example, the electronic device (201) may reflect changes in a second object (e.g., a user's face) (or a second specific region) included in the preview image in real time on the second image. Depending on the implementation, operation 483 may be omitted. For example, operation 485 may be performed after operation 481.

[0113] According to one embodiment, in operation 485, the electronic device (201) may obtain (or store) an image file corresponding to the second image based on a user input. For example, the electronic device (201) may obtain an image file corresponding to the second image at the time in response to a user input (e.g., a touch input) for an object included in a preview image (e.g., an object for completing editing of the first image). For example, the image file may include an image in which at least a part of a first object (or a first specific region) included in the first image obtained at the time when the user input is confirmed is transformed into at least a part of a second object (or a second specific region) included in the preview image.

[0114] In the method for generating a second image described below, the embodiment of FIG. 4c may be applied in the same or similar manner. For example, the operation of displaying the second image in real time described below may be replaced with an operation of displaying a modified first image.

[0115] FIGS. 5A, 5B, and 5C are drawings illustrating a method for an electronic device to acquire a second image based on displaying a first image and a preview image, according to one embodiment.

[0116] Referring to FIG. 5A, according to one embodiment, an electronic device (201) may display a first image (510) on a display (e.g., display (260) of FIG. 2). The electronic device (201) may perform an operation for editing the first image based on a user input (e.g., touch input) for a graphic object (518) for editing the first image (510).

[0117] According to one embodiment, the electronic device (201) can identify a first object (515) (e.g., a user's face) included in a first image (510). The electronic device (201) can display information (527) (e.g., a face) about the identified first object. Based on identifying the first object (515) in the first image (510), the electronic device (201) can display an image (520) that is an enlarged version of the first image (510) based on a portion (525) corresponding to the first object (515), instead of the first image. Depending on the implementation, the operation of displaying the enlarged image (520) instead of the first image may be omitted. For example, the electronic device (201) can identify the first object (515) included in the first image (510) based on a user input (e.g., a touch input for the first object (515). Alternatively, the electronic device (201) may identify the first object (515) included in the first image (510) when a user input for the graphic object (518) is confirmed. The electronic device (201) may identify the first object (515) included in the first image (510) based on an image representing the user's face stored in the electronic device (201).

[0118] Referring to FIG. 5B, according to an embodiment, the electronic device (201) may identify or select various objects other than the user's face as the first object. According to an embodiment, as in (a) of FIG. 5B, the electronic device (201) may identify or select the user's clothes and / or hairstyle in addition to the face included in the first image. The electronic device (201) may display information (567, 568, 569) indicating the identified objects. The electronic device (201) may determine an object identified by a user input among the information (567, 568, 569) indicating the objects as an object to be edited. For example, the electronic device (201) may determine the user's clothes as the object to be edited based on a user input for information (568) indicating the user's clothes. According to one embodiment, as shown in (b) of FIG. 5B, the electronic device (201) may identify or select detailed objects (e.g., eyes, nose, and / or mouth) included in a face included in a first image. The electronic device (201) may display information (577, 578, 579) representing detailed objects included in the face. The electronic device (201) may determine an object identified by a user input among the information (567, 568, 569) representing objects as an object to be edited. For example, the electronic device (201) may determine the object to be edited as the user's mouth based on a user input for information (579) representing the user's mouth.

[0119] The area (e.g., dotted area) for distinguishing the first object (515 or 525) identified by the electronic device (201) is for convenience of explanation and may not be displayed on the display (260). However, depending on the implementation, the electronic device (201) may also display the area (e.g., dotted area) for distinguishing the first object (515 or 525) identified.

[0120] According to one embodiment, the electronic device (201) may display, on the display (260), a preview image (532) acquired (or photographed) via a camera (e.g., the camera (210) of FIG. 2) based on a user input for a graphic object (528), together with the first image (510) or an enlarged image (520) of the first image. For example, the electronic device (201) may display the preview image (532) on top of the first image (510) (or an enlarged image (520) of the first image). For example, the electronic device (201) may display the preview image (532) without overlapping with the first object (515 or 525).

[0121] According to one embodiment, the electronic device (201) can identify a second object (e.g., a user's face) corresponding to a first object included in a preview image (532). The electronic device (201) can obtain and display a second image (530) in which at least a portion of the first object is transformed into at least a portion of the second object using a generative AI model (e.g., the generative AI model (320) of FIG. 3). The electronic device (201) can display the preview image (523) on the second image (530). For example, the electronic device (201) can reflect a change in the second object (e.g., a user's face) included in the preview image (532) in real time to the second image (530). That is, a face (535) corresponding to the user's face included in the preview image (532) can be reflected in real time to the second image (530).

[0122] According to one embodiment, the electronic device (201) may obtain an image (or image file) (540) corresponding to the second image based on a user input for an object (533) included in a preview image (532). The electronic device (201) may store the image. Alternatively, the electronic device (201) may perform additional editing on the image. For example, the electronic device (201) may perform additional editing on the image based on a user input for a graphic object (548).

[0123] According to an embodiment, referring to FIG. 5C, the electronic device (201) may display a preview image in various forms. For example, the electronic device (201) may display a preview image (532) through a pop-up window, as in (a) of FIG. 5C. Alternatively, the electronic device (201) may display a window (582) of which at least a portion is transparent instead of the preview image (532), as in (b) of FIG. 5C. In this case, the transparent window (582) may be displayed to overlap a first object of the first image (or an enlarged image of the first image). In addition, the transparent window (582) may be displayed so that at least a portion of a second object included in the preview image is reflected in the first image (or an enlarged image of the first image). The electronic device (201) can obtain an image (or image file) (540) corresponding to the second image based on a user input for an object (583) included in a transparent window (582). For example, (a) and (b) of FIG. 5c are screens corresponding to each mode, which can be switched by the user's intention (or user's input). In addition, the electronic device (201) can display a screen corresponding to a mode selected by the user among the screens of (a) and (b) of FIG. 5c as a default.

[0124] FIG. 6 is a flowchart illustrating a method for an electronic device to capture a preview image based on capture information of a first image, according to one embodiment.

[0125] Referring to FIG. 6, according to an embodiment, in operation 601, an electronic device (e.g., the electronic device 201 of FIG. 2) may check shooting information for a first image (e.g., a focal length at which the first image was captured). For example, the electronic device (201) may check shooting information for the first image when the first image is displayed on a display (e.g., the display (260) of FIG. 2). Alternatively, the electronic device (201) may check shooting information for the first image when an editing operation of the first image is performed. For example, the electronic device (201) may check shooting information for the first image based on metadata of the first image. In addition, the electronic device (201) may analyze the first image to check shooting information for the first image. For example, the electronic device (201) may utilize an AI model (e.g., an AI model stored in the memory (230) or stored in an external server) when analyzing the first image. The capturing information may include focal length information, shutter speed information, or location information of the first object.

[0126] According to one embodiment, in operation 603, the electronic device (201) may control a camera (e.g., the camera (210) of FIG. 2) to capture a preview image based on the capturing information for the first image. For example, the electronic device (201) may control the camera (210) to capture the preview image based on the focal length at which the first image was captured. The electronic device (201) may control the camera (210) by hardware or by a software algorithm. Alternatively, the electronic device (201) may generate the second image by using information about the characteristics of the second object displayed in the preview image and the capturing information of the first image, without controlling the camera (210).

[0127] Through the above-described method, the electronic device (201) can minimize distortion of the image when the second object obtained through the preview image is reflected in the first image.

[0128] FIG. 7 is a diagram illustrating a method for an electronic device to capture a preview image based on capture information of a first image, according to one embodiment.

[0129] Referring to (a) of FIG. 7, an electronic device (e.g., electronic device (201) of FIG. 2) according to one embodiment can check shooting information for a first image based on the editing operation performed on the first image. For example, the electronic device (201) can check shooting information (e.g., focal length, exposure value, sensitivity, and / or white balance) at which the first image was captured.

[0130] Referring to (b) of FIG. 7, according to one embodiment, the electronic device (201) may control a camera (e.g., the camera (210) of FIG. 2) to capture a preview image based on capturing information (e.g., focal length, exposure value, sensitivity, and / or white balance) for the first image. For example, the electronic device (201) may display a preview image (730) captured according to the focal length at which the first image was captured on a display (e.g., the display (260) of FIG. 2).

[0131] According to one embodiment, a second image may be obtained in which at least a portion of a first object (710) (e.g., a face included in the first image) in the first image is transformed or changed into at least a portion (750) of a second object (e.g., a face included in the preview image) in the preview image (730).

[0132] Through the above-described method, the electronic device (201) can minimize image distortion when at least a part of the second object (e.g., a face) is reflected in the first image by using the second object (e.g., the second object included in the preview image (730)) captured based on the shooting information of the first image.

[0133] FIG. 8 is a drawing illustrating a method for an electronic device to obtain a second image using a first image and a preview image including a plurality of objects, according to one embodiment.

[0134] Referring to FIG. 8, according to an embodiment, an electronic device (201) may edit a first image (810) including a plurality of objects (e.g., a plurality of people). For example, the electronic device (201) may perform an editing operation on the first image (810) based on a user input for a graphic object. Based on performing the editing operation on the first image (810), the electronic device (201) may identify a first person corresponding to an editing target among the plurality of objects. For example, the electronic device (201) may identify the first person (815) based on a user input (e.g., a touch input for the first person (815)) for the first person (815) among the plurality of objects included in the first image (810). Alternatively, the electronic device (201) can identify a first person (815) among a plurality of objects included in the first image (810) based on an image representing a user stored in the electronic device (201).

[0135] According to one embodiment, the electronic device (201) may, based on identifying a first person (815) included in the first image (810), display an enlarged image (820) of the first image (810) based on a portion (825) corresponding to the first person (815) instead of the first image. For example, the electronic device (201) may identify a portion of the face of the first person as the first object (826). Depending on the implementation, the operation of displaying the enlarged image (820) instead of the first image may be omitted.

[0136] According to one embodiment, the electronic device (201) may display a preview image (832) acquired (or captured) via a camera (e.g., the camera (210) of FIG. 2) on the display (260) along with the first image (810) or an enlarged image (820) of the first image, based on a user input for the graphic object (828). For example, the preview image (832) may be captured based on the capture information of the first image (810).

[0137] According to one embodiment, the electronic device (201) may identify a second object (e.g., a user's face) corresponding to a first object included in a preview image (832). The electronic device (201) may obtain and display a second image (830) in which at least a portion of the first object (826) is transformed into at least a portion of the second object (836) using a generative AI model (e.g., the generative AI model (320) of FIG. 3). Alternatively, the electronic device (201) may obtain and display a second image (830) in which not only the first object (826) but also at least a portion of a part (825) related to the first object (826) (e.g., a hairstyle and a facial pose) is transformed into a second object (836) and a part (835) related to the second object. That is, the electronic device (201) can change not only the face of the first image (810) (or the enlarged image of the first image (820)), but also the hairstyle, expression, posture, and / or ear part. In addition, a part related to the user's face included in the preview image (832) can be reflected in real time in the second image (830). For example, the electronic device (201) can perform an in-painting operation as a solution that a blank area may be created in some of the background area of ​​the first image (or the original image) where the head of the person included in the preview image (832) was located when the head posture of the person included in the preview image (832) is changed. For example, when a first object is transformed into a second object shape (e.g., posture transformation), there may be some difference between the background area of ​​the first image around the first object and the background area of ​​the first image around the second object. At this time, when generating a second image, the electronic device (201) can color or generate an area (or an image corresponding to the area) due to the difference between the background areas using a generative AI model.

[0138] According to one embodiment, the electronic device (201) may obtain an image (or image file) (840) corresponding to a second image based on a user input for an object (833) included in a preview image (832). For example, the second image (840) may be an image in which only the face and face-related parts (e.g., face angle, expression, and / or hairstyle) of a first person (845) among a plurality of objects included in the first image (810) are changed.

[0139] According to the above-described method, the electronic device (201) can effectively and easily obtain an image in which only a specific object (e.g., a specific person) is edited from a first image (810) containing a plurality of objects.

[0140] FIGS. 9A, 9B, and 9C are drawings illustrating a method for an electronic device to acquire a second image according to various embodiments.

[0141] Referring to FIGS. 9A, 9B, and 9C, according to one embodiment, an electronic device (e.g., electronic device (201) of FIG. 2) can edit various parts as well as the face of a person included in a first image (910) using an image generation model (e.g., image generation model (310) of FIG. 3).

[0142] Referring to FIG. 9A, according to an embodiment, the electronic device (201) may edit the clothes of a person included in a first image (910) using an image generation model (310). For example, the electronic device (201) may identify the clothes (915) of the person included in the first image (910) based on a user input (e.g., a touch input) for the clothes (915) of the person. For example, the electronic device (201) may identify an area corresponding to the clothes (915) of the person based on a user input for a preview image, and edit the clothes (915) of the person included in the first image. Based on the user input, the electronic device (201) may display a preview image (925) acquired (or photographed) through a camera (e.g., the camera (210) of FIG. 2) together with the first image (910) on the display (260). For example, the preview image (925) can be captured based on the capture information of the first image (910). Thereafter, the electronic device (201) can obtain and display a second image (930) in which the clothes (915) of the person included in the first image (910) are transformed or changed into the clothes of the person included in the preview image (925).

[0143] Referring to FIG. 9B, according to an embodiment, the electronic device (201) may edit the background included in the first image (930) using the image generation model (310). In FIG. 9B, the second image (930) generated in FIG. 9A may be the first image (930) in the illustrated process. For example, the electronic device (201) may identify a portion of the background (935) included in the first image (930) based on a user input (e.g., a touch input) for the background (935). Based on the user input, the electronic device (201) may display a preview image (955) acquired (or photographed) through a camera (e.g., the camera (210) of FIG. 2) together with the first image (930) on the display (260). For example, the preview image (955) may be photographed based on photographing information of the first image (930). Thereafter, the electronic device (201) can obtain and display a second image (960) in which the background (935) included in the first image (930) is transformed or changed into the background included in the preview image (955).

[0144] Referring to FIG. 9C, according to an embodiment, the electronic device (201) may edit a portion (975) included in the first image (970) using the image generation model (310). For example, the electronic device (201) may confirm the portion (975) included in the first image (970) based on a user input (e.g., a touch input) for the portion (975). Based on the user input, the electronic device (201) may display a preview image (985) acquired (or photographed) through a camera (e.g., the camera (210) of FIG. 2) together with the first image (930) on the display (260). For example, the preview image (985) may be photographed based on photographing information of the first image (970) and may include a specific object (e.g., a bag). Thereafter, the electronic device (201) may obtain and display a second image (990) in which a portion (975) included in the first image (970) is transformed or changed into a specific object (e.g., a bag) included in the preview image (985). When adding a specific object to the portion (975) of the first image (970), the electronic device (201) may consider a person (998) included in the first image (970). For example, the electronic device (201) may generate the second image (990) so that the person (998) is wearing or holding the specific object. For example, the electronic device (201) may perform an in-painting or out-painting operation on the portion (995) while adding a specific object to the portion (975) of the first image (970).

[0145] According to one embodiment, the electronic device (201) may, when there are multiple objects in the preview image, confirm a user input for selecting a specific object (e.g., a second object) included in the preview image. The electronic device (201) may generate a second image by adding the second object included in the preview image to an area (975) selected by the user in the first image. Alternatively, when the user does not select an area in the first image, the electronic device (201) may analyze an appropriate location of the second object in the first image and determine an area of ​​the first image to which the second object is to be added. The electronic device (201) may generate a second image by adding the second object to the determined area of ​​the first image.

[0146] According to the above-described method, the electronic device (201) can effectively and easily obtain an image in which a specific object or a specific part is edited with respect to the first image (910, 930, or 970).

[0147] FIG. 10 is a diagram illustrating a method for multiple electronic devices to edit a first image stored on a server according to one embodiment.

[0148] Referring to FIG. 10, according to one embodiment, a plurality of electronic devices can edit an image stored in an external server (e.g., a cloud server) and obtain the edited image.

[0149] According to one embodiment, the first electronic device may edit a first image (1010) stored on an external server. For example, the first electronic device may obtain a second image (1020) that is an edited version of the first image (1010) using a preview image captured using a camera included in the first electronic device. The first electronic device may store the obtained second image (1020) on an external server.

[0150] According to one embodiment, the second electronic device may edit the first image (1010) stored in an external server. For example, the second electronic device may obtain a third image (1030) obtained by editing the first image (1010) using a preview image captured using a camera included in the second electronic device. The second electronic device may store the obtained third image (1030) in an external server. For example, the second electronic device may edit the first image at substantially the same time as the first electronic device.

[0151] In one embodiment, an external server may obtain and store a fourth image based on a second image edited by a first electronic device and a third image edited by a second electronic device. For example, the fourth image may be an image that reflects a portion of the first image (1010) edited by the first electronic device and a portion edited by the second electronic device.

[0152] According to one embodiment, the first electronic device and the second electronic device may obtain a fourth image (1040) from an external server.

[0153] Through the above-described method, an electronic device (e.g., a first electronic device) (e.g., an electronic device (201) of FIG. 2) can easily obtain an image edited by another electronic device (e.g., a second electronic device). In addition, the electronic device can provide a method for effectively editing an image together with another electronic device. Through this, the electronic device can provide a function for efficiently collaborating with another electronic device to edit an image. At least a part of the operation performed on an external server may be performed on the first electronic device or the second electronic device. Alternatively, at least a part of the operation performed on an external server may be performed on the first electronic device or the second electronic device. A function for editing an image may be performed by the first electronic device and the second electronic device (e.g., device to device) without an external server.

[0154] FIG. 11 is a flowchart illustrating a method for an electronic device to edit a video using a preview image, according to one embodiment.

[0155] Referring to FIG. 11, according to one embodiment, an electronic device (e.g., electronic device (201) of FIG. 2) may provide a function for editing not only still images but also moving images by using an image generation model (e.g., image generation model (310) of FIG. 3).

[0156] According to one embodiment, in operation 1101, the electronic device (201) can check the video to be edited.

[0157] According to one embodiment, in operation 1103, the electronic device (201) may identify a video section for editing in the video. For example, the electronic device (201) may identify a section of the entire video for which editing is requested (e.g., a section from a first time point to a second time point) based on a user input.

[0158] According to one embodiment, in operation 1105, the electronic device (201) may obtain an image (or preview image) for video editing through a camera (e.g., the camera (210) of FIG. 2). For example, the electronic device (201) may obtain an image (or preview image) including a user's face using the camera (210).

[0159] According to one embodiment, in operation 1107, the electronic device (201) may input information about an image acquired through the camera (210) (e.g., information about an object included in the image) and information about a video into the generative AI model to obtain an edited video. For example, the electronic device (201) may obtain a video in which a first object included in the video in a section requesting editing (e.g., a face of a specific person included in the video) is changed or transformed into a second object included in an image acquired through the camera (210) (e.g., a face of a specific person included in a preview image). Alternatively, the electronic device (201) may add a new video generated based on an image or video acquired through the camera to a section of the video in which editing is requested. For example, the electronic device (201) can acquire or confirm a video for a specific period of time that includes a second object using a video (or preview video) acquired through a camera (210), and can add a new video generated based on the acquired video to a specific section of the original video.

[0160] Through the above-described method, the electronic device (201) can provide a function to easily and effectively edit not only still images but also videos.

[0161] FIG. 12 is a drawing illustrating a method for an electronic device to edit a first image using an image captured by a camera, according to one embodiment.

[0162] Referring to FIG. 12, according to one embodiment, an electronic device (e.g., electronic device (201) of FIG. 2) may edit a first image (1215) including a first object (e.g., a person's face). For example, referring to FIG. 12 (a), the electronic device (201) may perform an editing operation on the first image (1215) based on a user input for a graphic object (1217).

[0163] Referring to (b) of FIG. 12, according to one embodiment, the electronic device (201) may display a preview image (1225) acquired (or photographed) via a camera (e.g., the camera (210) of FIG. 2) on a display (e.g., the display (260) of FIG. 2) based on a user input for a graphic object (1217). For example, the preview image (1225) may be photographed based on photographing information of the first image (1215).

[0164] According to one embodiment, the electronic device (201) may identify a second object (e.g., a face) corresponding to a face included in the first image (1215) in the preview image (1225). For example, referring to (c) of FIG. 12, the electronic device (201) may display a drawing image (1235) representing features of the second object included in the preview image (1225). For example, the drawing image (1235) may be displayed on the preview image (1225) and may be generated based on features of the second object (e.g., size and shape of the face, position and shape of facial features, and / or facial expression).

[0165] According to one embodiment, the electronic device (201) may display a drawing image (1235) over the first image (1215). The electronic device (201) may adjust the position of facial expressions or facial features indicated by the drawing image based on user input for the drawing image (1235).

[0166] According to one embodiment, the electronic device (201) may obtain and display a second image (1245) in which at least a portion of a facial expression or facial features is changed in the first image (1215) based on the adjusted drawing image (1235).

[0167] According to the above-described method, the electronic device (201) can effectively and easily edit the face of a person included in the first image (1215).

[0168] FIG. 13 is a diagram illustrating a method for obtaining a second image when the electronic device is a video see-through (VST) device according to one embodiment.

[0169] According to one embodiment, the electronic device (201) may be implemented as a VST device. For example, the electronic device (201) may display a screen (1320) captured by a camera (e.g., a camera (210) of FIG. 2) through a display (e.g., a display (260) of FIG. 2). For example, the screen (1320) may include an augmented reality (AR) screen, a virtual reality (VR) screen, or an extended reality (XR) screen.

[0170] According to one embodiment, an electronic device (or VST device) (201) may edit an object (e.g., a person's face) included in a first image (1310) stored in the electronic device (201) using an image generation model (e.g., an image generation model (310) of FIG. 3). The electronic device (201) may display the first image (1310) on a screen (1320) acquired (or photographed) through a camera (e.g., a camera (210) of FIG. 2). The electronic device (201) may acquire and display a second image (1330) in which the face of the person included in the first image (1310) is transformed or changed into the face of the person included in the screen (1325).

[0171] Through the above-described method, when the electronic device (201) is implemented as a VST device, the electronic device (201) can provide a function to easily and effectively edit the first image (1310).

[0172] FIG. 14 is a diagram illustrating a method for an electronic device to edit a first image using a preview image captured by an external electronic device, according to one embodiment.

[0173] Referring to FIG. 14, according to one embodiment, an electronic device (1401) (e.g., the electronic device (201) of FIG. 2) can edit a first image (1410). The electronic device (1401) can edit the first image (1410) using a preview image (1420) captured by an external electronic device (1402) instead of a camera included in the electronic device (1401).

[0174] According to one embodiment, the electronic device (1401) may receive information about a preview image (1420) captured by the external electronic device (1402) from the external electronic device (1402) through a communication circuit (e.g., the communication circuit (290) of FIG. 2). For example, the electronic device (1401) may receive information about a preview image (1420) captured in real time by the external electronic device (1402). The electronic device (1401) may input information about the first image (1410) and the preview image (1420) into an image generation model (e.g., the image generation model (310) of FIG. 3) to obtain a second image (1430). For example, the second image (1430) may be an image in which the first object (e.g., a face) included in the first image (1410) is changed or transformed into the second object (e.g., a face) included in the preview image (1420).

[0175] FIG. 15 is a diagram illustrating a method for an electronic device to obtain a second image based on a preview image having a different quality from a first image, according to one embodiment.

[0176] Referring to FIG. 15, according to one embodiment, an electronic device (e.g., the electronic device (201) of FIG. 2) may edit a first image (1510) using an image (1520) (e.g., a preview image) acquired through a camera (e.g., the camera (210) of FIG. 2). The image quality (or resolution) of the image (1520) acquired through the camera (210) may be different from the image quality (or resolution) of the first image (1510). For example, the first image (1510) may be a high-quality image (or a high-resolution image), and the image (1520) acquired through the camera (210) may be a low-quality image (or a low-resolution image).

[0177] If there is a difference in image quality (or resolution) between the first image (1510) and the image acquired through the camera (1520), blur may occur in the image to be acquired.

[0178] According to one embodiment, the electronic device (201) can change the image (1520) acquired through the camera (210) to a high-quality image. For example, the electronic device (201) can change the image quality of the image (1520) to be the same as that of the first image (1510) by using a resolution expansion function (e.g., a super resolution function). That is, the electronic device (201) can acquire an image (1530) with a changed image quality by using a resolution expansion function (e.g., a super resolution function).

[0179] According to one embodiment, the electronic device (201) can obtain a second image (1550) in which a specific object is changed from a first image (1510) by using an image (1530) with changed image quality.

[0180] In another embodiment, the first image (1510) may be a low-quality image (or a low-resolution image), and the image acquired through the camera (210) may be a high-quality image (or a high-resolution image). The electronic device (201) may change the image acquired through the camera (210) to a low-quality image. For example, the electronic device (201) may change the quality of the corresponding image to be the same as that of the first image (1510) by using a down-scanning function. Depending on the implementation, the electronic device (201) may also change the first image (1510) to a high-quality image.

[0181] According to the above-described method, the electronic device (201) can adjust the difference in image quality (or resolution) between the first image (1510) and the image (1520) acquired through the camera. Through this, the electronic device (201) can minimize the occurrence of blur in the image being edited.

[0182] FIG. 16 is a diagram illustrating a method for an electronic device to edit multiple images containing the same object stored in a memory using a preview image captured by a camera, according to one embodiment.

[0183] Referring to FIG. 16, according to one embodiment, an electronic device (e.g., electronic device (201) of FIG. 2) may identify at least one image (1611, 1612, 1613, 1614) including a first object (e.g., a specific person) stored in a memory (e.g., memory (230) of FIG. 2). For example, the electronic device (201) may identify at least one image (1611, 1612, 1613, 1614) including the first object based on a folder or classification specified by a photo application.

[0184] According to one embodiment, the electronic device (201) may change a first object (e.g., a person's face) included in at least one image (1611, 1612, 1613, 1614) using an image acquired through a camera (e.g., a camera (210) of FIG. 2). For example, the electronic device (201) may change the first object (e.g., a person's face) included in at least one image (1611, 1612, 1613, 1614) to a second object (e.g., a person's face) included in an image acquired through the camera (210).

[0185] According to one embodiment, the electronic device may use an image generation model (e.g., the image generation model (310) of FIG. 3) (or a generative AI model (320)) to obtain an image (1632) in which a first object included in a specific image (1612) among at least one image (1611, 1612, 1613, 1614) is changed to a second object included in an image obtained through a camera (210). Additionally, the electronic device (201) can input at least one image (1611, 1612, 1613, 1614) and information about a second object into the image generation model (310) (or the generative AI model (320)) to obtain at least one second image (1631, 1632, 1633, 1634) in which at least a part of a first object included in at least one image (1611, 1612, 1613, 1614) is changed to at least a part of a second object.

[0186] According to one embodiment, the electronic device (201) may display at least one second image (1631, 1632, 1633, 1634) on a display (e.g., the display (260) of FIG. 2). The electronic device (201) may obtain and store an image file corresponding to an image selected by a user input from among the at least one second image (1631, 1632, 1633, 1634) displayed on the display (260). As illustrated in FIG. 16, the frowning facial expression of the images (1611, 1612, 1613, and 1614) may be converted into a smile as illustrated in the images (1631, 1633, 1634) based on identifying a similar image between the image (1612) with the frowning expression and the image (1632) with the smile.

[0187] According to the above-described method, the electronic device (201) can simultaneously edit a first object included in a plurality of images into a second object included in an image acquired through the camera (210).

[0188] According to one embodiment, the electronic device (201) may include a camera (210), a display (260), at least one processor (220), and a memory (230) including instructions. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display a first image including a first object stored in the memory through the display. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display a preview image acquired from the camera together with the first image through the display. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to identify a second object corresponding to the first object included in the preview image. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to identify a first object related to the second object in the first image based on at least a portion of the second object. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to generate a second image by editing the first image using a generative AI model (320) such that at least a portion of the first object is deformed based on at least a portion of the second object. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display the second image through the display.

[0189] According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to check metadata information for the first image. According to one embodiment, the metadata information may include at least one of focal length information, shutter speed information, or location information of the first object. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to control the camera to generate the second image based on at least a portion of the second object and the metadata information.

[0190] According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display the preview image over the first image so as not to overlap the first object included in the first image.

[0191] According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display the second image in real time.

[0192] According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to, based on identifying the first object in the first image, replace the first image with an enlarged image of the first image based on a portion corresponding to the first object through the display.

[0193] In one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display the preview image together with the second image. In one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to generate an image file corresponding to the second image in response to a user input for the preview image.

[0194] According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display a graphic object for displaying the preview image through the display. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display the preview image through the display in response to a user input for the graphic object.

[0195] According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to perform a face detection function on the preview image. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to identify a user's face included in the preview image as the second object based on the face detection function.

[0196] According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to identify a face corresponding to the user's face included in the preview image among at least one face included in the first image as the first object, based on performing a face recognition function on the user's face.

[0197] In one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to perform in-painting on the first image using the generative AI model, at least as part of the operation of generating the second image.

[0198] In one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to generate at least two text prompts regarding features of the second object. In one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to generate the second image based on the at least two text prompts and the second object using the generative AI model.

[0199] In one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to transmit, to the external server, information including at least a portion of the first image and the second object, to generate the second image using a generative AI model stored in the external server, at least as part of an operation of generating the second image. In one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to receive the second image from the external server.

[0200] According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to identify at least one third image including an object corresponding to the first object stored in the memory. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to obtain at least one fourth image using the generative AI model such that at least a portion of the object included in the at least one third image is transformed based on at least a portion of the second object. According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to display the at least one fourth image on the display.

[0201] According to one embodiment, the instructions, when executed by the at least one processor, may cause the electronic device to receive, from an external electronic device, an image captured by the external electronic device as the preview image.

[0202] According to one embodiment, a method of operating an electronic device (201) may include an operation of displaying a first image including a first object stored in the electronic device through a display (260) included in the electronic device. According to one embodiment, the method of operating the electronic device may include an operation of displaying a preview image acquired from a camera (210) included in the electronic device together with the first image on the display. According to one embodiment, the method of operating the electronic device may include an operation of identifying a second object included in the preview image. According to one embodiment, the method of operating the electronic device may include an operation of identifying a first object related to the second object in the first image based on at least a portion of the second object. According to one embodiment, the method of operating the electronic device may include an operation of generating a second image by editing the first image using a generative AI model (320) such that at least a portion of the first object is deformed based on at least a portion of the second object. According to one embodiment, the method of operating the electronic device may include an operation of displaying the second image through the display.

[0203] According to one embodiment, the operation of displaying the second image may include an operation of checking metadata information about the first image. According to one embodiment, the metadata information may include at least one of focal length information, shutter speed information, and location information of the second object. According to one embodiment, the operation of generating the second image may include an operation of generating the second image based on at least a portion of the second object and the metadata information.

[0204] According to one embodiment, the operation of displaying the preview image may display the preview image over the first image so as not to overlap the first object included in the first image.

[0205] According to one embodiment, the operation of displaying the second image may include an operation of displaying the second image in real time.

[0206] According to one embodiment, the method of operating the electronic device may further include, based on identifying the first object in the first image, replacing the first image with an enlarged image based on a portion corresponding to the first object through the display.

[0207] According to one embodiment, a non-transitory recording medium (130, 230) may store instructions that may execute an operation of displaying a first image including a first object stored in an electronic device (201) on a display (260) included in the electronic device, an operation of displaying a preview image acquired from a camera (210) included in the electronic device together with the first image on the display, an operation of identifying a second object included in the preview image, an operation of identifying a first object related to the second object in the first image based on at least a portion of the second object, an operation of generating a second image by editing the first image using a generative AI model (320) such that at least a portion of the first object is deformed based on at least a portion of the second object, and an operation of displaying the second image on the display.

[0208] Electronic devices according to the various embodiments disclosed in this document may take various forms. Electronic devices may include, for example, portable communication devices (e.g., smartphones), computer devices, portable multimedia devices, portable medical devices, cameras, wearable devices, or home appliances. Electronic devices according to the embodiments of this document are not limited to the aforementioned devices.

[0209] The various embodiments of this document and the terminology used therein are not intended to limit the technical features described in this document to specific embodiments, but should be understood to include various modifications, equivalents, or substitutes of the embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of the items, unless the context clearly indicates otherwise. In this document, each of the phrases "A or B", "at least one of A and B", "at least one of A or B", "A, B, or C", "at least one of A, B, and C", and "at least one of A, B, or C" can include any one of the items listed together in the corresponding phrase among those phrases, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used merely to distinguish one component from another, and do not limit the components in any other respect (e.g., importance or order). When a component (e.g., a first component) is referred to as "coupled" or "connected" to another (e.g., a second component), with or without the terms "functionally" or "communicatively," it means that the component can be connected to the other component directly (e.g., wired), wirelessly, or through a third component.

[0210] The term "module" used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit. A module may be an integral component, or a minimum unit or part of such a component that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).

[0211] Various embodiments of the present document may be implemented as software (e.g., a program (1440)) including one or more instructions stored in a storage medium (e.g., an internal memory (1436) or an external memory (1438)) readable by a machine (e.g., an electronic device (1401)). For example, a processor (e.g., a processor (1420)) of the machine (e.g., an electronic device (1401)) may call at least one instruction among the one or more instructions stored from the storage medium and execute it. This enables the machine to operate to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code executable by an interpreter. The machine-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' simply means that the storage medium is a tangible device and does not contain signals (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently or temporarily on the storage medium.

[0212] According to one embodiment, the method according to various embodiments disclosed in this document may be provided as included in a computer program product. The computer program product may be traded as a product between a seller and a buyer. The computer program product may be distributed in the form of a machine-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or may be distributed online (e.g., downloaded or uploaded) through an application store (e.g., Play Store™) or directly between two user devices (e.g., smart phones). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or temporarily generated in a machine-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or an intermediary server.

[0213] According to various embodiments, each component (e.g., a module or a program) of the above-described components may include one or more entities, and some of the entities may be separated and placed in other components. According to various embodiments, one or more components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Alternatively or additionally, a plurality of components (e.g., a module or a program) may be integrated into a single component. In such a case, the integrated component may perform one or more functions of each of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. According to various embodiments, the operations performed by a module, program, or other component may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.

[0214] Each of the embodiments provided in the above description does not exclude one or more features of other embodiments or other embodiments that are consistent with the disclosure, whether provided herein or not.

[0215] The embodiments of the present disclosure disclosed in the specification and drawings are intended to provide specific examples that facilitate easy explanation of the technical content of the embodiments of the disclosure and aid in understanding the embodiments of the disclosure, and are not intended to limit the scope of the embodiments of the disclosure. Accordingly, the scope of the various embodiments of the disclosure should be interpreted to include all modifications or variations derived based on the technical concepts of the various embodiments of the disclosure, in addition to the embodiments disclosed herein.

Claims

1. In the electronic device (201), Camera (210); display (260); At least one processor (220); and Contains a memory (230) containing instructions, The above instructions, when executed by the at least one processor, cause the electronic device to: Displaying a first image including a first object stored in the memory through the display, Displaying a preview image obtained from the camera together with the first image through the display, Check the second object included in the above preview image, Identifying the first object associated with the second object in the first image based on at least a portion of the second object; Generating a second image by editing the first image using a generative AI model (320) such that at least a portion of the first object is transformed based on at least a portion of the second object, An electronic device that displays the second image through the display.

2. In the first paragraph, the instructions, when executed by the at least one processor, cause the electronic device to: Check metadata information for the first image, wherein the metadata information includes at least one of focal length information, shutter speed information, or location information of the first object, An electronic device that generates the second image based on at least a portion of the second object and the metadata information.

3. In any one of paragraphs 1 to 2, the instructions, when executed by the at least one processor, cause the electronic device to: An electronic device that displays the preview image over the first image so as not to overlap the first object included in the first image.

4. In any one of paragraphs 1 to 3, the instructions, when executed by the at least one processor, cause the electronic device to: An electronic device that displays the second image in real time through the display.

5. In any one of paragraphs 1 to 4, the instructions, when executed by the at least one processor, cause the electronic device to: An electronic device that, based on identifying the first object in the first image, replaces the first image with an enlarged image based on a portion corresponding to the first object through the display.

6. In any one of paragraphs 1 to 5, the instructions, when executed by the at least one processor, cause the electronic device to: Displaying the above preview image together with the above second image, An electronic device that generates an image file corresponding to the second image in response to a user input for the preview image.

7. In any one of paragraphs 1 to 6, the instructions, when executed by the at least one processor, cause the electronic device to: Through the above display, a graphic object for displaying the preview image is displayed, An electronic device that displays the preview image through the display in response to a user input for the graphic object.

8. In any one of paragraphs 1 to 7, the instructions, when executed by the at least one processor, cause the electronic device to: Perform a face detection function on the above preview image, An electronic device that identifies a user's face included in the preview image as the second object based on the above face detection function.

9. In any one of paragraphs 1 to 8, the instructions, when executed by the at least one processor, cause the electronic device to: An electronic device that identifies a face corresponding to the user's face included in the preview image among at least one face included in the first image as the first object based on performing a facial recognition function on the user's face.

10. In any one of paragraphs 1 to 9, the instructions, when executed by the at least one processor, cause the electronic device to: An electronic device that performs in-painting on the first image using the generative AI model, at least as part of the operation of generating the second image.

11. In any one of paragraphs 1 to 10, the instructions, when executed by the at least one processor, cause the electronic device to: Generate at least two text prompts for features of the second object, An electronic device that generates the second image based on the at least two text prompts and the second object using the generative AI model.

12. In any one of paragraphs 1 to 11, the instructions, when executed by the at least one processor, cause the electronic device to: As at least part of the operation of generating the second image, transmitting information including at least a portion of the first image and the second object to the external server to generate the second image using a generative AI model stored on the external server, An electronic device that receives the second image from the external server.

13. In any one of paragraphs 1 to 12, the instructions, when executed by the at least one processor, cause the electronic device to: Identifying at least one third image containing an object corresponding to the first object stored in the memory, Obtaining at least one fourth image using the generative AI model such that at least a portion of the object included in the at least one third image is transformed based on at least a portion of the second object, An electronic device that causes at least one fourth image to be displayed on the display.

14. In any one of paragraphs 1 to 13, the instructions, when executed by the at least one processor, cause the electronic device to: An electronic device that receives an image captured from an external electronic device as a preview image.

15. In the operating method of an electronic device (201), An action of displaying a first image including a first object stored in the electronic device through a display (260) included in the electronic device; An operation of displaying a preview image obtained from a camera (210) included in the electronic device together with the first image through the display; An action to check a second object included in the above preview image; An operation of identifying a first object related to a second object in the first image based at least in part on the second object; An operation of generating a second image by editing the first image using a generative AI model (320) such that at least a portion of the first object is transformed based on at least a portion of the second object; and A method of operating an electronic device, comprising an action of displaying the second image through the display.