Image Processing Method, Apparatus, Computer-Readable Medium, and Electronic Device
By identifying and splitting the target layer in the image, the problem of low image processing efficiency in the prior art is solved, and the layer processing speed is improved and the operation is simplified.
Patent Information
- Application Number
- CN202010193020.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-18
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2040-03-18
AI Technical Summary
In the prior art, image processing efficiency is low, which is mainly due to the complex operation of selecting and configuring layers in the image, resulting in slow layer processing speed.
By obtaining the pending image, the target layer is identified, and some elements of the target layer are located in the specified target area, thereby automatically splitting the pending image.
There is no need to manually select specific layers in the image for splitting, which reduces the amount of manual operations and operation difficulty, and improves the layer processing speed and processing efficiency of the image.
Smart Images

Figure CN113496454B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technologies. Specifically, it relates to an image processing method, apparatus, computer-readable medium, and electronic device. Background Art
[0002] An image can be generated by superimposing multiple layers, and each layer can contain elements such as text or graphics. In current technical solutions, users can select and configure the layers in the image to obtain the required image, but the complex operations result in low image processing efficiency. Therefore, how to improve the processing speed of the layers of an image and thus ensure the image processing efficiency has become a technical problem to be urgently solved. Summary of the Invention
[0003] Embodiments of this application provide an image processing method, apparatus, computer-readable medium, and electronic device, which can at least to some extent improve the processing speed of the layers of an image and thus ensure the image processing efficiency.
[0004] Other features and advantages of this application will become apparent through the following detailed description, or will be partially learned through the practice of this application.
[0005] According to one aspect of the embodiments of this application, an image processing method is provided. The processing method includes:
[0006] Obtain an image to be processed, where the image to be processed includes at least two layers;
[0007] According to the position information of a target area on the image to be processed and the element position information on the at least two layers, identify a target layer from the at least two layers, where at least some elements on the target layer are located within the target area;
[0008] Split the image to be processed according to the target layer.
[0009] According to one aspect of the embodiments of this application, an image processing apparatus is provided. The processing apparatus includes:
[0010] An obtaining module, which obtains an image to be processed, where the image to be processed includes at least two layers;
[0011] A determining module, which, according to the position information of a target area on the image to be processed and the element position information on the at least two layers, identifies a target layer from the at least two layers, where at least some elements on the target layer are located within the target area;
[0012] A processing module, which splits the image to be processed according to the target layer.
[0013] Based on the foregoing solution, in some embodiments of the present application, the determining module is configured to: obtain the element coordinate information on the at least two layers; match the element coordinate information with the coordinate information of the target area, and identify the layer whose element coordinate information matches the coordinate information of the target area as the target layer.
[0014] Based on the foregoing solution, in some embodiments of the present application, the determining module is configured to: determine the element area range corresponding to each layer based on the element coordinate information on each layer; and determine the area range corresponding to the target area based on the coordinate information of the target area; then identify the layer whose element area range is within the area range corresponding to the target area as the target layer.
[0015] Based on the foregoing solution, in some embodiments of the present application, the determining module is configured to: determine, according to the element position information on the at least two layers, a specified layer in which at least some elements in the at least two layers are located within the target area and are in the topmost layer, and obtain the element coordinate information on the specified layer; based on the specified layer, traverse the layers below the specified layer, and obtain the element coordinate information on the layers below the specified layer.
[0016] Based on the foregoing solution, in some embodiments of the present application, the processing module is configured to: split the layers of the to-be-processed image according to the target layer to obtain a target layer set and a non-target layer set other than the target layer.
[0017] Based on the foregoing solution, in some embodiments of the present application, the processing module is further configured to: generate corresponding preview images and display them respectively according to the target layer set and the non-target layer set.
[0018] Based on the foregoing solution, in some embodiments of the present application, the processing module is further configured to: combine the layers included in the target layer set and hide the layers included in the non-target layer set to generate a first picture; or combine the layers included in the non-target layer set and hide the layers included in the target layer set to generate a second picture; or combine the layers included in the target layer set to generate a third target picture, and combine the layers included in the non-target layer set to generate a fourth picture.
[0019] Based on the foregoing solution, in some embodiments of the present application, the processing module is further configured to: generate a fifth picture according to the elements on the target layer that are within the target area.
[0020] Based on the foregoing solution, in some embodiments of the present application, the processing module is further configured to: obtain a set of layers to be combined; obtain identification information corresponding to a target combined layer according to request information for layer combination; based on the identification information corresponding to the target combined layer, obtain the target combined layer from the set of layers to be combined; combine the target combined layer to obtain a sixth picture.
[0021] Based on the foregoing solution, in some embodiments of the present application, the processing module is further configured to: obtain a set of target identification information according to the identification information corresponding to the target combined layer; match the identification information of the layers to be combined in the set of layers to be combined with the identification information in the set of target identification information, and determine that the layer to be combined whose identification information matches the identification information in the set of target identification information is the target combined layer.
[0022] Based on the foregoing solution, in some embodiments of the present application, the processing module is further configured to: modify the display state of the layers to be combined in the set of layers to be combined other than the target combined layer to a hidden state.
[0023] Based on the foregoing solution, in some embodiments of the present application, the processing module is further configured to: display a target area editing interface according to request information for splitting the image to be processed; determine the target area in the image to be processed according to the target area information detected in the target area editing interface.
[0024] Based on the foregoing solution, in some embodiments of the present application, the processing module is further configured to: obtain a file to be edited; parse the file to be edited to obtain the image to be processed.
[0025] According to one aspect of the embodiments of the present application, there is provided a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, the image processing method as described in the above embodiments is implemented.
[0026] According to one aspect of the embodiments of the present application, there is provided an electronic device, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in the above embodiments.
[0027] In the technical solutions provided by some embodiments of the present application, by obtaining an image to be processed, the image to be processed includes at least two layers, and according to the position information of the target area on the image to be processed and the element position information on the at least two layers, the target layer is identified from the at least two layers, at least some elements on the target layer are located within the target area, and then the image to be processed is automatically split according to the target layer. Thus, there is no need to manually select specific layers in the image for splitting, reducing the amount of manual operation and the operation difficulty, improving the processing efficiency of the layers of the image, and further improving the processing efficiency of the image.
[0028] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0030] In the drawings:
[0031] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied is shown;
[0032] Figure 2 A flowchart showing the processing method of an image according to an embodiment of the present application is shown;
[0033] Figure 3 A flowchart showing step S220 in the processing method of an image according to an embodiment of the present application is shown; Figure 2 of the processing method of an image is shown;
[0034] Figure 4 A flowchart showing step S320 in the processing method of an image according to an embodiment of the present application is shown; Figure 3 of the processing method of an image is shown;
[0035] Figure 5 A flowchart showing step S310 in the processing method of an image according to an embodiment of the present application is shown; Figure 3 of the processing method of an image is shown;
[0036] Figure 6 A flowchart showing the process of performing layer combination included in the processing method of an image according to an embodiment of the present application is shown;
[0037] Figure 7shows the flowchart of step S630 in the method for processing an image according to an embodiment of the present application; Figure 6 ;
[0038] Figure 8 shows the flowchart of obtaining a target area, which is further included in the method for processing an image according to an embodiment of the present application; Figure 2 ;
[0039] Figure 9 shows the flowchart of obtaining an image to be processed, which is further included in the method for processing an image according to an embodiment of the present application; Figure 2 ;
[0040] Figure 10 shows the flowchart of the method for processing an image according to an embodiment of the present application;
[0041] Figure 11 and Figure 12 shows the schematic diagram of a specific application scenario of the method for processing an image according to an embodiment of the present application;
[0042] Figure 13 shows the block diagram of an image processing apparatus according to an embodiment of the present application;
[0043] Figure 14 shows the schematic diagram of the structure of a computer system of an electronic device suitable for implementing the embodiments of the present application. Detailed implementation manners
[0044] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art.
[0045] In addition, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the present application.
[0046] The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0047] The flowcharts shown in the drawings are only exemplary illustrations, not necessarily including all content and operations / steps, nor necessarily executed in the described order. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined, so the actual execution order may change according to the actual situation.
[0048] Figure 1 The schematic diagram shows an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied.
[0049] As Figure 1 shown, the system architecture may include terminal devices (such as Figure 1 one or more of the smart phone 101, tablet computer 102, and portable computer 103 shown, and of course it can also be a desktop computer, etc.), network 104, and server 105. Network 104 is used to provide a medium for communication links between terminal devices and server 105. Network 104 can include various connection types, such as wired communication links, wireless communication links, etc.
[0050] It should be understood that Figure 1 the numbers of terminal devices, networks, and servers in
[0051] are only illustrative. According to implementation needs, there can be any number of terminal devices, networks, and servers. For example, server 105 can be a server cluster composed of multiple servers, etc.
[0052] It should be noted that the image processing method provided by the embodiments of the present application is generally executed by a terminal device. Correspondingly, the image processing apparatus is generally disposed in the terminal device. However, in other embodiments of the present application, the server 105 may also have a similar function to the server, so as to execute the solution of the image processing method provided by the embodiments of the present application.
[0053] The implementation details of the technical solutions of the embodiments of the present application are elaborated in detail below:
[0054] Figure 2 The flowchart of the image processing method according to an embodiment of the present application is shown. Refer to Figure 2 As shown, the image processing method at least includes steps S210 to S230, which are introduced in detail as follows:
[0055] In step S210, a to-be-processed image is obtained, and the to-be-processed image includes at least two layers.
[0056] Among them, the to-be-processed image may be an image including multiple layers, and each layer may have different elements such as text or graphics, and the multiple layers are superimposed to obtain the to-be-processed image.
[0057] In an embodiment of the present application, the to-be-processed image may be pre-stored in a database specified by the terminal device or the server, such as a to-be-processed image database. The user can obtain the to-be-processed image by browsing the data stored in the database specified by the terminal device or the server.
[0058] In another embodiment of the present application, the to-be-processed image may also be uploaded by the user to the terminal device or the server during processing. Specifically, the user can trigger a specific area on the interface (such as clicking the "upload" button on the interface) to display a file upload interface. The user can determine the to-be-processed image to be uploaded through the file upload interface. For example, paste the to-be-processed image file into the file upload interface, or browse the storage space of the terminal device or the server through the file upload interface to select the to-be-processed image file to be uploaded, and so on.
[0059] It should be noted that the method for obtaining the to-be-processed image in the present application is not limited to the above-mentioned obtaining methods. According to actual implementation requirements, there may be other obtaining methods, and the present application does not make special limitations on this.
[0060] In step S220, according to the position information of the target area on the to-be-processed image and the element position information on the at least two layers, the target layer is identified from the at least two layers, and at least part of the elements on the target layer are located within the target area.
[0061] Among them, the target area can be the area on the image to be processed that needs to be processed. It should be understood that the target area can be located at any position on the image to be processed that needs to be processed. For example, it can be at the upper part, lower part, or middle part of the image to be processed, etc. It should be noted that in one example, the target area can be an area with a regular shape, such as a rectangle, circle, or square, etc.; in another example, the target area can also be an area with an irregular shape, such as a polygon, etc. This application does not make special limitations on this.
[0062] The element position information can be the information used to represent the position of the element relative to the image to be processed. For example, the element position information can be coordinate information or orientation information relative to the image to be processed, etc. It should be understood that the element position information should be determined relative to the image to be processed for subsequent processing.
[0063] In an embodiment of this application, the target area on the image to be processed can be determined manually according to actual usage requirements. For example, the user can define a certain area in the image to be processed as the target area, or can also determine the target area by selecting a predetermined position. For example, select the upper half, lower half, left half, or right half of the image to be processed as the target area, etc.
[0064] In step S220, according to the position information of the target area on the image to be processed and the element position information on the layer included in the image to be processed, the relative relationship between the position of the element and the target area can be determined. For example, whether there is an overlap between the two, whether the element is within the target area, or whether the element is outside the target area, etc. Thus, at least some target layers with elements located within the target area can be identified from the layers included in the image to be processed.
[0065] It should be noted that at least some elements on the target layer being within the target area can mean that some elements are within the target area or all elements are within the target area. In one example of this application, a layer with all elements on the layer being within the target area can be used as the target layer; in another example of this application, a layer with some elements on the layer being within the target area can also be used as the target layer. Those skilled in the art can configure it according to actual implementation needs. This application does not make special limitations on this.
[0066] In step S230, the image to be processed is split according to the target layer.
[0067] Among them, splitting can be classifying the layers of the image to be processed to divide the layers included in the image to be processed into different categories.
[0068] In this embodiment, according to the determined target layer, the layers included in the to-be-processed image can be divided, for example, they can be divided into target layers and non-target layers, etc. Specifically, according to the identification information of the target layer (such as layer name or layer number, etc.) and the identification information of the layers included in the to-be-processed image, the layers with the same identification information can be determined as target layers, and the layers with different identification information can be determined as non-target layers.
[0069] exist Figure 2 In the embodiment shown, by acquiring an image to be processed, the image to be processed includes at least two layers, and according to the position information of the target area on the image to be processed and the element position information on the at least two layers, a target layer in which at least some elements are located in the target area is identified, so that the image to be processed is split according to the target layer. Thus, the user can limit the target area in the image to be processed according to actual needs to acquire the target layer and automatically split the image, and the operation is intuitive and convenient, and there is no need to manually select the layer of the image to be processed, which reduces the workload and difficulty of manual operation, improves the processing speed of the image layer, and thus improves the image processing efficiency.
[0070] based on Figure 2 The embodiment shown, Figure 3 An embodiment according to the present application is shown. Figure 2 Schematic diagram of the process of step S220 in the method for processing an image. Figure 3 As shown, step S220 at least includes steps S310 to S320, which are described in detail as follows:
[0071] In step S310, coordinate information of elements on the at least two layers is obtained.
[0072] Among them, the element coordinate information can be the coordinate information representing the position of the element on the image to be processed. In one example, the element coordinate information can be the coordinate information of the element of the layer on the image to be processed, such as the coordinates of each point in the element, etc.; in another example, the element coordinate information can also be the coordinates of the extreme points of the element in the layer, such as the coordinates of the points with the smallest and largest horizontal coordinates, the coordinates of the points with the largest and smallest vertical coordinates, etc. According to the coordinates of the extreme points of the element, the position and coverage of the element in the image to be processed can be determined. Therefore, it can be understood that the element coordinate information can be any form of coordinate data that can be used to represent the position and coverage of the element on the image to be processed. Those skilled in the art can select the corresponding form of element coordinate information according to the actual implementation needs, and this application does not make any special restrictions on this.
[0073] In this embodiment, the element coordinate information of each element may be included in each layer, and the element coordinate information may be associated with each layer in the form of data. During actual use, the element coordinate information associated with the layer may be obtained according to the identification information of each layer (such as layer name or layer number, etc.).
[0074] In step S320, the element coordinate information is matched with the coordinate information of the target area, and the layer whose element coordinate information matches the coordinate information of the target area is identified as the target layer.
[0075] In this embodiment, according to the obtained element coordinate information, it can be matched with the coordinate information of the target area to determine whether the element is located within the target area. If the element is located within the target area, it can be determined that the element coordinate information of the element matches the coordinate information of the target area, and the layer whose element coordinate information matches the coordinate information of the target area is determined as the target layer.
[0076] In Figure 3 In the shown embodiment, by matching the element coordinate information with the coordinate information of the target area, it can be accurately determined whether the element is located within the target area, so as to identify the target layer from the layers included in the image to be processed, ensuring the accuracy rate of identifying the target layer.
[0077] Based on Figure 2 and Figure 3 the shown embodiment, Figure 4 shows the flow diagram of step S320 in the image processing method according to an embodiment of the present application. Figure 3 Referring to Figure 3 shown, this step S320 at least includes steps S410 to S430, which are introduced in detail as follows:
[0078] In step S410, based on the element coordinate information on each layer, the element area range corresponding to each layer is determined.
[0079] In this embodiment, according to the obtained element coordinate information on the layer, the element area range of all elements in the layer in the image to be processed can be determined. Specifically, according to the element coordinate information, the minimum value of the abscissa and the minimum value of the ordinate in the element coordinate information can be combined to obtain the starting coordinates of the element area range corresponding to the layer. For example, if the minimum value of the abscissa in the element coordinate information is 4 and the minimum value of the ordinate is 8, then the starting coordinates of the layer are (4, 8), and so on. And the width of the element area range corresponding to the layer is obtained according to the maximum value of the abscissa in the element coordinate information, that is, the maximum value of the abscissa in the element coordinate information can be subtracted from the minimum value of the abscissa to obtain the width; according to the maximum value of the ordinate in the element coordinate information, the height of the element area range corresponding to the layer is obtained, that is, the maximum value of the ordinate in the element coordinate information is subtracted from the minimum value of the ordinate to obtain the height of the corresponding area range of the layer. Thus, according to the coordinate origin, width, and height, the element area range corresponding to the layer can be obtained.
[0080] In step S420, based on the coordinate information of the target area, determine the area range corresponding to the target area.
[0081] In this embodiment, according to the coordinate information of the target area, the starting coordinates, width, and height of the target area can be obtained to obtain the area range corresponding to the target area. Among them, the calculation methods of the starting coordinates, width, and height of the target area are as described above and will not be elaborated here.
[0082] In step S430, identify the layer whose element area range is within the area range corresponding to the target area as the target layer.
[0083] In this embodiment, according to the obtained element area range corresponding to the layer and the area range corresponding to the target area, compare the element area range corresponding to each layer with the area range corresponding to the target area. If the element area range corresponding to the layer is within the area range corresponding to the target area, then determine that this layer is the target layer.
[0084] Specifically, the starting coordinates, width, and height of the two can be compared to determine whether the element area range corresponding to the layer is within the area range corresponding to the target area. Let the starting coordinates of the element area range corresponding to the layer be (x 1 , y 1 ), the width be w 1 , the height be h 1 , and the starting coordinates of the area range corresponding to the target area be (x 0 , y 0 ), the width be w 0 , the height be h 0 . If x 0<x 1 ,y 0 <y 1 ,x 0 +w 0 >x 1 +w 1 and y 0 +h 0 >y 1 +h 1 If so, it means that the element area range corresponding to this layer is within the area range corresponding to the target layer, and it can be determined that this layer is the target layer.
[0085] In other embodiments of the present application, it is also possible to compare the maximum and minimum values in the element coordinate information of the layer with the maximum and minimum values in the coordinate information of the target area to determine whether the element area range corresponding to the layer matches the area range of the target area. Of course, in the actual implementation process, there can also be other matching schemes, and the present application does not make special limitations on this.
[0086] It can be understood that for a layer whose element area range is within the area range corresponding to the target area, it can be that the element area range corresponding to a certain element on this layer is within the area range corresponding to the target area, or it can be that the element area ranges corresponding to all elements on this layer are all within the area range corresponding to the target area. Thus, when splitting the image to be processed subsequently, it is convenient for the user to obtain the elements contained in the target area. Those skilled in the art can configure according to actual implementation needs, and the present application does not make special limitations on this.
[0087] In Figure 4 the shown embodiment, according to the element coordinate information on the layer and the coordinate information of the target area, the element area range corresponding to the layer and the area range corresponding to the target area are respectively determined, and the element area range corresponding to each layer is compared with the area range corresponding to the target area to identify the target layer whose element area range is within the area range corresponding to the target area from them. By comparing the element area range corresponding to the layer with the area range corresponding to the target area, the target layer can be accurately identified, improving the accuracy of target layer identification to ensure the subsequent splitting effect.
[0088] Based on Figure 2 and Figure 3 the shown embodiments, Figure 5 shows a Figure 3 flow schematic diagram of step S310 in the image processing method according to an embodiment of the present application. Referring to Figure 5 shown, this step S310 at least includes steps S510 to S520, which are introduced in detail as follows:
[0089] In step S510, based on the element position information on the at least two layers, determine the specified layer among the at least two layers where at least some elements are located within the target area and are on the topmost layer, and obtain the element coordinate information on the specified layer.
[0090] In this embodiment, based on the element position information on the layers of the image to be processed, it can be determined that at least some elements in the layers included in the image to be processed are located within the target area and are on the topmost specified layer. In actual process, the layers that have a boundary with the target area can be identified in advance based on the element position information on the layers, that is, at least some elements on this layer overlap with the target area. Then, based on the layers that have a boundary with the target area and the hierarchical relationship of each layer, the topmost layer among them is used as the specified layer, and the element coordinate information on this specified layer is obtained.
[0091] In step S520, based on the specified layer, traverse the layers below the specified layer, and obtain the element coordinate information on the layers below the specified layer.
[0092] In this embodiment, based on the determined specified layer, traverse all the layers below the specified layer, and obtain the element coordinate information on all the layers below the specified layer.
[0093] In Figure 5 In the shown embodiment, based on the pre-determined specified layer, obtain the element coordinate information on this specified layer, and then based on this specified layer and the hierarchical relationship of each layer, traverse all the layers below this specified layer, and obtain the element coordinate information on all the layers below this specified layer. Thus, it can be avoided to obtain the element coordinate information of all the layers in the image to be processed for subsequent matching calculations, reducing the amount of calculation, and thereby improving the recognition efficiency of the target layer.
[0094] Based on Figure 2 In the shown embodiment, in an embodiment of the present application, splitting the image to be processed according to the target layer includes:
[0095] Split the layers of the image to be processed according to the target layer to obtain a target layer set and a non-target layer set except the target layer.
[0096] In this embodiment, based on the determined target layer, split the layers included in the image to be processed, and divide the layers included in this image to be processed into a target layer and non-target layers, so as to obtain a target layer set and a non-target layer set.
[0097] In an embodiment of the present application, a type identifier may be added to the layers included in the image to be processed to distinguish whether the layer is a target layer or a non-target layer. It should be noted that the type identifier may be a letter identifier (for example, the letter "A" represents the target layer, the letter "B" represents the non-target layer, etc.), and the type identifier may also be a digital identifier (for example, the number "1" represents the target layer, the number "2" represents the non-target layer), etc. The present application does not make special limitations on this.
[0098] According to the type identifier of each layer, the identification information of the layers can be stored in different sets according to the corresponding type identifiers, that is, the elements in the target layer set are the identification information of the layers with the type identifier of the target layer, and the elements in the non-target layer set are the identification information of the layers with the type identifier of the non-target layer, so as to achieve the purpose of splitting all the layers of the image to be processed.
[0099] In this embodiment, the layers included in the image to be processed can be automatically split according to the determined target layer, without manual confirmation and selection one by one, reducing the amount of manual operation, and thus improving the efficiency of image processing.
[0100] Based on the foregoing embodiment, in an embodiment of the present application, the method for processing the image further includes:
[0101] Generate corresponding preview images according to the target layer set and the non-target layer set respectively and display them.
[0102] In this embodiment, preview images corresponding to the two sets can be generated according to the layers in the target layer set and the layers in the non-target layer set. Specifically, the corresponding preview images can be generated by modifying the display state of the layers. For example, to generate the preview image corresponding to the target layer set, the display state of the layers belonging to the non-target layer set can be modified to the hidden state, so as to achieve the purpose of not displaying the layers in the non-target layer set, thereby obtaining the preview image corresponding to the target layer set, and so on.
[0103] In this embodiment, generating corresponding preview images according to the split target layer set and non-target layer set and displaying them respectively enables the user to intuitively know whether the splitting of the layers is actually required and correct, facilitating the user to change and confirm the splitting result in a timely manner, and ensuring the accuracy of the splitting result.
[0104] Based on the foregoing embodiment, in some embodiments of the present application, the method for processing the image further includes:
[0105] Combine the layers included in the target layer set and hide the layers included in the non-target layer set to generate a first picture; or
[0106] Combine the layers included in the non-target layer set and hide the layers included in the target layer set to generate a second picture; or
[0107] Combine the layers included in the target layer set to generate a third picture, and
[0108] Combine the layers included in the non-target layer set to generate a fourth picture.
[0109] In this embodiment, according to the layers included in the target layer set and the layers included in the non-target layer set, combine the layers to generate a first picture corresponding to the target layer set and a second picture corresponding to the non-target layer set, which can improve the applicable range of this processing method. For example, if the user wants to obtain a picture within the target area, a first picture can be generated correspondingly to obtain the picture composed of the layers within the target area. If the user wants to obtain a picture outside the target area, a second picture can be generated correspondingly. Also, if the user needs to split the layers within the target area from the layers outside the target area, a third picture and a fourth picture can be generated respectively to obtain the split pictures, and so on. Thus, different usage requirements of the user can be satisfied, and further the usage range of the image processing method of the present application is improved.
[0110] Moreover, when combining multiple layers to generate the first picture, the second picture, or the third picture and the fourth picture, when calling the image subsequently, such as for web display, etc., there is no need to call multiple layers. Only the corresponding first picture, second picture, or third picture and fourth picture need to be called, reducing the layer call request information, facilitating implementation and occupying less storage space.
[0111] Based on Figure 2 the embodiment shown, in an embodiment of the present application, this image processing method further includes:
[0112] Generate a fifth picture according to the elements on the target layer that are within the target area.
[0113] In this embodiment, according to the element position information on each layer and the position information of the target area, determine the elements on each layer that are within the target area, and then split and recombine the elements on each layer that are within the target area from the layer, and then generate a fifth picture. Thus, the user can obtain the elements within the target area and generate a fifth picture without having to redraw, improving the image processing efficiency.
[0114] It should be noted that the elements within the target area can be such that a part of the element is within the target area or the whole element is within the target area. Those skilled in the art can screen according to actual implementation needs, and the present application does not make special limitations on this.
[0115] Based on Figure 2 the illustrated embodiment Figure 6 FIG. shows a schematic flowchart of performing layer combination included in a method for processing an image according to an embodiment of the present application. Referring to Figure 6 as shown, performing layer combination includes at least steps S610 to S640, which are introduced in detail as follows:
[0116] In step S610, obtain a set of layers to be combined.
[0117] Among them, the set of layers to be combined may be a set of all layers in the image to be processed.
[0118] In this embodiment, the image to be processed can be parsed in advance to obtain the layers included in the image to be processed, so as to form the set of layers to be combined.
[0119] In step S620, according to the request information for performing layer combination, obtain the identification information corresponding to the target combined layer.
[0120] Among them, the request information for performing layer combination may be information for requesting layer combination. According to actual usage requirements, the user can send request information for performing layer combination to the terminal device by triggering a specific area on the interface (such as a button of "layer combination", etc.).
[0121] In this embodiment, when receiving the request information for performing layer combination, obtain the identification information of the target combined layer that the user wants to combine. Specifically, the terminal device can display the identification information of the layers to be combined in the set of layers to be combined on the interface, for example, in the form of a drop-down list. It should be noted that the identification information may be information uniquely determined with the layer to be combined, and according to this identification information, the layer to be combined corresponding to this identification information can be determined accordingly.
[0122] The user can select the layer corresponding to the identification information as the target combined layer by browsing the identification information. The terminal device obtains the identification information corresponding to the target combined layer according to the user's selection (such as checking or clicking the corresponding identification information, etc.).
[0123] In step S630, based on the identification information of the target combined layer, obtain the target combined layer from the set of layers to be combined.
[0124] In this embodiment, according to the obtained identification information of the target combined layer, the identification information can be matched with the layers to be combined in the set of layers to be combined, so as to determine the layer to be combined corresponding to this identification information in the set of layers to be combined as the target combined layer, and obtain the target combined layer.
[0125] In step S640, the target combined layer is combined to obtain the sixth picture.
[0126] In Figure 6 In the illustrated embodiment, by obtaining the identification information of the target combined layer, retrieving the corresponding target combined layer from the layers to be combined according to the identification information, and then automatically generating the sixth picture by combining the target combined layer, the user can select the corresponding layer in the image to be processed according to actual usage needs to generate the actually required sixth picture. Thus, it is convenient for the user to process the layers in the image to be processed, improving the efficiency of image processing.
[0127] Based on Figure 2 and Figure 6 the illustrated embodiment, Figure 7 shows a schematic flowchart of step S630 in the method for processing an image according to an embodiment of the present application. Referring to Figure 6 as shown in Figure 6 , this step S630 at least includes steps S710 to S720, which are introduced in detail as follows:
[0128] In step S710, according to the identification information corresponding to the target combined layer, a set of target identification information is obtained.
[0129] In this embodiment, according to the obtained identification information corresponding to the target combined layer, the identification information can be integrated to obtain a set of target identification information, which contains the identification information of all target combined layers.
[0130] In step S720, the identification information of the layers to be combined in the set of layers to be combined is matched with the identification information in the set of target identification information, and the layer to be combined whose identification information matches the identification information in the set of target identification information is determined as the target combined layer.
[0131] In this step, the identification information of the layers to be combined in the set of layers to be combined can be matched one by one with the identification information in the set of target identification information. If the two pieces of identification information are the same, it is determined that this layer to be combined is the target combined layer that the user desires to combine the layers, and the target combined layer is retrieved from the set of layers to be combined.
[0132] In Figure 7 the illustrated embodiment, by comparing the set of target identification information with the identification information of the layers to be combined in the set of layers to be combined, the target combined layer in the set of layers to be combined is determined. The target combined layer can be accurately identified from the layers to be combined, preventing misidentification of the target combined layer, ensuring the accuracy rate of identifying the target combined layer, and further ensuring the combination effect of subsequent layer combination.
[0133] Based on the foregoing embodiments, in an embodiment of the present application, the processing method further includes:
[0134] Modify the display state of the layers to be combined in the set of layers to be combined except the target combined layer to a hidden state.
[0135] In this embodiment, modifying the display state of the layers to be combined in the set of layers to be combined except the target combined layer to a hidden state can obtain a preview image after layer combination when displaying the image to be processed. The user can determine whether the layer combination is correct according to this preview image. If it is incorrect, corresponding editing can be performed, such as adding a certain target combined layer or removing a certain target combined layer, etc. This avoids the situation where the sixth picture needs to be generated repeatedly multiple times if an error occurs, and improves the image processing efficiency.
[0136] Based on Figure 2 the embodiments shown, Figure 8 shows a schematic flow diagram of obtaining a target area included in the image processing method according to an embodiment of the present application. Referring to Figure 2 shown, obtaining the target area includes at least steps S810 to S820, which are introduced in detail as follows: Figure 8
[0137] In step S810, according to the request information for splitting the image to be processed, display a target area editing interface.
[0138] Among them, the request information for splitting the image to be processed may be information for requesting to split the layers of the image to be processed. If the user needs to split the layers of the image to be processed, in one example, the user can send the request information for splitting the image to be processed by triggering a specific area on the interface (such as clicking the "layer splitting" button, etc.); in another example, the user can also trigger the corresponding physical button through an input device configured on the terminal device (such as a keyboard or a mouse, etc.) to send the request information for splitting the image to be processed. The present application does not make special limitations on this.
[0139] The target area editing interface can be an interface for editing the target area. When receiving a request message for splitting the image to be processed, the target area editing interface can be displayed on the interface for the user to edit. In one example, the target area editing interface can pre-provide a bounding box, and the user can determine the target area by adjusting the position and size of the bounding box on the image to be processed; in another example, the target area editing interface can also determine the target area according to the movement trajectory of the user input device. For example, the user can draw a corresponding area in the image to be processed with a mouse as the target area, etc. This application does not make special limitations on this.
[0140] In step S820, according to the target area information detected in the target area editing interface, determine the target area in the image to be processed.
[0141] Among them, the target area information can be the position information indicating the target area in the image to be processed. According to this target area information, the specific position of the target area in the image to be processed can be correspondingly determined.
[0142] In this embodiment, the target area editing interface can obtain the target area information input by the user, such as the size and coordinates of the bounding box or the coordinates of the trajectory of the mouse movement, etc. The terminal device can then determine the specific position of the target area in the image to be processed according to this target area information.
[0143] In Figure 8 In the shown embodiment, through the setting of the target area editing interface, the user can determine the corresponding target area according to the actual usage requirements, so as to split the layers within the target area. The operation is simple and intuitive. The user can accurately adjust the position and size of the target area, which conforms to the user's usage habits and improves the efficiency of determining the target area.
[0144] In the Figure 2 shown embodiment, Figure 9 shows a schematic flow chart of obtaining the image to be processed included in the image processing method according to an embodiment of the present application. Referring to Figure 2 shown, obtaining the image to be processed at least includes step S910 to step S920, which are introduced in detail as follows: Figure 9 shown, obtaining the image to be processed at least includes step S910 to step S920, which are introduced in detail as follows:
[0145] In step S910, obtain the file to be edited;
[0146] Among them, the file to be edited can be an image file that needs to be processed. For example, the file to be edited can be a drawing created by a drafter or an engineering drawing designed by an engineer, etc.
[0147] In one embodiment of the present application, the file to be edited may be a file stored in a terminal device or a server, and the file to be edited can be obtained by reading the file stored in the terminal device or the server.
[0148] In step S920, the file to be edited is parsed to obtain the image to be processed.
[0149] In this embodiment, according to the obtained file to be edited, the file to be edited can be parsed to obtain the image information of the file to be edited. For example, the image information may include, but is not limited to, the layer information contained in the file to be edited and the element coordinate information on each layer, etc. Based on the parsing result, the file to be edited can be displayed on the interface as the image to be processed.
[0150] In Figure 9 In the shown embodiment, by obtaining the file to be edited and parsing the file to be edited to generate the image to be processed, the user can process the file they want to edit, improving the applicable range of the image processing method and facilitating the user's use.
[0151] Based on the technical solution of the above embodiment, the following introduces a specific application scenario of the embodiment of the present application:
[0152] Figure 10 shows a schematic flowchart of a method for processing an image according to an embodiment of the present application. Referring to Figure 10 As shown, the method for processing the image at least includes steps S1010 to step S1100, which are introduced in detail as follows:
[0153] In step S1010, an image to be processed is obtained.
[0154] Among them, the image to be processed includes at least two layers, which can be obtained by parsing the file that the user wants to edit. For example, the file can be a drawing of a painter or an engineering drawing of an engineer, etc.
[0155] In step S1020, a combined layer or a split layer is determined.
[0156] In this step, according to the received command request, it can be determined whether to combine layers or split layers. For example, if a request message for layer combination is received, it means an operation of combining layers is to be performed. If a request message for splitting the image to be processed is received, it means an operation of splitting layers is to be performed. If the operation of combining layers is performed, step S1080 is entered. If the operation of splitting layers is performed, step S1030 is entered.
[0157] In step S1030, a target area is determined.
[0158] In this step, if a request to split the image to be processed is received, a target area editing interface can be displayed on the interface, and the target area can be determined according to the target area information detected by the target area editing interface.
[0159] In step S1040, the target layer is determined according to the position information of the target area and the position information of the elements on the layer of the image to be processed.
[0160] In this step, according to the position information of the elements on the layer, it can be determined whether at least part of the elements on the layer are located within the target area. If so, the layer is determined as the target layer.
[0161] In step S1050, the image to be processed is split according to the target layer, and a target layer set and a non-target layer set are obtained.
[0162] In step S1060, a first picture is generated according to the target layers included in the target layer set.
[0163] In step S1070, a second picture is generated according to the non-target layers included in the non-target layer set.
[0164] In step S1080, the identification information of the target combined layer is obtained.
[0165] In this step, according to the request information for layer combination, the identification information corresponding to the target combined layer is obtained. Specifically, the user can browse the identification information and select the layer corresponding to the identification information as the target combined layer. The terminal device obtains the identification information corresponding to the target combined layer according to the user's selection (such as checking or clicking on the corresponding identification information, etc.).
[0166] In step S1090, the target combined layer is obtained according to the identification information of the target combined layer.
[0167] In this step, according to the obtained identification information of the target combined layer, the layer in the image to be processed whose identification information matches the identification information of the target combined layer is obtained as the target combined layer.
[0168] In step S1100, the target combined layer is combined to obtain a sixth picture.
[0169] In Figure 10 In the illustrated embodiment, the user can select a combined layer or a split layer according to actual usage requirements, and obtain the layer to be split or combined as required by the user, so as to automatically generate the required target picture. Thus, the manual operation amount and operation difficulty are greatly reduced, the processing speed of the layers of the image is improved, and the image processing efficiency is further improved.
[0170] Figure 11 and Figure 12 The figure shows a schematic diagram of a specific application scenario of a method for processing an image according to an embodiment of the present application (hereinafter, the to-be-processed image A is taken as an example for explanation).
[0171] As Figure 11 shown, the to-be-processed image A is obtained. The user can define a target area 1110 in the to-be-processed image A according to actual usage requirements. The terminal device can determine the target layer based on the target area and the position information of the elements on the layer in the to-be-processed image (hereinafter, it is described by taking the example that all elements on the target layer are within the target area). In the to-be-processed image A, although the area range of the iron tower has a boundary with the target area 1110, it is not completely within the target area. Therefore, the layer where the iron tower is located is not the target layer.
[0172] There is no boundary between the moon and the clouds on the left side in the to-be-processed image A and the target area 1110. Therefore, the layers where the moon and the clouds on the left side in the to-be-processed image are located are not the target layers either. Only the clouds on the right side in the to-be-processed image A are completely within the target area 1110. Therefore, the layer where the clouds are located is the target layer. According to the identified target layer, the to-be-processed image A is split to obtain the first picture B and the second picture C.
[0173] Thus, the user can split the to-be-processed image by defining the target area to obtain the required target picture. The operation is simple, which reduces the trouble for the user to select the specific layer to be split, and thus improves the image processing efficiency.
[0174] As Figure 12 shown, when the user needs to perform layer combination, the target combination layers can be selected from the set of layers to be combined. For example, the layer D and the layer E in Figure 12 are selected as the target combination layers. The terminal device combines the layer D and the layer E based on the command for layer combination and the relevant information of the layers, such as the element coordinate information on the layer, etc., to obtain the required picture, as shown by the image F in Figure 12 .
[0175] Thus, the user can select the layers to be combined in the set of layers to be combined as the target combination layers and perform combination according to actual usage requirements, which facilitates the user's operation on the image, enables the user to quickly obtain the required combined picture, and improves the image processing efficiency.
[0176] The following introduces the device embodiment of the present application, which can be used to execute the method for processing an image in the above embodiments of the present application. For the details not disclosed in the device embodiment of the present application, please refer to the embodiments of the method for processing an image in the above of the present application.
[0177] Figure 13 The block diagram of a processing device for an image according to an embodiment of the present application is shown.
[0178] Referring to Figure 13 As shown, a processing device for an image according to an embodiment of the present application includes:
[0179] An acquisition module 1310 that acquires an image to be processed, where the image to be processed includes at least two layers;
[0180] A determination module 1320 that, based on the position information of a target area on the image to be processed and the element position information on the at least two layers, identifies a target layer from the at least two layers, and at least some elements on the target layer are located within the target area;
[0181] A processing module 1330 that splits the image to be processed according to the target layer.
[0182] Based on the foregoing solution, in some embodiments of the present application, the determination module 1320 is configured to: acquire the element coordinate information on the at least two layers; match the element coordinate information with the coordinate information of the target area, and identify the layer whose element coordinate information matches the coordinate information of the target area as the target layer.
[0183] Based on the foregoing solution, in some embodiments of the present application, the determination module 1320 is configured to: determine the element area range corresponding to each layer based on the element coordinate information on each layer; determine the area range corresponding to the target area based on the coordinate information of the target area; and identify the layer whose element area range is within the area range corresponding to the target area as the target layer.
[0184] Based on the foregoing solution, in some embodiments of the present application, the determination module 1320 is configured to: determine a specified layer in which at least some elements in the at least two layers are located within the target area and are in the topmost layer based on the element position information on the at least two layers, and acquire the element coordinate information on the specified layer; traverse the layers below the specified layer based on the specified layer, and acquire the element coordinate information on the layers below the specified layer.
[0185] Based on the foregoing solution, in some embodiments of the present application, the processing module 1330 is configured to: split the layers of the image to be processed according to the target layer to obtain a target layer set and a non-target layer set other than the target layer.
[0186] Based on the foregoing solution, in some embodiments of the present application, the processing module 1330 is further configured to: generate corresponding preview images according to the target layer set and the non-target layer set respectively and display them.
[0187] Based on the foregoing solution, in some embodiments of the present application, the processing module 1330 is further configured to: combine the layers included in the target layer set and hide the layers included in the non-target layer set to generate a first picture; or combine the layers included in the non-target layer set and hide the layers included in the target layer set to generate a second picture; or combine the layers included in the target layer set to generate a third picture and combine the layers included in the non-target layer set to generate a fourth picture.
[0188] Based on the foregoing solution, in some embodiments of the present application, the processing module 1330 is further configured to: generate a fifth picture according to the elements located within the target area on the target layer.
[0189] Based on the foregoing solution, in some embodiments of the present application, the processing module 1330 is further configured to: obtain a set of layers to be combined; obtain identification information corresponding to a target combined layer according to request information for layer combination; based on the identification information corresponding to the target combined layer, obtain the target combined layer from the set of layers to be combined; and combine the target combined layer to obtain a sixth picture.
[0190] Based on the foregoing solution, in some embodiments of the present application, the processing module 1330 is further configured to: obtain a set of target identification information according to the identification information corresponding to the target combined layer; match the identification information of the layers to be combined in the set of layers to be combined with the identification information in the set of target identification information, and determine that the layer to be combined whose identification information matches the identification information in the set of target identification information is the target combined layer.
[0191] Based on the foregoing solution, in some embodiments of the present application, the processing module 1330 is further configured to: modify the display state of the layers to be combined in the set of layers to be combined except the target combined layer to a hidden state.
[0192] Based on the foregoing solution, in some embodiments of the present application, the processing module 1330 is further configured to: display a target area editing interface according to request information for splitting the image to be processed; and determine the target area in the image to be processed according to the target area information detected in the target area editing interface.
[0193] Based on the foregoing solution, in some embodiments of the present application, the processing module 1330 is further configured to: obtain a file to be edited; parse the file to be edited to obtain the image to be processed.
[0194] Figure 14 FIG. shows a schematic structural diagram of a computer system of an electronic device suitable for implementing embodiments of the present application.
[0195] It should be noted that Figure 14 the computer system of the electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0196] As Figure 14 shown, the computer system includes a central processing unit (CPU) 1401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1402 or the program loaded from the storage section 1408 into the random access memory (RAM) 1403, such as executing the method described in the above embodiments. In the RAM 1403, various programs and data required for system operation are also stored. The CPU 1401, ROM 1402, and RAM 1403 are connected to each other via a bus 1404. The input / output (I / O) interface 1405 is also connected to the bus 1404.
[0197] The following components are connected to the I / O interface 1405: an input section 1406 including a keyboard, a mouse, etc.; an output section 1407 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the I / O interface 1405 as needed. A removable medium 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1410 as needed so that a computer program read from it can be installed into the storage section 1408 as needed.
[0198] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 1409, and / or installed from the removable medium 1411. When the computer program is executed by the central processing unit (CPU) 1401, various functions defined in the system of the present application are executed.
[0199] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a 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 above. In the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program included on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0200] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0201] The units involved in the embodiments described in the present application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation on the units themselves in some cases.
[0202] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the methods described in the above embodiments.
[0203] It should be noted that although several modules or units of devices for performing actions are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0204] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described here can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (such as a personal computer, a server, a touch terminal, or a network device, etc.) to execute the methods according to the embodiments of the present application.
[0205] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include the common general knowledge or conventional technical means in the technical field not disclosed in the present application.
[0206] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A method for processing an image, characterized in that, comprising: obtaining an image to be processed, where the image to be processed includes at least two layers; determining, according to the element position information on the at least two layers, at least some elements in the at least two layers that are located within a target area on the image to be processed and are in a specified layer at the topmost layer, and obtaining the element coordinate information on the specified layer; traversing the layers below the specified layer based on the specified layer, and obtaining the element coordinate information on the layers below the specified layer; matching the element coordinate information with the coordinate information of the target area, and identifying the layer whose element coordinate information matches the coordinate information of the target area as the target layer, where at least some elements on the target layer are located within the target area; splitting the image to be processed into different layers according to the target layer.
2. The processing method according to claim 1, characterized in that, matching the element coordinate information with the coordinate information of the target area, and identifying the layer whose element coordinate information matches the coordinate information of the target area as the target layer, includes: determining the element area range corresponding to each layer based on the element coordinate information on each layer; determining the area range corresponding to the target area based on the coordinate information of the target area; identifying the layer whose element area range is within the area range corresponding to the target area as the target layer.
3. The processing method according to claim 1, characterized in that, splitting the image to be processed into different layers according to the target layer, includes: splitting the layers of the image to be processed according to the target layer, to obtain a target layer set and a non-target layer set other than the target layer.
4. The processing method according to claim 3, characterized in that, the processing method further includes: combining the layers included in the target layer set, and hiding the layers included in the non-target layer set, to generate a first picture; or combining the layers included in the non-target layer set, and hiding the layers included in the target layer set, to generate a second picture; or combining the layers included in the target layer set to generate a third picture, and combining the layers included in the non-target layer set to generate a fourth picture.
5. The processing method according to claim 1, characterized in that, the processing method further includes: generating a fifth picture according to the elements on the target layer that are located within the target area.
6. The processing method according to claim 1, characterized in that, the processing method further includes: obtaining a set of layers to be combined; obtaining the identification information corresponding to the target combined layer according to the request information for layer combination; obtaining the target combined layer from the set of layers to be combined based on the identification information corresponding to the target combined layer; combining the target combined layer to obtain a sixth picture.
7. The processing method according to claim 6, characterized in that, Obtaining the target combined layer from the set of layers to be combined based on the identification information corresponding to the target combined layer includes: Obtaining a target identification information set according to the identification information corresponding to the target combined layer; Matching the identification information of the layers to be combined in the set of layers to be combined with the identification information in the target identification information set, and determining that the layer to be combined whose identification information matches the identification information in the target identification information set is the target combined layer.
8. The processing method according to claim 6, wherein, the processing method further includes: Modifying the display state of the layers to be combined in the set of layers to be combined other than the target combined layer to a hidden state.
9. The processing method of an image according to claim 1, wherein, the processing method further includes: Displaying a target area editing interface according to the request information for splitting the image to be processed into different layers; Determining the target area in the image to be processed according to the target area information detected in the target area editing interface.
10. The processing method according to claim 1, wherein, obtaining the image to be processed includes: Obtaining a file to be edited; Parsing the file to be edited to obtain the image to be processed.
11. An image processing apparatus, wherein, it includes: An obtaining module for obtaining an image to be processed, where the image to be processed includes at least two layers; A determining module for determining a specified layer that is at the topmost layer and at least part of whose elements are located within a target area on the image to be processed according to the element position information on the at least two layers, and obtaining the element coordinate information on the specified layer; Based on the specified layer, traversing the layers below the specified layer, and obtaining the element coordinate information on the layers below the specified layer; matching the element coordinate information with the coordinate information of the target area, and identifying the layer whose element coordinate information matches the coordinate information of the target area as the target layer, and at least part of the elements on the target layer are located within the target area; A processing module for splitting the image to be processed into different layers according to the target layer.
12. The processing apparatus according to claim 11, wherein, the determining module is configured to: Determine the element area range corresponding to each layer based on the element coordinate information on each layer; Determine the area range corresponding to the target area based on the coordinate information of the target area; Identify the layer whose element area range is within the area range corresponding to the target area as the target layer.
13. The processing apparatus according to claim 11, wherein, the processing module is configured to: According to the target layer, split the layers of the image to be processed to obtain a target layer set and a non-target layer set other than the target layer.
14. A computer-readable medium having a computer program stored thereon, wherein, When the computer program is executed by a processor, it implements the method for processing an image according to any one of claims 1 to 10.
15. An electronic device, characterized in that it includes: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the method for processing an image according to any one of claims 1 to 10.
Citation Information
Patent Citations
Image layers navigation
US20150093029A1