Image erasing method and apparatus, and electronic device and storage medium
By defining the selection layer and the erase layer in the image erase page, and using a mask layer to indicate the target object area for precise erasure, the problem of blending image materials and special effects images is solved, the risk of misoperation is reduced, and the erasure efficiency is improved.
Patent Information
- Application Number
- PCT/CN2025/110190
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-30
- Filing Date
- 2025-07-23
- Publication Date
- 2026-02-05
AI Technical Summary
Existing technologies struggle to achieve a natural fusion of the image material and the image to be enhanced when adding special effects to an image, and the erasing process carries a high risk of misoperation and is inefficient.
By defining the selection layer and the erase layer in the image erase page, using a mask layer to indicate the target object area, and responding to the erase confirmation command to perform precise erasure, a natural blending of the selection layer and the erase layer is achieved.
It reduces the risk of accidental operation during the erasure process, improves erasure efficiency, and achieves a natural fusion effect between image materials and special effects images.
Smart Images

Figure CN2025110190_05022026_PF_FP_ABST
Abstract
Description
Image erasing method and device, electronic device, and storage medium
[0001] Cross-reference to Related Applications
[0002] This application claims priority to the Chinese Patent Application No. 202411038002.X, filed on July 30, 2024, and entitled "Image erasing method and device, electronic device, and storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] The present disclosure relates to the technical field of image processing, and in particular, to an image erasing method and device, an electronic device, and a storage medium. BACKGROUND
[0004] With the rapid development of digital image technology, people have higher requirements for the visual effect of images. In order to increase the ornamental and artistic value of images, adding special effects to images has become an important technical means. Special effects can bring richer visual effects to images, making images more attractive and ornamental. SUMMARY
[0005] In a first aspect, the present disclosure provides an image erasing method, comprising:
[0006] displaying an image erasing page, the image erasing page comprising at least two candidate layers;
[0007] in response to an erasing function starting instruction, determining a selected area layer and an erasing layer from the at least two candidate layers; the selected area layer comprising at least one object;
[0008] determining a target object from the at least one object in the selected area layer, and displaying a mask layer corresponding to the target object in the image erasing page, the mask layer being used to indicate an area occupied by the target object in the selected area layer;
[0009] in response to an erasing confirmation instruction, erasing an image in the erasing layer based on the area indicated by the mask layer.
[0010] In a second aspect, the present disclosure also provides an image erasing device, comprising:
[0011] a candidate layer display module configured to display an image erasing page, the image erasing page comprising at least two candidate layers;
[0012] a layer determination module configured to, in response to an erasing function starting instruction, determine a selected area layer and an erasing layer from the at least two candidate layers; the selected area layer comprising at least one object;
[0013] The mask layer display module is configured to determine a target object in at least one object included in the selected area layer, and display a mask layer corresponding to the target object in the image erasing page, the mask layer being used to indicate an area occupied by the target object in the selected area layer.
[0014] The erasing module is configured to, in response to an erasing confirmation instruction, erase the image in the erasing layer based on the area indicated by the mask layer.
[0015] In a third aspect, the present disclosure provides an electronic device, which comprises:
[0016] one or more processors;
[0017] a storage device configured to store one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the image erasing method as described above.
[0019] In a fourth aspect, the present disclosure provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image erasing method as described above. BRIEF DESCRIPTION OF DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure, together with the description.
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
[0022] FIG. 1 is a flowchart of an image erasing method according to an embodiment of the present disclosure;
[0023] FIG. 2 is a schematic diagram of a base image according to an embodiment of the present disclosure;
[0024] FIG. 3 is a schematic diagram of a material image according to an embodiment of the present disclosure;
[0025] FIGS. 4-5 are schematic diagrams of several image erasing pages according to embodiments of the present disclosure;
[0026] FIG. 6 is a schematic diagram of an auxiliary line corresponding to a base image according to an embodiment of the present disclosure;
[0027] FIGS. 7-12 are schematic diagrams of several image erasing pages according to embodiments of the present disclosure;
[0028] FIG. 13 is a schematic diagram of an image erasing device according to an embodiment of the present disclosure;
[0029] FIG. 14 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] In order to more clearly understand the above-mentioned purposes, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0031] In the following description, many specific details are set forth in order to fully understand the present disclosure, but the present disclosure can also be implemented in other ways different from those described herein; obviously, the embodiments described in the specification are only some embodiments of the present disclosure, not all embodiments.
[0032] In actual image special effect addition, it is often desired to naturally integrate the material image into the image to which the special effect is added. In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image erasing method, device, electronic device and storage medium. The technical solutions provided by the embodiments of the present disclosure have the following advantages compared with the prior art: the technical solutions provided by the embodiments of the present disclosure set, in response to an erasing function starting instruction, at least two candidate layers, determine a selected area layer and an erasing layer; the selected area layer includes at least one object; determine a target object in the at least one object included in the selected area layer, display a mask layer corresponding to the target object in the image erasing page, and the mask layer is used to indicate the area occupied by the target object in the selected area layer; in response to an erasing confirmation instruction, erase the image in the erasing layer based on the area indicated by the mask layer. In essence, a new method is provided, which enables the user to select the area to be erased accurately and erase it according to the specific needs, with the objects in the selected area layer as a reference, and realizes the effect of natural integration of the image in the selected area layer after erasing and the image in the erasing layer.
[0033] FIG. 1 is a flowchart of an image erasing method according to an embodiment of the present disclosure. The embodiment can be applied to a case where an image is edited in a client. The method can be performed by an image erasing apparatus. The apparatus can be implemented in software and / or hardware. The apparatus can be configured in an electronic device, such as a terminal, for example, a smartphone, a palmtop computer, a tablet computer, a wearable device with a display, a desktop computer, a notebook computer, an all-in-one computer, a smart home device, and the like. Alternatively, the embodiment can be applied to a case where an image is edited in a server. The method can be performed by an image erasing apparatus. The apparatus can be implemented in software and / or hardware. The apparatus can be configured in an electronic device, such as a server.
[0034] As shown in FIG. 1, the method can specifically include the following steps.
[0035] S110, an image erasing page is displayed. The image erasing page includes at least two candidate layers.
[0036] The image erasing page can be a page for editing an image. Further, in the image erasing page, a user can interact with a control or an option in the image erasing page to erase an image in a partial region of a layer located in an upper layer. After the erasing operation, the region in the layer located in the upper layer is in a state of no pattern, no color, and transparency, which can be transparent to an image in a layer located in a lower layer.
[0037] The candidate layer is a pre-provided layer. The candidate layer includes an image. In practice, the image in the candidate layer can be an image captured by a user or an image downloaded from a network.
[0038] S120, in response to an erasing function starting instruction, a selection area layer and an erasing layer are determined in the at least two candidate layers. The selection area layer includes at least one object.
[0039] The erasing function starting instruction can be an instruction for conveying to an electronic device that a user wants to erase a partial region in a layer.
[0040] There are various occasions for generating the erasing function starting instruction. For example, in practice, the erasing function starting instruction can be generated directly when it is detected that the image erasing page includes at least two candidate layers. Alternatively, the erasing function starting instruction can be generated when it is detected that the image erasing page includes at least two candidate layers and it is detected that an option for generating the erasing function starting instruction is triggered.
[0041] The option for generating the erasing function starting instruction can be, for example, a control or other triggerable element. Optionally, the display position of the option for generating the erasing function starting instruction is in the image erasing page. The option for generating the erasing function starting instruction is triggered, for example, by the user interacting with the option for generating the erasing function starting instruction by clicking, swiping, or dragging, etc.
[0042] In the at least two candidate layers, the selection area layer and the erasing layer are determined, for example, by selecting one of the at least two candidate layers as the selection area layer and the other as the erasing layer. In other words, the selection area layer and the erasing layer both belong to the candidate layers. However, the selection area layer and the erasing layer are different candidate layers. For another example, in the at least two candidate layers, the selection area layer and the erasing layer are determined, for example, by selecting one of the at least two candidate layers as both the selection area layer and the erasing layer. That is, the selection area layer and the erasing layer are the same candidate layer.
[0043] The erasing layer can be, for example, a layer that is the erasing object. In other words, the image to be erased is located in the erasing layer. The selection area layer can be, for example, a layer used to assist in determining the location of the image to be erased. In some scenarios, for the case where the selection area layer and the erasing layer are different candidate layers, the selection area layer is located below the erasing layer, and after the image to be erased in the erasing layer is erased, the area originally occupied by the image to be erased will become a transparent area. If there are images in the underlying selection area layer, these images in the selection area layer that were originally covered and blocked by the image to be erased will be revealed due to the formation of the transparent area.
[0044] An object is a thing that constitutes an image in the selection area layer, has clear semantic information, is identifiable, and is a countable or uncountable individual or unit. They collectively constitute the visual content of the image through their respective attribute characteristics, and are the basic objects of image processing and analysis, especially the targets that need to be accurately extracted and separated. Exemplarily, the object can be a person, a component part of a person (such as a face, clothes, an arm, hair, eyes), an animal, a component part of an animal, a plant, a building, a tree, a vehicle, the sky, or grass, etc. In some scenarios, the object is also referred to as an entity.
[0045] There are various implementation methods for this step. Exemplarily, for the case where the selection area layer and the erasing layer are different candidate layers, in one embodiment, the implementation method of this step can include: in response to the erasing function starting instruction, taking the candidate layer currently in the selected state as the erasing layer, or taking the candidate layer currently located in the uppermost layer as the erasing layer; taking the candidate layer other than the erasing layer as the reference layer; and determining the selection area layer in the reference layer.
[0046] The candidate layer currently in the selected state is set as the erasing layer. For example, the user can perform a selection operation on one or more candidate layers in the image erasing page. In response to the selection operation on the one or more candidate layers, the selected layer is placed in the selected state, and then the candidate layer currently in the selected state is set as the erasing layer. The candidate layer currently in the selected state is set as the erasing layer because, in some scenarios, the user's selection operation on the candidate layer itself reflects the user's intention to use the selected candidate layer as the erasing layer.
[0047] The candidate layer currently on the top layer is set as the erasing layer because, in the image editing process, the candidate layer on the top layer is usually the first to be seen and operated by the user. This setting conforms to the user's intuitive cognition and facilitates the user's understanding of the erasing logic and rapid learning of the image erasing function.
[0048] Optionally, in the reference layers, the selection area layer is determined. For example, all or part of the reference layers can be set as the selection area layer.
[0049] For example, the user uploads the base image given in FIG. 2 and the material image given in FIG. 3 to the image erasing page in sequence, so that the base image and the material image are displayed in the image erasing page in the form of candidate layers. Referring to FIG. 4, after the uploading is completed, the candidate layer corresponding to the material image is located above the candidate layer corresponding to the base image. The candidate layer corresponding to the material image is determined as the erasing layer, and the candidate layer corresponding to the base image is determined as the selection area layer.
[0050] Further, in the reference layers, the selection area layer is determined, which can further include: displaying the layer identifiers of the reference layers in the image erasing page; and in response to a selection instruction on a target layer identifier in the layer identifiers of the reference layers, setting the reference layer corresponding to the target layer identifier as the selection area layer.
[0051] The layer identifier can be information that distinguishes one reference layer from other reference layers. For example, the layer identifier can include one or more of the area range, name, number, and thumbnail of the reference layer.
[0052] The area range of the reference layer can be, for example, the area range occupied by the reference layer in the image erasing page.
[0053] The selection instruction on the target layer identifier in the layer identifier of the reference layer can be, for example, an instruction generated based on a selection operation of the user on the layer identifier of the reference layer. The selection operation can be, for example, a click operation, a sliding operation, or a dragging operation, etc. The layer identifier selected by the user through the selection operation is the target layer identifier.
[0054] If the layer identifier can include a region range of the reference layer, the selection operation on the target layer identifier can be, for example, a click operation or a sliding operation on a specific position in the region range of the target image, or can be a circle selection operation on the region range of the target image by using a region selection tool.
[0055] In some scenarios, after comprehensively considering the case that the selection region layer and the erasing layer are different candidate layers and the case that the selection region layer and the erasing layer are the same candidate layer, it can be set that, in the image erasing page, the layer identifiers of the candidate layers (including the reference layer and the erasing layer) are displayed; and in response to a selection instruction on a first target layer identifier in the layer identifiers of the candidate layers, the candidate layer corresponding to the first target layer identifier is taken as the selection region layer.
[0056] The selection instruction on the first target layer identifier in the layer identifiers of the candidate layers can be, for example, an instruction generated based on a selection operation of a user on the layer identifiers of the candidate layers. The selection operation can be, for example, a click operation, a sliding operation or a dragging operation, etc. The layer identifier selected by the user through the selection operation is the first target layer identifier.
[0057] For example, referring to FIG. 5, if the image displayed in the current image erasing page is the result of superimposition of three candidate layers. The first candidate layer includes a person, a sky and a grassland. The second candidate layer includes a puppy. The third candidate layer includes a sun. In the image erasing page, three layer identifiers are displayed. The three layer identifiers correspond to the candidate layers one by one. If the user clicks the first layer identifier, the first candidate layer is taken as the reference layer.
[0058] Optionally, in practice, when determining the erasing layer, a similar method can also be selected, for example, in response to an erasing function starting instruction, the layer identifiers of the candidate layers are displayed in the image erasing page; and in response to a selection instruction on a second target layer identifier in the layer identifiers of the candidate layers, the candidate layer corresponding to the second target layer identifier is taken as the erasing layer.
[0059] It should be noted that, in practice, the number of the determined selection region layers can be one or more. Similarly, the number of the determined erasing layers can be one or more. The present application does not limit this.
[0060] In S130, a target object is determined in at least one object included in the selection region layer, and a mask layer corresponding to the target object is displayed in the image erasing page, where the mask layer is used to indicate a region occupied by the target object in the selection region layer.
[0061] There are various implementation methods for this step, which are not limited in the present application. Illustratively, in some scenarios, the object in the selected area layer can be further divided into a main object and a non-main object. The main object may, for example, be an object in the selected area layer that needs to be focused on or highlighted. The non-main object may, for example, be an object in the selected area layer other than the main object. In this regard, in some embodiments, S130 can include determining the main object in the selected area layer as a target object and displaying a mask layer corresponding to the target object in the image erasing page. The mask layer corresponding to the target object can be obtained by identifying the selected area layer using a main object recognition model. The execution time of the step of obtaining the mask layer corresponding to the target object can be before S130 or after determining the main object in the selected area layer as the target object.
[0062] In practice, optionally, the main object and the non-main object can not be distinguished, and S130 can include displaying a mask layer corresponding to a target object in the image erasing page in response to a selection instruction for the target object in at least one object included in the selected area layer. The essence of such a setting is to allow the user to autonomously select which object to occupy the area to determine the erasing area in the erasing layer. The object selected by the user can be a main object or a non-main object.
[0063] Further, S130 can include displaying object identifiers corresponding to the objects in the selected area layer in the image erasing page and displaying a mask layer corresponding to a target object in the image erasing page in response to a selection instruction for a target object identifier in the object identifiers.
[0064] The object identifier may, for example, be information that distinguishes one object from other objects. Illustratively, the object identifier can include the name, number, and category name of the object, etc.
[0065] The selection instruction for the target object identifier in the object identifier may, for example, be an instruction generated based on a selection operation of the user on the target object identifier. The selection operation may, for example, be a click operation, a sliding operation, or a dragging operation, etc. The object identifier selected by the user through the selection operation is the target object identifier.
[0066] Exemplarily, referring to FIG. 4, taking the base image as the selected region layer, and using a certain entity segmentation model to identify the selected region layer, three objects, i.e., a person, clothes, and the sky, can be obtained. Using a certain subject identification model to identify the selected region layer, a subject object is obtained. The subject identification model "considers" that the subject object is a person. In FIG. 4, four object labels, i.e., "smart subject", "person", "clothes", and "sky", are displayed. The "smart subject" is the label of the subject object identified by the subject identification model, and the "person", "clothes", and "sky" are the labels of the objects identified by the entity segmentation model. If the user does not perform a selection operation on the object labels, the object corresponding to the default "smart subject" label (i.e., the subject object) can be set as the target object. The mask layer corresponding to the "smart subject" is displayed in the image erasing page. If the user performs a selection operation on the object labels, such as selecting the "clothes" label, the mask layer corresponding to the "clothes" is displayed in the image erasing page.
[0067] In another embodiment, the implementation method of S130 can include: displaying an auxiliary line corresponding to the selected region layer in the image erasing page; the auxiliary line is used to indicate the edge of the object included in the selected region layer, and the auxiliary line divides the selected region layer into a plurality of regions; in response to a selection operation on a target region in the plurality of regions, determining a target object corresponding to the target region; and displaying a mask layer corresponding to the target object in the image erasing page.
[0068] The user selects one or more regions in the plurality of regions divided by the auxiliary line, and the region selected by the user is the target region. The selection operation on the target region in the plurality of regions can be, for example, a click operation or a sliding operation of the user in the target region, and the like.
[0069] Exemplarily, if the base image (the image in FIG. 2) is taken as the selected region layer, the auxiliary line corresponding to the selected region layer is as shown in FIG. 6. It is assumed that the entity identification model identifies the image in FIG. 2, and the identified objects are three, i.e., the sky, the grassland, and the person. The auxiliary line corresponding to the selected region layer outlines the edges of the sky, the grassland, and the person. The auxiliary line divides the selected region layer into three regions. Each region corresponds to an object. As shown in FIG. 6, region 1 corresponds to the sky, region 2 corresponds to the grassland, and region 3 corresponds to the person. If it is detected that the user performs a selection operation on one of the regions, such as performing a selection operation on region 2, since region 2 corresponds to the grassland, the grassland is taken as the target object.
[0070] When the auxiliary line is actually displayed, for example, the image in FIG. 6 can be superimposed on the image in FIG. 4 or FIG. 5, and the color and / or thickness of the auxiliary line are set to make the auxiliary line be displayed prominently.
[0071] By setting the auxiliary line corresponding to the selected area layer in the image erasing page, and in response to the selection operation on the target area in the multiple areas, the target object corresponding to the target area is determined. The essence is to clearly indicate the range of each area by means of the auxiliary line, so as to facilitate the user to more accurately and quickly select the area to be referred according to his own needs.
[0072] In some embodiments, before S130, the method further includes performing object recognition on the image in the selected area layer to obtain a mask layer corresponding to each object, and further obtaining a correspondence set of the objects and the mask layers. The "displaying the mask layer corresponding to the target object in the image erasing page" can include querying the correspondence set of the objects and the mask layers to obtain the mask layer corresponding to the target object, and displaying the mask layer corresponding to the target object in the image erasing page.
[0073] Optionally, the object recognition on the image in the selected area layer can be performed by using an entity segmentation model and / or an entity analysis model to obtain the mask layer corresponding to each object.
[0074] It should be noted that the subject segmentation model, the entity segmentation model and the entity analysis model all belong to image segmentation models, which are used to segment the image (in this application, the selected area layer), but the dimensions of segmentation are different.
[0075] Generally, the subject segmentation model is used to segment the subject object of the image, and does not segment the non-subject object.
[0076] The entity segmentation model is used to segment the image into entities. The segmented objects include the subject object and the non-subject object.
[0077] In some scenarios, an object is a complex body, which can be decomposed into multiple components. The entity analysis model is used to further segment the object in the image into components. In some embodiments, the object as a whole can be analyzed, such as a human body, and the analyzed components can include a hat, gloves, glasses, a shirt, trousers, socks worn by the human, hair, skin, left leg, right leg, left hand, right hand, sleeves, etc. In other embodiments, the object can be analyzed locally, such as a human, and the analyzed components can include skin, left eyebrow, right eyebrow, left eye, right eye, nose, lips, hair, etc. located in the face of the human.
[0078] The bottom picture (the image in FIG. 2) is taken as the selected area layer, and the person in the bottom picture is the target object. FIG. 7 shows the effect of displaying the mask layer corresponding to the target object in the image erasing page. The area indicated by the mask layer in FIG. 7 is the area occupied by the person in the selected area layer (i.e., the bottom picture). Due to the presence of the mask layer, the person in the selected area layer becomes blurred. In this way, the user can identify which area will be determined based on the mask layer when determining the erasing area subsequently.
[0079] In practice, in order to make the mask layer corresponding to the target object in the image erasing page more easily observed, the color of the area indicated by the mask layer can be set to a preset color, such as green, yellow, etc.
[0080] S140, in response to the erasing confirmation instruction, erasing the image in the erasing layer based on the area indicated by the mask layer.
[0081] The erasing confirmation instruction may, for example, be information conveyed to the electronic device by the user that the user is satisfied with the currently selected selected area layer, erasing layer, and target object. It may, for example, be generated based on the selection operation of the user on the erasing information confirmation option. The selection operation may, for example, be a click operation, a sliding operation, or a dragging operation, etc. Illustratively, referring to FIG. 7, the "Confirm" in the lower right corner of the image erasing page is the erasing information confirmation option. If the user clicks the erasing information confirmation option, the image in the erasing layer is erased based on the currently selected selected area layer, erasing layer, and target object.
[0082] There are various implementation methods for this step, which are not limited by the present application. Illustratively, the implementation method of this step includes: determining a first area and a second area in the erasing layer based on the area indicated by the mask layer; the first area corresponds to the area indicated by the mask layer, and the second area is an area in the erasing layer other than the first area; erasing the image in the first area of the erasing layer, or erasing the image in the second area of the erasing layer.
[0083] The "first area corresponds to the area indicated by the mask layer" may, for example, mean that the first area is completely consistent with the area indicated by the mask layer. In other words, the first area is defined according to the area occupied by the target object indicated in the mask layer.
[0084] For example, referring to FIG. 7, if the area indicated by the mask layer is the area occupied by the figure in the selected area layer, the first area is in the erasing layer, and the selected area layer is overlaid with the erasing layer, the first area coincides with the area occupied by the figure in the selected area layer. Referring to FIG. 8, if the image in the first area in the erasing layer is erased, the first area will form a transparent area, which will make the figure in the selected area layer completely exposed. Referring to FIG. 9, if the image in the second area in the erasing layer is erased, the second area will form a transparent area, which means that the part of the puppy image that does not coincide with the figure (such as the head, tail, etc.) will disappear, and the part of the sky and grass in the selected area layer that was originally blocked by the puppy's head will be exposed, and the part of the grass in the selected area layer that was originally blocked by the puppy's tail will also be exposed. For example, the user can determine to erase the image in the first area in the erasing layer or to erase the image in the second area in the erasing layer by selecting the "inverted selection" option in the image erasing page.
[0085] In the above technical solution, by setting the selected area layer and the erasing layer in the at least two candidate layers in response to the erasing function starting instruction; the selected area layer includes at least one object; determining the target object in the at least one object included in the selected area layer, and displaying the mask layer corresponding to the target object in the image erasing page, the mask layer is used to indicate the area occupied by the target object in the selected area layer; in response to the erasing confirmation instruction, erasing the image in the erasing layer based on the area indicated by the mask layer. In essence, a new method is provided, which enables the user to accurately select the area to be erased and erase it based on the object in the selected area layer according to specific needs, achieving the effect of naturally integrating the image in the selected area layer after erasing with the image in the erasing layer. Compared with traditional methods, this solution does not rely on pixel-by-pixel accurate erasing or be limited to the local area defined by the thickness of the erasing tool. It provides a more accurate, practical and fast way to select the erasing range, significantly reducing the risk of misoperation and speeding up the erasing process. This image erasing method has great advantages for efficient addition of special effects and fine image editing.
[0086] On the basis of the above technical solution, optionally, after S130, the method further includes: reducing the transparency of the erasing layer; and after S140, the method further includes: restoring the transparency of the erasing layer.
[0087] Reducing the transparency of the erasing layer will make the image in the layer below it appear. For example, reducing the transparency of the erasing layer can mean adjusting the transparency of the erasing layer to a pre-specified transparency value that is lower than 100%, such as 50% or 75%, etc.
[0088] Restoring the transparency of the erasing layer, for example, can refer to adjusting the transparency of the erasing layer to 100%, so that the image in the underlying layer is blocked and cannot be displayed.
[0089] Referring to FIG. 7, after displaying the mask layer corresponding to the target object, the transparency of the erasing layer is adjusted to 50%. In this way, the user can observe the area indicated by the mask layer and the underlying image through the erasing layer, and determine whether the area indicated by the mask layer is consistent with the area that the user wants to erase, and estimate the overall visual effect of the image after erasing. Referring to FIG. 8, after erasing the image in the erasing layer, the transparency of the erasing layer is restored to 100%. The user cannot observe the grassland in the underlying image through the puppy.
[0090] On the basis of the above technical solutions, optionally, if the erasing layer includes text; before S140, further comprising: displaying prompt information for prompting that after performing the erasing operation on the erasing layer, editing of the text in the erasing layer will be restricted. Restricting editing of the text in the erasing layer, for example, can include restricting editing of one or more of the content, font, color, and position of the text.
[0091] For example, referring to FIG. 10, the image displayed on the image erasing page is composed of three layers. Layer 1 includes text information, the content of which is "Lucky day", layer 2 includes a puppy (i.e., FIG. 3), and layer 3 includes a person, the sky, and the grassland (i.e., FIG. 2). In FIG. 10, layer 1 is in a selected state, and the text "Lucky day" has a corresponding "edit" control in the upper right corner. If the user clicks the "edit" control, the user can further edit the content, font, color, and position of the text information. If layer 1 is used as the erasing layer, before erasing the image in the erasing layer, referring to FIG. 11, prompt information is displayed, the content of which is "After using the text 'erase', editing of the text content, font, style, etc. will no longer be supported. Do you want to continue?" If the user clicks "continue" and takes the person in layer 3 as the target object, the part in layer 1 that overlaps the target object is erased, and the erasing result is as shown in FIG. 12. In FIG. 12, layer 1 is in a selected state, and compared with FIG. 10 and FIG. 12, the text "Lucky day" does not have a corresponding "edit" control in the upper right corner, that is, editing of the content, font, color, and position of the text in the erasing layer is restricted.
[0092] The purpose of this setting is to avoid the influence of the editing operation on the previously obtained text erasing result.
[0093] On the basis of the above technical solutions, optionally, after S120, further comprising: detecting a smearing operation on the erasing layer, and erasing the image in the erasing layer based on the area covered by the smearing operation.
[0094] The erasing operation on the erasing layer can be, for example, erasing the erasing layer by using an erasing tool such as an eraser, a rubber, or the like. Subsequently, the covered area of the erasing operation can be determined according to the thickness of the erasing tool and the erasing track, and then the image in the covered area of the erasing operation in the erasing layer is erased.
[0095] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type, use range, use scenario, and the like of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained through appropriate means according to relevant laws and regulations.
[0096] For example, in response to receiving an active request of the user, prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will require obtaining and using personal information of the user. Thus, the user can voluntarily choose whether to provide personal information to the software or hardware such as an electronic device, an application program, a server, or a storage medium, which performs the operation of the technical solutions of the present disclosure, according to the prompt information.
[0097] As an optional but non-limiting implementation manner, in response to receiving an active request of the user, the prompt information can be sent to the user in the form of a pop-up window, and the prompt information can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0098] It can be understood that the above notification and obtaining of the authorization of the user are only illustrative, and do not limit the implementation manners of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation manners of the present disclosure.
[0099] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.
[0100] FIG. 13 is a structural schematic diagram of an image erasing device in an embodiment of the present disclosure. The image erasing device provided by the embodiment of the present disclosure can be configured in a client or can be configured in a server. Referring to FIG. 13, the image erasing device specifically includes:
[0101] The candidate layer display module 310 is configured to display an image erasing page, and the image erasing page includes at least two candidate layers.
[0102] The layer determining module 320 is configured to, in response to the erasing function starting instruction, determine, from the at least two candidate layers, a selected area layer and an erasing layer; the selected area layer includes at least one object.
[0103] The mask layer displaying module 330 is configured to determine a target object from the at least one object included in the selected area layer, and display, in the image erasing page, a mask layer corresponding to the target object, the mask layer being used to indicate an area occupied by the target object in the selected area layer.
[0104] The erasing module 340 is configured to, in response to an erasing confirmation instruction, erase an image in the erasing layer based on the area indicated by the mask layer.
[0105] Further, the layer determining module 320 is configured to:
[0106] in response to the erasing function starting instruction, determine, as the erasing layer, a candidate layer currently in a selected state, or determine, as the erasing layer, a candidate layer currently located at the topmost layer; and determine, as a reference layer, a candidate layer other than the erasing layer;
[0107] determine, in the reference layer, the selected area layer.
[0108] Further, the layer determining module 320 is configured to:
[0109] display, in the image erasing page, a layer identifier of each of the reference layers;
[0110] in response to a selection instruction for a target layer identifier from the layer identifiers of the reference layers, determine, as the selected area layer, a reference layer corresponding to the target layer identifier.
[0111] Further, the mask layer displaying module 330 is configured to:
[0112] display, in the image erasing page, an object identifier corresponding to an object in the selected area layer;
[0113] in response to a selection instruction for a target object identifier from the object identifiers, display, in the image erasing page, a mask layer corresponding to the target object.
[0114] Further, the mask layer displaying module 330 is configured to:
[0115] display, in the image erasing page, an auxiliary line corresponding to the selected area layer; the auxiliary line is used to indicate an edge of an object included in the selected area layer, and the auxiliary line divides the selected area layer into a plurality of areas;
[0116] In response to a selection operation on a target region in the plurality of regions, a target object corresponding to the target region is determined;
[0117] The image erasing page displays a mask layer corresponding to the target object.
[0118] Further, the device further comprises a transparency adjusting module configured to, after displaying the mask layer corresponding to the target object in the image erasing page, reduce the transparency of the erasing layer.
[0119] In response to an erasing confirmation instruction, after erasing the image in the erasing layer based on the region indicated by the mask layer, the transparency of the erasing layer is restored.
[0120] Further, if the erasing layer comprises text, the device further comprises a prompting module configured to:
[0121] In response to an erasing confirmation instruction, before erasing the image in the erasing layer based on the region indicated by the mask layer, the device displays prompt information prompting that, after performing the erasing operation on the erasing layer, editing of the text in the erasing layer will be restricted.
[0122] Further, the erasing module 340 is configured to:
[0123] Based on the region indicated by the mask layer, a first region and a second region in the erasing layer are determined; the first region corresponds to the region indicated by the mask layer, and the second region is a region in the erasing layer other than the first region;
[0124] The image in the first region in the erasing layer is erased, or the image in the second region in the erasing layer is erased.
[0125] The image erasing device provided by the embodiments of the present disclosure can perform the steps performed by the client or the server in the image erasing method provided by the embodiments of the present disclosure, and has the execution steps and beneficial effects, which will not be described here.
[0126] FIG. 14 is a structural diagram of an electronic device according to an embodiment of the disclosure. Referring to FIG. 14, a structural diagram of an electronic device 1000 suitable for implementing an electronic device according to an embodiment of the disclosure is illustrated. The electronic device 1000 according to an embodiment of the disclosure can include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcasting receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a car terminal (e.g., a car navigation terminal), a wearable electronic device, and the like, and a stationary terminal such as a digital TV, a desktop computer, a smart home device, and the like. The electronic device illustrated in FIG. 14 is merely an example, and should not impose any limitation on the functions and use range of the embodiments of the disclosure.
[0127] As illustrated in FIG. 14, the electronic device 1000 can include a processing device (e.g., a central processing unit, a graphic processing unit, etc.) 1001 that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003 to implement an image erasing method according to an embodiment of the disclosure. In the RAM 1003, various programs and information required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0128] In general, the following devices can be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; a storage device 1008 including, for example, a magnetic tape, a hard disk, and the like; and a communication device 1009. The communication device 1009 can allow the electronic device 1000 to communicate wirelessly or wiredly with other devices to exchange information. Although FIG. 14 illustrates the electronic device 1000 having various devices, it is understood that all of the illustrated devices are not required to be implemented or provided. More or less devices can be alternatively implemented or provided.
[0129] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program in accordance with embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts, thereby implementing the image erasing method as described above. In such embodiments, the computer program can be downloaded and installed from a network by the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-described functions defined in the methods of the embodiments of the present disclosure are performed.
[0130] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium, for example, can be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used or used in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include an information signal in a baseband or as a part of a carrier wave that carries computer-readable program code. Such a propagated signal can take on multiple forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium that is not a computer-readable storage medium and that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained in the computer-readable medium can be transmitted in any suitable medium, including but not limited to a wire, an optical fiber, an RF (radio frequency) or the like, or any suitable combination thereof.
[0131] In some embodiments, the client, server can communicate using any known or later developed network protocols, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital information (e.g., communication networks). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet, and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any known or later developed network.
[0132] The computer readable medium described above can be included in the electronic device described above; or can exist separately, without being assembled into the electronic device.
[0133] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, the electronic device is caused to:
[0134] Display an image erasing page, the image erasing page comprising at least two candidate layers;
[0135] In response to an erasing function starting instruction, determine a selected area layer and an erasing layer from the at least two candidate layers; the selected area layer comprising at least one object;
[0136] Determine a target object from the at least one object comprised in the selected area layer, and display a mask layer corresponding to the target object in the image erasing page, the mask layer being used to indicate an area occupied by the target object in the selected area layer;
[0137] In response to an erasing confirmation instruction, erase the image in the erasing layer based on the area indicated by the mask layer.
[0138] Optionally, when the one or more programs are executed by the electronic device, the electronic device can further execute other steps described in the above embodiments.
[0139] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0140] The computer program instructions can also be loaded onto a computer or other programmable information processing apparatus to cause a series of operations to be performed on the computer or other programmable information processing apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable information processing apparatus implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0141] The units described in the embodiments of the present disclosure can be implemented by hardware, software, or a combination of hardware and software. In some cases, the names of the units do not constitute a limitation on the units themselves.
[0142] The functions described in this specification can be implemented in part or in whole through one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Program-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0143] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more of: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0144] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, comprising:
[0145] one or more processors;
[0146] a memory for storing one or more programs;
[0147] when the one or more programs are executed by the one or more processors, so that the one or more processors implement the image erasing method as described in any of the present disclosure.
[0148] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the image erasing method as described in any of the present disclosure.
[0149] The embodiments of the present disclosure also provide a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the image erasing method as described above is implemented.
[0150] It has to be noted that, in the present document, relational terms are intended only to convey a possible relationship between elements or
[0151] The above description is merely that of the specific embodiments of the present disclosure and therefore is not intended to limit the present disclosure. Various modifications made to the embodiments of the present disclosure will be apparent to those skilled in the art to which the present disclosure pertains, and such modifications are not to be interpreted within the scope or spirit of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein but will be construed to include all modifications, equivalents, and substitutes falling within the scope of the present disclosure.
Claims
1. An image erasing method, comprising: displaying an image erasing page, the image erasing page comprising at least two candidate layers; in response to an erasing function starting instruction, determining a selected area layer and an erasing layer from the at least two candidate layers; the selected area layer comprising at least one object; determining a target object from the at least one object comprised in the selected area layer, and displaying a mask layer corresponding to the target object in the image erasing page, the mask layer being used to indicate an area occupied by the target object in the selected area layer; in response to an erasing confirmation instruction, erasing an image in the erasing layer based on the area indicated by the mask layer.
2. The method of claim 1, wherein, The response to the erasing function starting instruction, determining the selected area layer and the erasing layer from the at least two layers, comprises: in response to the erasing function starting instruction, taking the candidate layer currently in the selected state as the erasing layer, or taking the candidate layer currently located at the uppermost layer as the erasing layer; taking the candidate layer other than the erasing layer as a reference layer; determining the selected area layer in the reference layer.
3. The method of claim 2, wherein, The determination of the selected area layer in the reference layer comprises: displaying a layer identifier of each of the reference layers in the image erasing page; in response to a selection instruction of a target layer identifier in the layer identifier of the reference layer, taking the reference layer corresponding to the target layer identifier as the selected area layer.
4. The method of claim 1, wherein, The determination of the target object from the at least one object comprised in the selected area layer, and the display of the mask layer corresponding to the target object in the image erasing page, comprises: displaying an object identifier corresponding to the object in the selected area layer in the image erasing page; in response to a selection instruction of a target object identifier in the object identifier, displaying a mask layer corresponding to the target object in the image erasing page.
5. The method of claim 1, wherein, The determination of the target object from the at least one object comprised in the selected area layer, and the display of the mask layer corresponding to the target object in the image erasing page, comprises: displaying an auxiliary line corresponding to the selected area layer in the image erasing page; the auxiliary line being used to indicate an edge of the object comprised in the selected area layer, the auxiliary line dividing the selected area layer into a plurality of areas; in response to a selection operation of a target area in the plurality of areas, determining a target object corresponding to the target area; displaying a mask layer corresponding to the target object in the image erasing page.
6. The method of claim 1, wherein, After the display of the mask layer corresponding to the target object in the image erasing page, the method further comprises: lowering the transparency of the erasing layer; after the response to the erasing confirmation instruction, erasing the image in the erasing layer based on the area indicated by the mask layer, the method further comprises: restoring the transparency of the erasing layer.
7. The method of claim 1, wherein, If the erasing layer comprises text, before the response to the erasing confirmation instruction, erasing the image in the erasing layer based on the area indicated by the mask layer, the method further comprises: displaying prompt information for prompting that editing of the text in the erasing layer will be limited after the erasing operation is performed on the erasing layer.
8. The method of claim 1, wherein, The response to the erasing confirmation instruction, based on the area indicated by the mask layer, erasing the image in the erasing layer, comprising: Based on the area indicated by the mask layer, determining a first area and a second area in the erasing layer; the first area corresponds to the area indicated by the mask layer, and the second area is the area in the erasing layer except the first area; Erasing the image in the first area in the erasing layer, or erasing the image in the second area in the erasing layer.
9. An image erasing apparatus, comprising: A candidate layer display module for displaying an image erasing page, the image erasing page comprising at least two candidate layers; A layer determination module for determining a selected area layer and an erasing layer in the at least two candidate layers in response to an erasing function starting instruction; the selected area layer comprising at least one object; A mask layer display module for determining a target object in the at least one object comprised in the selected area layer, displaying a mask layer corresponding to the target object in the image erasing page, the mask layer being used for indicating the area occupied by the target object in the selected area layer; An erasing module for, in response to an erasing confirmation instruction, erasing the image in the erasing layer based on the area indicated by the mask layer.
10. An electronic device, comprising: One or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-8.
11. A computer readable storage medium having stored thereon a computer program, the program being executed by a processor to implement the method of any one of claims 1-8.
Citation Information
Patent Citations
Template-based mask automatic erasing method
CN107844240A
Processing method and device and electronic equipment
CN116630393A
Image erasing method and device, electronic equipment and storage medium
CN118967885A
Graphical user interface for rearranging icons
US20160342305A1