Method for displaying an image and electronic device supporting the same
Disclosed are a method of displaying an image (for example, wallpaper) on a display and an electronic device supporting the same. The electronic device may include a display, a memory, and at least one processor comprising processing circuitry. At least one processor, individually and/or collectively, may be configured to: separate a main object from a background object in an image; determine a display size of a display to display an edited image; edit (modify) each of the main object and the background object based on the display size; combine the edited main object and the edited background object and generate the edited image based on the display size; and display the edited image through the display.
1 . An electronic device comprising:
a first display configured to operate in a first state of the electronic device;
a second display configured to operate in a second state of the electronic device;
at least one processor comprising processing circuitry; and
memory storing instructions that, when executed by the at least one processor, individually and/or collectively, cause the electronic device to:
display an image on the first display,
separate the image into a first object and a second object,
identify a display size of the second display,
edit each of the first object and the second object based on the display size of the second display,
determine whether the first object is entirely included in the image,
in response to the first object being entirely included in the image, dispose the first object to be displayed at a center of the second display based on the display size of the second display,
in response to the first object not being entirely included in the image, dispose the first object to be aligned with a cross section with which the first object is in contact,
generate an edited image by combining the edited first object and the edited second object, and
store the edited image as an image to be displayed on the second display.
2 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor, individually and/or collectively, cause the electronic device to improve a quality of the edited image, based on execution of a specified function for improving the quality of the edited image when the edited image is generated.
3 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor, individually and/or collectively, cause the electronic device to:
detect an input for configuring a wallpaper based on the image displayed on the first display,
determine the display size of the second display in which the wallpaper is to be display,
resize the edited image based on the display size of the second display, and
configure the resized image as the wallpaper of the second display.
4 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor, individually and/or collectively, cause the electronic device to determine the display size of the second display, based on an input of selecting the second display.
5 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor, individually and/or collectively, cause the electronic device to:
analyze entire image frames of the image, and determine the first object, based on the entire image frames.
6 . The electronic device of claim 5 , wherein the instructions, when executed by the at least one processor, individually and/or collectively, cause the electronic device to:
based on the first object being determined, identify remaining objects other than the first object as second objects in the image, and
separate the first object and second objects as independent objects in the image.
7 . The electronic device of claim 6 , wherein the instructions, when executed by the at least one processor, individually and/or collectively, cause the electronic device to:
edit the image into the first object and the second objects independently,
wherein editing the first object includes first adjusting of the first object based on the display size of the second display, and
wherein editing the second objects includes second adjusting of the second objects based on the display size of the second display.
8 . The electronic device of claim 7 , wherein the instructions, when executed by the at least one processor, individually and/or collectively, cause the electronic device to:
perform editing of resizing the first object and/or controlling a location of the first object so that the first object is displayed within the second display, and
perform editing of drawing or cropping the second objects based on the first object.
9 . The electronic device of claim 1 , wherein the instructions, when executed by the at least one processor, individually and/or collectively, cause the electronic device to:
determine whether the first object is an animation object,
in response to the first object being the animation object,
determine whether the second object includes a specified condition, the specified condition comprising a condition in which the second object has a feature point including a color and/or pattern,
in response to the second object not including the specified condition, determine whether the second object is animated with the first object,
in response to the second object not being animated with the first object, determine that there is no second object and designate a location of the first object, and
in response to the second object being animated with the first object, fill the edited image based on the display size of the second display through an outpainting technology.
10 . The electronic device of claim 9 , wherein the instructions, when executed by the at least one processor, individually and/or collectively, cause the electronic device to:
in response to the second object including the specified condition, determine whether the first object is entirely included in the image,
in response to the first object being entirely included in the image, dispose the first object at a center of the edited image based on the display size of the second display and control a color and a pattern of the second object based on the display size of the second display in areas other than the first object, and
in response to the first object not being entirely included in the image, dispose the first object to be aligned with a cross section with which the first object is in contact and control the color and the pattern of the second object based on the display size of the second display in the areas other than the first object.
11 . A method of operating an electronic device, the method comprising:
displaying an image on a first display configured to operate in a first state of the electronic device;
separating the image into a first object and a second object;
identifying a display size of a second display configured to operate in a second state of the electronic device;
editing each of the first object and the second object based on the display size of the second display;
determining whether the first object is entirely included in the image,
in response to the first object being entirely included in the image, disposing the first object to be displayed at a center of the second display based on the display size of the second display,
in response to the first object not being entirely included in the image, disposing the first object to be aligned with a cross section with which the first object is in contact,
generating an edited image by combining the edited first object and the edited second object; and
storing the edited image as an image to be displayed on the second display.
12 . The method of claim 11 , comprising:
detecting an input for configuring a wallpaper based on the image displayed on the first display,
determining the display size of the second display in which the wallpaper is to be displayed,
resizing the edited image based on the display size of the second display, and
configuring the resized image as the wallpaper of the second display.
13 . The method of claim 11 , comprising:
analyzing entire image frames of the image;
determining the first object, based on the entire image frames;
identifying remaining objects other than the first object as second objects in the image; and
separating the first object from the second objects as independent objects in the image.
14 . A non-transitory computer-readable recording medium storing a program which, when executed, causes an electronic device to perform operations comprising:
displaying an image on a first display configured to operate in a first state of the electronic device,
separating the image into a first object and a second object,
identifying a display size of a second display configured to operate in a second state of the electronic device,
editing each of the first object and the second object based on the display size of the second display,
determining whether the first object is entirely included in the image,
in response to the first object being entirely included in the image, disposing the first object to be displayed at a center of the second display based on the display size of the second display,
in response to the first object not being entirely included in the image, disposing the first object to be aligned with a cross section with which the first object is in contact,
generating an edited image by combining the edited first object and the edited second object, and
storing the edited image as an image to be displayed on the second display.