Layer synthesis method and electronic equipment

By pre-combining the foreground layer, generating intermediate images, and only the background layer and activation layer and intermediate images are synthesized in the real-time synthesis stage, the problem of large amount of real-time layer synthesis and lag caused by the large number of layers is solved, and efficient layer synthesis and excellent user experience is achieved.

CN120104078APending Publication Date: 2025-06-06HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311670669.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-05
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

In painting or image processing scenes, when there are many layers, the calculation amount required for real-time layer synthesis is huge, resulting in display lag and affecting the user experience.

Method used

By pre-synthesising the foreground layer, the number of foreground layers participating in real-time synthesis is reduced, thereby improving the efficiency of real-time layer synthesis. The specific method includes synthesising multiple foreground layers to generate intermediate images, and synthesising only background layers and activation layers and intermediate images during the real-time synthesis stage.

Benefits of technology

It effectively improves the efficiency of real-time layer synthesis, reduces lag, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104078A_ABST
    Figure CN120104078A_ABST
Patent Text Reader

Abstract

The invention provides a layer synthesis method and electronic equipment. According to the method, the foreground image layers can be pre-synthesized, so that the number of the foreground image layers participating in real-time synthesis is effectively reduced, and the real-time image layer synthesis efficiency is improved. The method comprises the following steps that: the electronic equipment acquires a background image layer, an activation image layer, a first foreground image layer, a second foreground image layer and a third foreground image layer which are arranged in sequence; and the electronic equipment synthesizes the first foreground image layer, the second foreground image layer and the third foreground image layer to generate a first intermediate image. And then, the electronic equipment synthesizes the background image layer, the activation image layer and the first intermediate image to generate a first target image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a layer synthesis method and electronic device. Background Art

[0002] With the development of terminal technology, multi-layer blending technology is widely used in painting or image processing scenarios. For example, in a painting scenario, the electronic device responds to the user's drawing operation, displays the facial contour of the person drawn by the user on layer 1, and then responds to the user's operation of creating a layer to create layer 2. And in response to the user's drawing operation, the facial features drawn by the user are displayed on layer 2. Afterwards, through the multi-layer blending technology, the electronic device can synthesize layer 1 and layer 2 to display the final entire face image. For another example, in an image processing scenario, the electronic device responds to the user's operation of inputting a picture, obtains multiple pictures, and then takes each of the pictures as a layer, and synthesizes multiple layers through multi-layer blending technology to display the final synthesized image.

[0003] Among them, in the layer synthesis process, the electronic device first applies for a texture for saving the blending result. After that, the electronic device synthesizes multiple layers onto the texture in order from bottom to top, and the resulting texture obtained is the final synthesized image. However, in painting or image processing scenarios, electronic devices need to display the image change effects corresponding to user operations in real time for user confirmation. Then, the electronic device needs to perform layer synthesis in real time. When there are a large number of layers, the amount of calculation required for layer blending is huge, and real-time layer synthesis will cause the display to freeze, affecting the user experience. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a layer synthesis method and electronic device. The technical solution provided by the present application effectively reduces the number of foreground layers involved in real-time synthesis by pre-synthesizing the foreground layer, thereby improving the efficiency of real-time layer synthesis.

[0005] In order to achieve the above technical objectives, this application provides the following technical solutions:

[0006] In a first aspect, a layer synthesis method is provided, which is applied to an electronic device. The method includes: obtaining a background layer, an activation layer, a first foreground layer, a second foreground layer, and a third foreground layer that are set in sequence. Synthesizing the first foreground layer, the second foreground layer, and the third foreground layer to generate a first intermediate image. Synthesizing the background layer, the activation layer, and the first intermediate image to generate a first target image.

[0007] In this way, in the preprocessing stage, the electronic device pre-synthesizes multiple foreground layers, effectively reducing the number of foreground layers participating in layer synthesis in the real-time processing stage, improving the efficiency of real-time layer synthesis, thereby improving image processing efficiency and avoiding freezes and anomalies that affect user experience.

[0008] According to the first aspect, before synthesizing the first foreground layer, the second foreground layer and the third foreground layer to generate a first intermediate image, the method also includes: based on the mixing mode of the first foreground layer, the second foreground layer and the third foreground layer, determining that the first foreground layer, the second foreground layer and the third foreground layer meet a combination condition; the combination condition indicates that the mixing order between multiple adjacent layers can be changed.

[0009] For example, based on the combining condition, after the hierarchical order of the layers is changed, the synthesis results of the layers are the same, then these layers meet the combining condition. For example, the blending algorithms of these layers are the same and meet the combining condition.

[0010] In this way, the electronic device pre-synthesizes the foreground layers that meet the combination conditions among the foreground layers, thereby reducing the number of foreground layers that subsequently participate in the real-time layer synthesis process, so as to improve the layer synthesis efficiency.

[0011] In some examples, the multiple foreground layers included in the layer list may include multiple groups of adjacent foreground layers that meet the combination conditions, so that multiple groups of intermediate images can be pre-synthesized. Optionally, the multiple foreground layers may also include foreground layers that do not meet the combination conditions, and then, these foreground layers that do not meet the combination conditions participate in real-time layer synthesis to ensure the final layer synthesis effect.

[0012] According to the first aspect, or any implementation of the first aspect above, the conditions are specifically characterized as follows: synthesizing the second foreground layer and the third foreground layer to obtain a first transition image; synthesizing the first transition image and the first foreground layer to obtain a second transition image. Synthesizing the first foreground layer and the second foreground layer to obtain a third transition image; synthesizing the third transition image and the third foreground layer to obtain a fourth transition image. The second transition image is consistent with the fourth transition image.

[0013] In this way, by judging whether the layer synthesis result will change after changing the hierarchical order of the layers, it is judged whether the layers meet the combination conditions.

[0014] According to the first aspect, or any implementation of the first aspect above, generating the first target image includes: based on the mixing mode of the first intermediate image and the activation layer, determining that the first intermediate image and the activation layer do not meet the exchange condition, maintaining the hierarchical order of the background layer, the activation layer, and the first intermediate image; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable. Synthesizing the background layer, the activation layer, and the first intermediate image to generate the first target image.

[0015] According to the first aspect, or any implementation of the first aspect above, generating the first target image includes: based on the mixing mode of the first intermediate image and the activation layer, determining that the first intermediate image and the activation layer meet the exchange condition; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable. Synthesizing the first intermediate image and the background layer to generate a second intermediate image. Synthesizing the second intermediate image and the activation layer to generate the first target image.

[0016] For example, based on the exchange condition, exchanging the active layer and the first intermediate image does not affect the final layer synthesis result. For example, the mixing algorithm of the active layer and the first intermediate image meets the exchange condition.

[0017] According to the first aspect, or any implementation of the first aspect above, the exchange condition is specifically characterized as follows: the background layer, the activation layer, and the first intermediate image are synthesized in sequence from bottom to top to obtain a fifth transition image. The background layer, the first intermediate image, and the activation layer are synthesized in sequence from bottom to top to obtain a sixth transition image. The fifth transition image is consistent with the sixth transition image.

[0018] In this way, when the electronic device determines that the foreground layer adjacent to the active layer and the active layer meet the exchange condition, the electronic device can exchange the layer order of the adjacent foreground layer and the active layer, thereby transforming the foreground layer into a background layer to participate in pre-synthesis. In this way, the number of foreground layers participating in the subsequent real-time layer synthesis is effectively reduced. Optionally, the foreground layer that meets the exchange condition can be a layer or a pre-synthesized layer.

[0019] In a second aspect, a layer synthesis method is provided, which is applied to an electronic device. The method includes: obtaining a background layer set, an activation layer, and a first foreground layer that are set in sequence. Synthesizing the first foreground layer and the background layer set to generate a first intermediate image. Synthesizing the activation layer and the first intermediate image to generate a first target image.

[0020] In this way, in the preprocessing stage, the electronic device exchanges the hierarchical order of the foreground layer and the activation layer, transforms the foreground layer into a background layer, and pre-synthesizes it with other background layers, effectively reducing the number of foreground layers involved in layer synthesis in the real-time processing stage, thereby improving the efficiency of real-time layer synthesis.

[0021] According to a second aspect, a background layer set includes a first background layer and a second background layer arranged in sequence.

[0022] In some examples, the set of background layers may include a single layer that is a composite of a first background layer and a second background layer.

[0023] In this way, the electronic device can first swap the hierarchical order of the foreground layer and the active layer, and then pre-synthesize the background layer; the electronic device can also first pre-synthesize the background layer, and then swap the hierarchical order of the foreground layer and the active layer, thereby flexibly implementing the layer pre-processing process.

[0024] According to the second aspect, or any implementation of the second aspect above, before synthesizing the first foreground layer and the background layer set to generate the first intermediate image, the method also includes: based on the blending mode of the first foreground layer and the activation layer, determining that the first foreground layer and the activation layer satisfy an exchange condition; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable.

[0025] For example, based on the exchange condition, exchanging the active layer and the first foreground layer does not affect the final layer synthesis result. For example, the mixing algorithm of the active layer and the first foreground layer meets the exchange condition.

[0026] According to the second aspect, or any implementation of the second aspect above, the exchange condition is specifically characterized as follows: the first background layer, the second background layer, the activation layer, and the first foreground layer are synthesized in sequence from bottom to top to obtain a first transition image. The first background layer, the second background layer, the first foreground layer, and the activation layer are synthesized in sequence from bottom to top to obtain a second transition image. The first transition image is consistent with the second transition image.

[0027] According to the second aspect, or any implementation of the second aspect, the first foreground layer is a composite layer, and the composite layer includes an associated mask layer and a foreground layer.

[0028] In this way, the composite layer in the foreground layer can also participate in and activate the hierarchical order exchange between layers, thereby effectively reducing the number of layers participating in layer synthesis in real time.

[0029] According to the second aspect, or any implementation of the second aspect above, the method also includes: determining the pixel parameter change of the activation layer, re-synthesizing the activation layer and the first intermediate image after the pixel parameter change, and generating a second target image.

[0030] In this way, the layers involved in real-time layer synthesis only include the activated layer and the first intermediate image, which effectively improves the efficiency of layer synthesis.

[0031] In a third aspect, a layer synthesis method is provided, which is applied to an electronic device. The method includes: obtaining a first background layer, a second background layer, a third background layer, an activation layer, and a first foreground layer that are set in sequence. Synthesizing the first background layer, the second background layer, and the third background layer to generate a first intermediate image. Synthesizing the first foreground layer and the first intermediate image to generate a second intermediate image. Synthesizing the activation layer and the second intermediate image to generate a first target image.

[0032] Thus, in the preprocessing stage, the electronic device pre-synthesizes multiple background layers. In addition, the electronic device swaps the hierarchical order of the foreground layer and the active layer, transforms the foreground layer into a background layer, and then pre-synthesizes it with other background layers, effectively reducing the number of foreground layers involved in layer synthesis in the real-time processing stage, thereby improving the efficiency of real-time layer synthesis.

[0033] According to the third aspect, before synthesizing the first foreground layer and the first intermediate image to generate the second intermediate image, the method also includes: based on the blending mode of the first foreground layer and the activation layer, determining that an exchange condition is satisfied between the first foreground layer and the activation layer; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable.

[0034] For example, based on the exchange condition, exchanging the active layer and the first foreground layer does not affect the final layer synthesis result. For example, the mixing algorithm of the active layer and the first foreground layer meets the exchange condition.

[0035] According to the third aspect, or any implementation of the third aspect, the exchange condition is specifically characterized as follows: the first intermediate image, the activation layer, and the first foreground layer are synthesized in sequence from bottom to top to obtain a first transition image. The first intermediate image, the first foreground layer, and the activation layer are synthesized in sequence from bottom to top to obtain a second transition image. The first transition image is consistent with the second transition image.

[0036] According to the third aspect, or any implementation of the third aspect above, before synthesizing the first background layer, the second background layer and the third background layer to generate the first intermediate image, the method also includes: based on the mixing mode of the first background layer, the second background layer and the third background layer, determining that the first background layer, the second background layer and the third background layer satisfy a combination condition; the combination condition indicates that the mixing order between multiple adjacent layers can be changed.

[0037] According to the third aspect, or any implementation of the third aspect above, the conditions are specifically characterized as follows: the first background layer and the second background layer are synthesized to obtain a third transition image; the third transition image and the third background layer are synthesized to obtain a fourth transition image. The second background layer and the third background layer are synthesized to obtain a fifth transition image; the fifth transition image and the first background layer are synthesized to obtain a sixth transition image. The fourth transition image and the sixth transition image are consistent.

[0038] For example, based on the combining condition, after the hierarchical order of the layers is changed, the synthesis results of the layers are the same, then these layers meet the combining condition. For example, the blending algorithms of these layers are the same and meet the combining condition.

[0039] In a fourth aspect, an electronic device is provided. The electronic device includes: a processor and a memory, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor reads the computer instructions from the memory, the electronic device executes: obtain a background layer, an activation layer, a first foreground layer, a second foreground layer, and a third foreground layer that are set in sequence. The first foreground layer, the second foreground layer, and the third foreground layer are synthesized to generate a first intermediate image. The background layer, the activation layer, and the first intermediate image are synthesized to generate a first target image.

[0040] According to the fourth aspect, when the processor reads computer instructions from the memory, it also causes the electronic device to execute: based on the mixing modes of the first foreground layer, the second foreground layer and the third foreground layer, determine whether the first foreground layer, the second foreground layer and the third foreground layer satisfy a combination condition; the combination condition indicates that the mixing order between multiple adjacent layers can be changed.

[0041] According to the fourth aspect, or any implementation of the fourth aspect above, the conditions are specifically characterized as follows: synthesizing the second foreground layer and the third foreground layer to obtain a first transition image; synthesizing the first transition image and the first foreground layer to obtain a second transition image. Synthesizing the first foreground layer and the second foreground layer to obtain a third transition image; synthesizing the third transition image and the third foreground layer to obtain a fourth transition image. The second transition image is consistent with the fourth transition image.

[0042] According to the fourth aspect, or any implementation of the fourth aspect above, generating the first target image includes: based on the mixing mode of the first intermediate image and the activation layer, determining that the first intermediate image and the activation layer do not meet the exchange condition, maintaining the hierarchical order of the background layer, the activation layer, and the first intermediate image; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable. Synthesizing the background layer, the activation layer, and the first intermediate image to generate the first target image.

[0043] According to the fourth aspect, or any implementation of the fourth aspect above, generating the first target image includes: based on the mixing mode of the first intermediate image and the activation layer, determining that the first intermediate image and the activation layer meet the exchange condition; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable. Synthesizing the first intermediate image and the background layer to generate the second intermediate image. Synthesizing the second intermediate image and the activation layer to generate the first target image.

[0044] According to the fourth aspect, or any implementation of the fourth aspect, the exchange condition is specifically characterized as follows: the background layer, the activation layer, and the first intermediate image are synthesized in sequence from bottom to top to obtain a fifth transition image. The background layer, the first intermediate image, and the activation layer are synthesized in sequence from bottom to top to obtain a sixth transition image. The fifth transition image is consistent with the sixth transition image.

[0045] In a fifth aspect, an electronic device is provided. The electronic device includes: a processor and a memory, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor reads the computer instructions from the memory, the electronic device executes: obtain a background layer set, an activation layer, and a first foreground layer that are set in sequence. Synthesize the first foreground layer and the background layer set to generate a first intermediate image. Synthesize the activation layer and the first intermediate image to generate a first target image.

[0046] According to the fifth aspect, the background layer set includes a first background layer and a second background layer arranged in sequence; or, the background layer set may include a single layer obtained by synthesizing the first background layer and the second background layer.

[0047] According to the fifth aspect, or any implementation of the fifth aspect above, when the processor reads computer instructions from the memory, it also enables the electronic device to execute: based on the mixing mode of the first foreground layer and the activation layer, determine that the exchange condition is satisfied between the first foreground layer and the activation layer; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable.

[0048] According to the fifth aspect, or any implementation of the fifth aspect, the exchange condition is specifically characterized as follows: the first background layer, the second background layer, the activation layer, and the first foreground layer are synthesized in sequence from bottom to top to obtain a first transition image. The first background layer, the second background layer, the first foreground layer, and the activation layer are synthesized in sequence from bottom to top to obtain a second transition image. The first transition image is consistent with the second transition image.

[0049] According to the fifth aspect, or any implementation of the fifth aspect, the first foreground layer is a composite layer, and the composite layer includes an associated mask layer and a foreground layer.

[0050] According to the fifth aspect, or any one of the implementations of the fifth aspect above, when the processor reads computer instructions from the memory, it also enables the electronic device to execute: determining the pixel parameter change of the activated layer, re-synthesizing the activated layer and the first intermediate image after the pixel parameter change, and generating a second target image.

[0051] In a sixth aspect, an electronic device is provided. The electronic device includes: a processor and a memory, the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor reads the computer instructions from the memory, the electronic device executes: obtain the first background layer, the second background layer, the third background layer, the activation layer and the first foreground layer which are set in sequence. Synthesize the first background layer, the second background layer and the third background layer to generate a first intermediate image. Synthesize the first foreground layer and the first intermediate image to generate a second intermediate image. Synthesize the activation layer and the second intermediate image to generate a first target image.

[0052] According to the sixth aspect, when the processor reads computer instructions from the memory, it also enables the electronic device to execute: based on the mixing mode of the first foreground layer and the activation layer, determine that the exchange condition is satisfied between the first foreground layer and the activation layer; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable.

[0053] According to the sixth aspect, or any implementation of the sixth aspect, the exchange condition is specifically characterized as follows: the first intermediate image, the activation layer, and the first foreground layer are synthesized in sequence from bottom to top to obtain a first transition image. The first intermediate image, the first foreground layer, and the activation layer are synthesized in sequence from bottom to top to obtain a second transition image. The first transition image is consistent with the second transition image.

[0054] According to the sixth aspect, or any implementation of the sixth aspect above, when the processor reads computer instructions from the memory, it also enables the electronic device to execute: based on the mixing mode of the first background layer, the second background layer and the third background layer, determine that the first background layer, the second background layer and the third background layer meet the combination condition; the combination condition indicates that the mixing order between multiple adjacent layers can be changed.

[0055] According to the sixth aspect, or any implementation of the sixth aspect above, the conditions are specifically characterized as follows: the first background layer and the second background layer are synthesized to obtain a third transition image; the third transition image and the third background layer are synthesized to obtain a fourth transition image. The second background layer and the third background layer are synthesized to obtain a fifth transition image; the fifth transition image and the first background layer are synthesized to obtain a sixth transition image. The fourth transition image and the sixth transition image are consistent.

[0056] In a seventh aspect, an electronic device is provided, which has the function of implementing the layer synthesis method described in the first aspect and any possible implementation thereof; or, the electronic device has the function of implementing the layer synthesis method described in the second aspect and any possible implementation thereof; or, the electronic device has the function of implementing the layer synthesis method described in the third aspect and any possible implementation thereof. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0057] In an eighth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as an instruction or code), and when the computer program is executed by an electronic device, the electronic device executes the method of the first aspect or any one of the implementations of the first aspect; or, the electronic device executes the method of the second aspect or any one of the implementations of the second aspect; or, the electronic device executes the method of the third aspect or any one of the implementations of the third aspect.

[0058] In the ninth aspect, a computer program product is provided. When the computer program product runs on an electronic device, the electronic device executes the method of the first aspect or any one of the embodiments of the first aspect; or, the electronic device executes the method of the second aspect or any one of the embodiments of the second aspect; or, the electronic device executes the method of the third aspect or any one of the embodiments of the third aspect.

[0059] In a tenth aspect, a circuit system is provided, the circuit system comprising a processing circuit, the processing circuit being configured to execute the method of the first aspect or any one of the embodiments of the first aspect; or, the processing circuit being configured to execute the method of the second aspect or any one of the embodiments of the second aspect; or, the processing circuit being configured to execute the method of the third aspect or any one of the embodiments of the third aspect.

[0060] In the eleventh aspect, a chip system is provided, comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor, and when the at least one processor executes the instructions, the at least one processor executes the method of the first aspect or any one of the embodiments of the first aspect; or, the at least one processor executes the method of the second aspect or any one of the embodiments of the second aspect; or, the at least one processor executes the method of the third aspect or any one of the embodiments of the third aspect.

[0061] The technical effects of the aforementioned aspects can be referenced to each other and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 A schematic diagram of a layer display interface provided in an embodiment of the present application;

[0063] Figure 2 A schematic diagram of layer mixing provided in an embodiment of the present application;

[0064] Figure 3 A schematic diagram of background layer pre-synthesis provided in an embodiment of the present application;

[0065] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0066] Figure 5 A schematic diagram of a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0067] Figure 6 Schematic diagram of the process of layer synthesis method provided in the embodiment of the present application Figure 1 ;

[0068] Figure 7 Schematic diagram of the process of layer synthesis method provided in the embodiment of the present application Figure 2 ;

[0069] Figure 8 A schematic diagram of a composite layer pre-synthesis scene provided in an embodiment of the present application;

[0070] Fig. 9 A schematic diagram of exchange conditions provided for an embodiment of the present application;

[0071] Fig.10 A schematic diagram of a scenario for exchanging the hierarchical order of layers based on exchange conditions provided in an embodiment of the present application;

[0072] Fig.11 A schematic diagram of the combination conditions provided in the embodiment of the present application;

[0073] Fig.12 A schematic diagram of a scene for grouping and pre-compositing foreground layers based on a combination condition provided in an embodiment of the present application;

[0074] Fig.13 A schematic diagram of a scene of pre-synthesis of background layers provided in an embodiment of the present application;

[0075] Fig.14 Schematic diagram of the layer synthesis scene provided in the embodiment of the present application Figure 1 ;

[0076] Fig.15 Schematic diagram of the layer synthesis scene provided in the embodiment of the present application Figure 2 ;

[0077] Fig.16Schematic diagram of the layer synthesis scene provided in the embodiment of the present application Figure 3 ;

[0078] Fig.17 Schematic diagram of the layer synthesis scene provided in the embodiment of the present application Figure 4 ;

[0079] Fig.18 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] The technical solutions in the embodiments of the present application are described below in conjunction with the accompanying drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two).

[0081] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0082] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0083] First, the technical terms involved in the embodiments of the present application are introduced:

[0084] 1) Pixel: The basic unit of image display, which cannot be divided any further. Each pixel is a small grid of a single color.

[0085] 2) Texture: A data object that contains image information. For example, this data object can be an array of pixels, where the data of each pixel represents the color of the pixel, and the array of pixels can represent the entire image. For example, a texture can be a memory that stores a layer or image.

[0086] 3) Image Layer: In image processing applications or painting applications, a layer is a component of a work (or described as an image). A work can be composed of multiple layers, each containing different visual elements. Layers can be stacked on top of each other and blended into the final effect. Each layer can be modified separately without affecting the content of other layers.

[0087] 4) Blend: Take multiple layers as input and output a result image.

[0088] 5) Synthesize: Take multiple layers as input and output a result image.

[0089] 6) Blend Algorithm: The calculation method of layer blending, usually takes the textures of two layers as input and outputs a texture as the blending result.

[0090] 7) Blend Mode: The way layers are blended. Each blend mode corresponds to a blending algorithm, which determines the output of the layer blending. The art world has defined a set of common blend modes, including Normal mode, Multiply mode, Linear Burn mode, Screen mode, etc.

[0091] Among them, the normal mode is the default mode in the blending mode, which is used to indicate the display of the pixels of the blended color layer without any layer blending, which means that the base color layer (background layer) has no effect on the blended color layer. The multiply mode is used to indicate that the grayscale of the pixel colors of the upper and lower layers is multiplied to obtain a color with a lower grayscale and become the synthesized color. The effect after the layer synthesis is simply that the low-grayscale pixels appear while the high-grayscale pixels do not appear. The linear burn mode is used to indicate that the background color is darkened by reducing the brightness to reflect the blended color. The color filter mode is the opposite of the multiply mode. It is used to indicate that the grayscale of the pixel colors of the upper and lower layers is multiplied to obtain a color with a higher grayscale and become the synthesized color. The effect after the layer synthesis is simply that the high-grayscale pixels appear while the low-grayscale pixels do not appear.

[0092] In some examples, different blending modes and blending algorithms for implementing the blending modes are preconfigured in the electronic device. The electronic device detects the user's operation of setting the blending mode of a layer, and determines the blending mode and blending algorithm of the layer.

[0093] 8) Mask: A special layer that acts on other layers to produce special effects.

[0094] 9) Compound Layer: A special layer group, usually composed of layers and masks, used to achieve specific combination effects.

[0095] 10) Layer List: The layers in the work are arranged from bottom to top.

[0096] 11) Active Layer: The layer that the user is currently modifying.

[0097] 12) Background Layer: The layer below the active layer in the layer list.

[0098] 13) Foreground Layer: The layer above the active layer in the layer list.

[0099] 14) Painting Latency: The delay in the appearance of the ink marks on the screen when the pen tip is drawing on the screen.

[0100] 15) Exchange condition: For a hybrid algorithm f(A,B), if exchanging its first input and second input does not change the result, that is, f(A,B) = f(B,A), then this hybrid algorithm is said to satisfy the exchange condition.

[0101] 16) Combination condition: For a hybrid algorithm f(A,B), when it appears on two consecutive layers, if the order of calculation is changed and the result remains unchanged, that is, f(f(A,B),C)=f(A,f(B,C)), then this hybrid algorithm is said to meet the combination condition.

[0102] In some embodiments, multi-layer blending technology is widely used in painting or image processing scenarios. For example, in a painting scenario, the electronic device responds to the user's drawing operation, displays the facial contour of the character drawn by the user on layer 1, and then responds to the user's operation of creating a layer to create layer 2. And in response to the user's drawing operation, the eyes of the character drawn by the user are displayed on layer 2. After that, the aforementioned steps are repeated, and the electronic device creates more layers for drawing other facial features, hair, and other contents of the character according to the user's operation. After that, through the multi-layer blending technology, the electronic device can synthesize the multiple layers that have been created to display the final whole face image. For another example, in an image processing scenario, the electronic device responds to the user's operation of inputting pictures, obtains multiple pictures, and then takes each of the pictures as a layer, and synthesizes the multiple layers through the multi-layer blending technology to display the final synthesized image.

[0103] In the process of layer synthesis, the electronic device first applies for a texture for storing the mixed result. Then, the electronic device synthesizes multiple layers onto the texture in order from bottom to top, and the resulting texture is the final synthesized image.

[0104] For example, Figure 1 As shown in (a), in a drawing scene, the electronic device displays a menu bar 11, which can be used to display layer information corresponding to the current drawing image. The image includes at least one layer, and the electronic device manages the at least one layer through a layer management module. In some examples, a layer corresponds to a structure, which includes multiple member variables, each member variable corresponding to a type of layer information. For example, Figure 1 In the scene shown in (a), the current drawing image includes 4 layers, and the layer list managed by the layer management module includes the layer information of these 4 layers, among which the layer currently being edited by the user is layer 3. As shown in the menu bar 11, the member variables corresponding to layer 3 include layer name, blending mode, etc., that is, the layer information includes layer name, blending mode, etc.

[0105] In some examples, the electronic device may determine an activated layer according to a user operation, where the activated layer is the layer operated by the user. Figure 1 As shown in (a), the current layer 3 is the active layer, and the layer information corresponding to layer 3 includes information indicating that layer 3 is the active layer. The electronic device can switch layers according to user operations to determine a new active layer. For example, the electronic device detects the user's operation on layer option 12 and displays the following Figure 1 As shown in the interface (b) in the figure, as shown in the reference numeral 13, the electronic device displays multiple layers of the image currently being drawn, and the user can instruct the electronic device to switch to display the layer to be edited according to the needs. Figure 1As shown in the figure mark 14 in (c), the electronic device switches the display layer 2 according to the user's selection operation, sets the layer information of layer 2 to include information indicating that layer 2 is the activated layer, and modifies the layer information of layer 3, and the modified layer information includes information indicating that layer 3 is the background layer.

[0106] It should be understood that the electronic device can also obtain the active layer in other ways. For example, after the electronic device starts a painting application (or other applications such as an image processing application), the layer at the top layer is set as the active layer and the active layer is displayed; or the layer last edited after the drawing application is closed is set as the active layer and the active layer is displayed. Alternatively, the electronic device can also determine the active layer in other ways.

[0107] In some examples, a layer that the user is editing is an active layer (or described as a focus layer), the layers below this layer are background layers, and the layers above this layer are foreground layers. When the active layer is the top layer, there is no foreground layer; when the active layer is the bottom layer, there is no background layer.

[0108] For example, Figure 1 In the scene shown in (b), the layer list includes 4 layers corresponding to the currently displayed image. The electronic device can add or delete layers, or change the hierarchical order of layers according to user operations. In response to the user selecting layer 3, the electronic device determines that the current layer 3 is the active layer, layer 4 is the background layer, and layers 1 and 2 are the foreground layers.

[0109] In some examples, the user can set a blending mode for each layer, and each blending mode corresponds to a blending algorithm. The blending algorithm of a layer is used to define the calculation method for blending the layer onto the texture. In some examples, the blending mode includes, for example, normal mode, multiply mode, etc.

[0110] For example, Figure 1 As shown in (a), the current blending mode of layer 3 is the multiply mode. In response to the user's operation on the blending mode option 15, the electronic device determines that the user instructs to set the blending mode of layer 3, and the electronic device may display the following Figure 1 The interface shown in (d) is shown in the figure. As shown by reference numeral 16, the user can select the blending mode set for layer 3 according to the needs. For example, Figure 1 As shown in the reference numeral 17 shown in (e), the electronic device sets the blending mode of layer 3 to the linear deepening mode according to the user's operation.

[0111] Some examples include Figure 2As shown, the blending algorithm f(A, B) corresponding to the blending mode of layer X is a binary operation. Its first input is the composite result of the layers below layer X, and its second input is layer X itself. Its output C=f(A, B) is the blending result of layer X and the layers below it.

[0112] However, in painting or image processing scenarios, users usually operate on a layer in the image, and the electronic device needs to display the image change effect corresponding to the operation in real time for the user to confirm. Therefore, the electronic device needs to perform layer synthesis in real time. When there are many layers, the amount of calculation required for layer blending is huge, and real-time layer synthesis will cause painting delays, resulting in poor display tracking, freezes, and low drawing or image processing efficiency.

[0113] In some embodiments, the electronic device pre-synthesizes some layers by pre-synthesizing the layers, so that the number of layers to be synthesized can be reduced during the real-time synthesis of the layers, thereby improving the synthesis efficiency and avoiding freezes.

[0114] In some examples, during painting or image processing, users generally only operate the content on the active layer and do not change the content of the background layer. Figure 3 As shown, after determining the activated layer, the electronic device can execute the preprocessing stage, first apply for a temporary texture, and synthesize all background layers onto the temporary texture. Afterwards, in the real-time layer synthesis stage, the electronic device synthesizes the activated layer directly onto the temporary texture according to the content changes on the activated layer. After synthesizing the result texture, one or more foreground layers are sequentially synthesized onto the result texture from bottom to top to obtain the final synthesis result. Among them, in the pre-synthesis process, the synthesis of the background layer does not change the order of the layer synthesis from bottom to top, so the accuracy of the synthesis result can be guaranteed. In addition, the number of layers involved in real-time synthesis is reduced, and the performance of real-time layer synthesis is improved.

[0115] However, in scenes with many foreground layers, the above solution has limited effect on improving the efficiency of layer synthesis and may still cause abnormal freezes, affecting the user experience.

[0116] In some embodiments, the layer synthesis method provided in the embodiments of the present application can be applied to the electronic device 100. In some examples, the electronic device 100 can be, for example, a mobile phone, a tablet computer, a laptop computer, a smart screen, a wearable device, a vehicle terminal, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an artificial intelligence (AI) device, and other terminal devices with display functions. The operating system installed in the electronic device 100 includes but is not limited to Or other operating systems. This application does not limit the specific type of the electronic device 100 or the installed operating system.

[0117] Figure 4 A schematic structural diagram of an electronic device 100 is shown.

[0118] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0119] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0120] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0121] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0122] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0123] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0124] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor, charger, flash, camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor through the I2C interface, so that the processor 110 communicates with the touch sensor through the I2C bus interface to realize the touch function of the electronic device 100.

[0125] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0126] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0127] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0128] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0129] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0130] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0131] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0132] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0133] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device, or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0134] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0135] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0136] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0137] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be manufactured using a liquid crystal display (LCD), such as an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-led, Micro-led, Micro-oled, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0138] In some embodiments, the electronic device 100 detects the user's editing operation on the image during the process of displaying the image through the display screen 194, determines the layer where the user is currently editing the image content through the processor 110, and determines the layer as the active layer. Afterwards, the electronic device 100 can perform a layer preprocessing stage on the foreground layer and / or the background layer through the processor 110, thereby effectively reducing the number of layers involved in real-time synthesis. Afterwards, the electronic device 100 displays the final layer real-time synthesis result through the display screen 194, so that the user can determine the editing effect.

[0139] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0140] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0141] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0142] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The electronic device 100 can use the audio module 170, such as music playing, recording, etc. The audio module 170 can include a speaker, a receiver, a microphone, a headphone interface, and an application processor to implement audio functions.

[0143] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0144] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0145] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. Motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of display screen 194. Different application scenarios (for example: time reminder, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects.

[0146] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.

[0147] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting or removing the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.

[0148] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0149] Figure 5 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0150] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0151] The application layer can include a series of application packages.

[0152] like Figure 5 As shown, the application package may include target applications, contacts, memos, calls, clipboard, gallery, map, camera, video and other applications.

[0153] In some examples, the target application is an image processing application, a drawing application, or other application program having image display and processing functions. In some examples, the target application is configured with functional logic such as a user interface, artwork management, layer management, brushes, and filters.

[0154] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0155] like Figure 5 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0156] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0157] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0158] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0159] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0160] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0161] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0162] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0163] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0164] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0165] The system library may include a drawing engine. The system library may also include multiple other functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), etc.

[0166] In some embodiments, the drawing engine is used to implement the painting or image processing functions of the target application. The drawing engine includes, for example, modules such as layer synthesis, brush drawing, filters, and rendering pipelines. These modules can configure the rendering pipeline according to their own logical assembly, and the rendering pipeline is used to generate rendering instructions. For example, the layer synthesis module is used to perform the preprocessing process and the real-time synthesis process of the layers. During the preprocessing process, the layer synthesis module performs preprocessing such as adjusting the hierarchical order of the layers and pre-synthesizing some layers. Afterwards, in the real-time synthesis process of the layers, the layer synthesis module synthesizes the preprocessed layers (or textures). In addition, before the layer synthesis, the layer synthesis module triggers the rendering pipeline to generate rendering instructions to instruct the electronic device 100 to synthesize the rendered layers.

[0167] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0168] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0169] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0170] The two-dimensional graphics engine is a drawing engine for 2D drawing. In some examples, the drawing engine includes a three-dimensional graphics processing library and a two-dimensional graphics engine.

[0171] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0172] In some examples, the kernel layer and the system library include an interface for the GPU to call GPU storage and computing functions, such as a rendering hardware interface. In some examples, the rendering hardware interface includes, for example, a direct extension (DX) 12 interface, a metal interface, a vulkan interface, an OpenGL interface, etc.

[0173] Figure 6 The following is a flow chart of a layer synthesis method provided in an embodiment of the present application. Figure 6 The specific order described below is a limitation, and it should be understood that in other embodiments, the order of some steps in the method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:

[0174] S601. The electronic device obtains layer information.

[0175] In some embodiments, the electronic device starts the target application in response to the user operation and displays the interface of the target application. On the interface of the target application, the electronic device determines the layer indicated by the user according to the user operation and determines the layer as the activated layer. Then, the electronic device can obtain the layer information of the foreground layer above the activated layer, the layer information of the activated layer, and the layer information of the background layer below the activated layer according to the positional relationship between the activated layer and other layers in the layer list.

[0176] Exemplarily, the target application is a painting application. The electronic device displays image A in the target application, and the layer list of image A includes three layers from top to bottom: layer 1, layer 2, and layer 3. The electronic device detects that the user clicks on layer 2 in the layer list, and determines that the user instructs to edit the content on layer 2. Then, the electronic device can determine that the layer information includes layer 2 as the active layer, layer 1 as the foreground layer, and layer 3 as the background layer. Alternatively, when the electronic device is displaying the editing interface corresponding to layer 3, it detects the user's operation of adding a new layer, and can add layer 4 below layer 3 and display the editing interface of layer 4. In addition, the electronic device can determine that the layer information includes layer 4 as the active layer, and layer 1, layer 2, and layer 3 as the foreground layers. Among them, in the scene of editing layer 4, the layer information may not include the background layer.

[0177] In another exemplary embodiment, the target application is an image processing application. The electronic device receives picture 1, picture 2, and picture 3 input by the user, and creates layer 1 for editing picture 1, layer 2 for editing picture 2, and layer 3 for editing picture 3. The electronic device detects the user's operation of instructing to edit picture 2, and can determine that the layer information includes information that layer 2 is an active layer, layer 1 located above layer 2 is a foreground layer, and layer 3 located below layer 2 is a background layer.

[0178] S602: The electronic device determines that there is a preprocessable layer in the foreground layer.

[0179] When there is a preprocessable layer in the foreground layer, step S603 is executed; when there is no preprocessable layer in the foreground layer, step S604 is executed.

[0180] In some embodiments, in order to reduce the number of layers synthesized in real time, the electronic device may process the foreground layer and / or the background layer in advance.

[0181] In some examples, the electronic device can reduce the number of layers in the foreground layer that participate in subsequent real-time synthesis by preprocessing, thereby effectively improving the efficiency of real-time synthesis layers. Therefore, when the electronic device determines that there are preprocessable layers in the foreground layer, it can execute step S603 to preprocess the foreground layer. Alternatively, when the electronic device determines that there are no preprocessable layers in the foreground layer, it can execute step S604 to preprocess the background layer, wherein the preprocessing of the background layer is presynthesis of the background layer.

[0182] Exemplarily, the electronic device determines that a layer satisfies any one of the composite layer combination condition, the exchange condition, and the combination condition, and may determine that there is a layer that can be preprocessed.

[0183] The composite layer includes an associated mask layer and a normal layer. For example, after obtaining a foreground layer, the electronic device determines that adjacent foreground layers can be combined into a composite layer. Then, the electronic device can pre-synthesize these foreground layers into a composite layer, thereby reducing the number of foreground layers that participate in the subsequent real-time layer synthesis. It should be understood that the number of foreground layers that make up the composite layer is not limited.

[0184] Among them, the exchange condition represents that the hierarchical order between adjacent layers is interchangeable. For example, the electronic device obtains the background layer, activation layer, and first foreground layer that are set in sequence. The electronic device synthesizes the background layer, activation layer, and first foreground layer in order from bottom to top to obtain a first transition image. The background layer, first foreground layer, and activation layer are synthesized in order from bottom to top to obtain a second transition image. Among them, if the first transition image and the second transition image are consistent. Then the electronic device can determine that there is a first foreground layer and an activation layer that meet the exchange condition. In some examples, the electronic device pre-processes the first foreground layer and the activation layer that meet the exchange condition, such as exchanging the hierarchical order of the first foreground layer and the activation layer, and transforming the first foreground layer into a background layer, thereby reducing the number of foreground layers that subsequently participate in real-time synthesis and improving the efficiency of layer synthesis.

[0185] Among them, the combination condition represents that the mixing order between adjacent multiple layers can be changed. For example, the electronic device obtains the first foreground layer, the second foreground layer and the third foreground layer set in sequence. The electronic device synthesizes the second foreground layer and the third foreground layer to obtain the first transition image; synthesizes the first transition image and the first foreground layer to obtain the second transition image. The electronic device synthesizes the first foreground layer and the second foreground layer to obtain the third transition image; synthesizes the third transition image and the third foreground layer to obtain the fourth transition image. Among them, if the second transition image and the fourth transition image are consistent, then the electronic device can determine that there are the first foreground layer, the second foreground layer and the third foreground layer that meet the combination condition. In some examples, the electronic device preprocesses the first foreground layer, the second foreground layer and the third foreground layer that meet the combination condition to generate an intermediate image. Then, in the subsequent real-time layer synthesis process, the number of foreground layers participating in the real-time synthesis is effectively reduced, and the efficiency of layer synthesis is improved.

[0186] In some examples, the electronic device determines whether there is a layer that can be preprocessed by identifying whether there is a layer in the layer that meets the above-mentioned composite layer combination condition, exchange condition, and combination condition. The details of the composite layer combination condition, exchange condition, and combination condition are described below.

[0187] In some examples, the electronic device can reduce the number of layers in the background layer that participate in subsequent real-time synthesis by preprocessing, thereby effectively improving the efficiency of real-time synthesis layers. Therefore, the electronic device can perform pre-synthesis processing on the background layer. Among them, the synthesis of the background layer does not change the order of synthesizing the layers from bottom to top, so the accuracy of the synthesis result can be guaranteed.

[0188] It should be understood that in some scenarios, the embodiments of the present application do not limit the execution order between step S602 and step S604. For example, the preprocessing of the foreground layer by the electronic device includes pre-synthesis of part of the foreground layer, and the pre-synthesis of the foreground layer does not affect the pre-synthesis of the background layer. Then, the electronic device may also execute step S604 first, and then execute step S602 and step S603; or, the electronic device executes step S604, and step S602 and step S603 at the same time. In other scenarios, the preprocessing of the foreground layer by the electronic device includes adjusting the hierarchical order of the layers and turning the foreground layer into a background layer, then the electronic device needs to execute these steps in the order of step S602, step S603 and step S604. Among them, the preprocessing method of the electronic device to adjust the hierarchical order of the layers is detailed in step S603, which will not be repeated here.

[0189] S603: The electronic device pre-processes the foreground layer.

[0190] In some embodiments, the electronic device's preprocessing of the foreground layer includes one or more of composite layer synthesis, layer order exchange, and foreground layer grouping presynthesis.

[0191] For example, Figure 7 As shown, step S603 includes steps S6031 to S6033, and various preprocessing methods of the foreground layer are introduced through steps S6031 to S6033.

[0192] S6031. The electronic device performs composite layer synthesis on the foreground layer.

[0193] Among them, a composite layer is a special layer group, usually composed of layers and masks, which is used to achieve a specific combination effect. Then, in some examples, when the electronic device determines that the foreground layer includes foreground layers that can be combined into a composite layer, it can first pre-synthesize these foreground layers to generate a composite layer. The composite layer can be stored in the electronic device in the form of a temporary texture, thereby reducing the number of foreground layers, and then reducing the number of layers involved in real-time layer synthesis. In some examples, a group of composite layers includes at least one layer and at least one mask. For example, a composite layer can include a foreground layer and a mask layer.

[0194] The combination effect of the composite layer is achieved by mixing the layers and masks included in the composite layer. Therefore, compositing the composite layer in advance will not affect the final result of the subsequent layer synthesis.

[0195] For example, Figure 8As shown, the electronic device obtains a layer list, determines the activated layer A[m] in response to a user operation, and determines the foreground layer A[m+1]…A[n] located above the activated layer based on the layer position relationship in the layer list. Afterwards, the electronic device traverses the foreground layers A[m+1]…A[n]. If the electronic device determines that the layers from the i-th layer to the j-th layer form a composite layer, the electronic device pre-synthesizes A[i] to A[j] to generate a composite layer. Afterwards, the electronic device continues to traverse the foreground layers, and in the process of traversing the foreground layers, skips A[i+1] to A[j]. The electronic device repeats the aforementioned steps until the synthesis of all composite layers included in the foreground layer is completed. Wherein, m, i, j are positive integers.

[0196] In some examples, after the electronic device synthesizes the foreground layers A[i] to A[j] to obtain a composite layer, the hierarchical order of the composite layer can be determined as the hierarchical order of the synthesized foreground layer that is closest to the activated layer. Figure 8 As shown, the electronic device pre-synthesizes the foreground layers A[i] to A[j] to obtain a composite layer A[i].

[0197] In some examples, the electronic device obtains a composite layer by pre-compositing a foreground layer. The composite layer can also be described as an intermediate image generated during the layer synthesis process.

[0198] In some examples, the electronic device may also traverse the background layer and obtain the composite layer included in the background layer during the process of pre-synthesizing the composite layer.

[0199] In this way, electronic devices can effectively reduce the number of foreground layers through pre-synthesis of composite layers, thereby reducing the number of layers involved in real-time synthesis during subsequent real-time layer synthesis, improving layer synthesis efficiency, reducing painting delays, and improving user experience.

[0200] S6032. The electronic device exchanges the layer order of the foreground layer.

[0201] In some embodiments, if the hierarchical order of the foreground layer and the active layer can be exchanged, the foreground layer can be changed into the background layer, and thus the number of foreground layers subsequently participating in real-time synthesis can be reduced.

[0202] In some examples, for a layer blending algorithm, if for a blending algorithm f(A,B), exchanging its first input and second input, the result remains unchanged, that is, f(A,B)=f(B,A), then this blending algorithm is said to satisfy the exchange condition.

[0203] For example, Fig. 9As shown, the layer list includes layer A and layer B, where layer B is above layer A, the blending algorithm of layer B is f, and the blending result of layer A and layer B is layer C = f(A, B). If the electronic device swaps the positions of layer A and layer B, and sets layer A above layer B, the blending result of layer B and layer A is C' = f(B, A). If C' is the same as C, then the electronic device can determine that the blending algorithm f(A, B) satisfies the exchange condition. That is, even if the electronic device swaps the positions of layer A and layer B, it will not affect the final result of layer synthesis.

[0204] Exemplarily, some mixing modes that meet the exchange condition and corresponding mixing algorithms in commonly used mixing modes are shown in Table 1. It should be understood that the mixing algorithms of the mixing modes that meet the exchange condition are not limited to those shown in Table 1.

[0205] Table 1

[0206] Blending Mode Hybrid Algorithm Multiply mode A*B Linear Burn Mode A+B-1 Color filter mode 1–(1–A)*(1–B)

[0207] In some embodiments, after determining the activation layer, the electronic device may obtain a foreground layer adjacent to the activation layer in the foreground layers, and determine whether the blending algorithm of the foreground layer and the activation layer meets the exchange condition. If so, the electronic device may exchange the layer hierarchy order of the layer with the activation layer, thereby turning the foreground layer into a background layer adjacent to the activation layer.

[0208] The electronic device repeats the above steps until it determines that the blending algorithm of the foreground layer adjacent to the activated layer does not meet the exchange condition, and stops exchanging the hierarchical order of the foreground layer. At this time, the electronic device has changed the hierarchical order of multiple consecutive layers above the activated layer whose blending algorithms meet the exchange conditions to become background layers.

[0209] In some examples, if the blending algorithm between the active layer and the adjacent foreground layer does not satisfy the exchange condition, the electronic device may no longer perform layer exchange on the foreground layer. That is, the electronic device no longer needs to determine whether the blending algorithm of the layer adjacent to the active layer satisfies the exchange condition.

[0210] For example, Fig.10 As shown, the electronic device obtains a layer list, and in response to a user operation, determines the activated layer A[m]. Then, based on the hierarchical relationship of the layers in the layer list, the electronic device can obtain the mixing algorithms of the continuous k foreground layers A[m+1]…A[m+k] located above the activated layer and adjacent to the activated layer, and the mixing algorithms of the activated layer meet the exchange condition, where k is an integer. Then, the electronic device can move the continuous k foreground layers A[m+1]…A[m+k] to below the activated layer A[m].

[0211] Some examples include Fig.10 As shown, the blending algorithm of the foreground layer A[m+k+1] and the blending algorithm of the active layer do not satisfy the exchange condition. Therefore, the electronic device does not exchange the layer hierarchy order of the foreground layer A[m+k+1] and the foreground layers above the foreground layer A[m+k+1] to the background layer.

[0212] Among them, since the mixing algorithms of the activated layer and the activated layers participating in the exchange both meet the exchange conditions, the final result of the layer synthesis will not be affected after the hierarchical order of the foreground layer and the activated layer is exchanged. Therefore, the electronic device can exchange adjacent layers whose mixing algorithms meet the exchange conditions. In some examples, the layers that meet the exchange conditions will not affect the layer synthesis result after the hierarchical order is exchanged. Therefore, after the electronic device moves k consecutive foreground layers A[m+1]…A[m+k] to the bottom of the activated layer A[m], it will not affect the synthesis result of the layers A[m+1]…A[m+k] and the activated layer A[m].

[0213] In some examples, after the electronic device moves k consecutive foreground layers A[m+1]…A[m+k] to below the activated layer A[m], it does not restrict the hierarchical order between the layers A[m+1]…A[m+k].

[0214] In some examples, after the electronic device moves k consecutive foreground layers A[m+1]…A[m+k] to below the active layer A[m], if the layers in the new background layers A[m+1]…A[m+k] are adjacent to the original background layers, the electronic device can also determine whether the mixing algorithms of the adjacent new background layers and the original background layers meet the exchange conditions. If the exchange conditions are met, the electronic device can also exchange the hierarchical order between the adjacent new background layers and the original background layers again. Afterwards, the electronic device can repeat the above steps to complete the hierarchical order exchange of all layers in the background layers whose mixing algorithms meet the exchange conditions.

[0215] In this way, the electronic device can effectively reduce the number of foreground layers by exchanging the hierarchical order of the foreground layers, thereby reducing the number of layers involved in real-time synthesis in the subsequent real-time layer synthesis process, improving the layer synthesis efficiency, reducing the drawing delay, and optimizing the display tracking performance, thereby improving the user experience.

[0216] S6033. The electronic device performs grouping and pre-synthesis of foreground layers.

[0217] In some embodiments, if some of the foreground layers can be pre-synthesized, the number of foreground layers that subsequently participate in real-time synthesis can be reduced. In order not to affect the final result of layer synthesis, the electronic device can group the foreground layers that meet the combination conditions for pre-synthesis.

[0218] In some examples, for a layer blending algorithm, if for a blending algorithm f(A,B), when it appears on three consecutive layers, if its calculation order is changed, the result remains unchanged, that is, f(f(A,B),C)=f(A,f(B,C)), then this blending algorithm is said to meet the combination condition. For example, Fig.11 As shown, the layer list includes layer A, layer B and layer C. The order of these three layers from bottom to top is layer A, layer B and layer C, where the blending algorithms of layer B and layer C are both f. The electronic device first synthesizes layer A and layer B to obtain intermediate image D, and intermediate image D = f(A, B). After that, the electronic device synthesizes layer C and intermediate image D to obtain the final result of layer synthesis E = f(D, C) = f(f(A, B), C). If the electronic device changes the order of layer synthesis, first synthesizes layer B and layer C to obtain intermediate image D', and intermediate image D' = f(B, C). After that, the electronic device synthesizes layer A and intermediate image D' to obtain the final result of layer synthesis E' = f(A, D') = f(A, f(B, C)). If the results of E and E' are the same, then this blending algorithm f is said to meet the combination condition.

[0219] In some examples, after determining that multiple layers meet the combination conditions, the electronic device may apply for a temporary texture. After that, after generating an intermediate image, the electronic device may save the intermediate image to the temporary texture. In some examples, during the group pre-synthesis process, the electronic device may also directly synthesize the multiple layers to be pre-synthesized onto the temporary texture.

[0220] For example, some of the commonly used mixing modes that meet the combination condition and the corresponding mixing algorithms are shown in Table 2. It should be understood that the mixing algorithms of the mixing modes that meet the combination condition are not limited to those shown in Table 2.

[0221] Table 2

[0222] Blending Mode Hybrid Algorithm Normal Mode B Multiply mode A*B Color filter mode 1–(1–A)*(1–B)

[0223] In some embodiments, after determining the foreground layer located above the activated layer, the electronic device may obtain one or more groups of foreground layers that meet the combination condition. The electronic device pre-synthesizes the one or more groups of foreground layers respectively to obtain one or more intermediate images. Moreover, during the process of pre-synthesizing the foreground layers in groups, the electronic device keeps the hierarchical order between the layers and the intermediate images unchanged. In this way, the number of foreground layers can be effectively reduced without affecting the accuracy of the final result of the layer synthesis in the subsequent real-time layer synthesis process.

[0224] For example, Fig.12As shown, the electronic device traverses the foreground layers A[m+1] to A[n]. If there are several consecutive layers with the same blending mode and satisfying the combination condition, the several foreground layers can be divided into a group, and the group of foreground layers can be synthesized into an intermediate image. In this way, the electronic device can obtain one or more intermediate images. Among them, the electronic device directly outputs the layers in the foreground layer that do not belong to any group (or outputs these layers as separate layers), and keeps the hierarchical order of the layers unchanged.

[0225] In this way, the electronic device obtains an intermediate image by grouping and pre-compositing the foreground layers. This method can effectively reduce the number of foreground layers, thereby reducing the number of layers involved in real-time synthesis in the subsequent real-time layer synthesis process, improving the efficiency of layer synthesis, reducing the drawing delay, and improving the user experience.

[0226] In some scenarios, the embodiments of the present application do not limit the execution order of the above steps S6031-S6033. For example, the electronic device may first exchange the hierarchical order of the layers, then perform composite layer synthesis, and then perform foreground layer grouping pre-synthesis (that is, the electronic device executes in the order of steps S6032-step S6031-step S6033). For another example, the electronic device may first exchange the hierarchical order of the layers, then perform foreground layer grouping pre-synthesis, and then perform composite layer synthesis (that is, the electronic device executes in the order of steps S6032-step S6033-step S6031).

[0227] It should be understood that if the hierarchical order of the layers is swapped first, the multiple layers (or masks) corresponding to the composite layer will be combined together to swap the hierarchical order of the layers.

[0228] In some scenarios, the electronic device may choose to perform one or more of the above steps S6031-S6033. For example, the electronic device reduces the number of foreground layers by exchanging the hierarchical order of the layers (i.e., the electronic device performs step S6032 alone). For another example, the electronic device reduces the number of foreground layers by grouping and pre-synthesizing the foreground layers (i.e., the electronic device performs step S6033 alone). For another example, the electronic device reduces the number of foreground layers by exchanging the hierarchical order of the layers and grouping and pre-synthesizing the foreground layers (i.e., the electronic device performs steps S6032 and S6033). For another example, the electronic device reduces the number of foreground layers by exchanging the hierarchical order of the layers and compounding the layers (i.e., the electronic device performs steps S6031 and S6032). For another example, the electronic device reduces the number of foreground layers by compounding the layers and grouping and pre-synthesizing the foreground layers (i.e., the electronic device performs steps S6031 and S6033). For another example, the electronic device reduces the number of foreground layers by synthesizing composite layers, exchanging the hierarchical order of layers, and pre-synthesizing foreground layers in groups (ie, the electronic device executes steps S6031, S6032, and S6033).

[0229] That is to say, the embodiment of the present application introduces three foreground layer preprocessing methods through the above steps S6031 to S6033. The execution order and execution number of these three preprocessing methods are not limited in the embodiment of the present application.

[0230] S604: The electronic device pre-processes the background layer.

[0231] In some embodiments, during painting or image processing, the user generally only operates the content on the activated layer, and does not change the content of the background layer. Then, after determining the activated layer, the electronic device can perform pre-synthesis on the background layer in a synthesis order from bottom to top to generate an intermediate image. It can be seen that the electronic device did not change the layer synthesis order during the pre-synthesis process, so in the subsequent real-time layer synthesis process, the electronic device synthesizes the intermediate image and the layers above the intermediate image in a bottom-up order, which can ensure the accuracy of the final synthesis result.

[0232] In some examples, the electronic device may apply for a temporary texture during the process of preprocessing the background layer. After that, after generating the intermediate image, the electronic device may save the intermediate image to the temporary texture. In some examples, during the process of preprocessing the background layer, the electronic device may also directly synthesize the background layer onto the temporary texture.

[0233] In some embodiments, the electronic device executes the above step S6032 to exchange the hierarchical order of the layers, and changes the hierarchical order of some foreground layers that meet the exchange conditions to background layers. Therefore, in the background layer pre-synthesis process, the electronic device pre-synthesizes the background layer including the layers with the hierarchical order of these layers changed.

[0234] For example, Fig.10 As shown, after the electronic device exchanges the hierarchical order of the foreground layers that partially meet the exchange conditions with the activated layers, a layer list is obtained, and the background layers in the layer list include the layers that meet the exchange conditions in the hierarchical order of the partially exchanged layers. After that, the electronic device performs a background layer preprocessing stage, and synthesizes the current background layers into an intermediate image in a bottom-up order.

[0235] It should be understood that if the electronic device, after grouping and pre-synthesizing the foreground layer, swaps the hierarchical order of the intermediate image 1 generated after the grouping and pre-synthesis with the active layer, the intermediate image 1 is transformed into the background layer. Then, in the process of pre-processing the background layer to generate the intermediate image, the electronic device pre-synthesizes the intermediate image 1 with other background layers to generate the intermediate image 2.

[0236] In this way, the electronic device can effectively reduce the number of foreground layers and background layers that subsequently participate in real-time layer synthesis by pre-synthesizing the background layer, thereby improving the performance of layer synthesis.

[0237] In this way, the electronic device can generate at least one intermediate image among the intermediate images satisfying the composite layer combination conditions, the intermediate images satisfying the combination conditions, the intermediate images corresponding to the background layer, etc. through the above-mentioned steps S603 and S604, and participate in the subsequent real-time layer synthesis.

[0238] S605: The electronic device performs real-time layer synthesis.

[0239] In some embodiments, during the process of preprocessing the layers in the layer list, the electronic device can obtain the user's modification of the content in the activated layer in response to the user's operation. In response to the user's modification operation, the electronic device synthesizes the current activated layer, the unpreprocessed layer, and the intermediate image in real time to obtain and display the corresponding real-time synthesized layer, thereby providing the user with a real-time modification effect.

[0240] It should be understood that through the preprocessing process of steps S602 to S604 above, the layer list synthesized in real time by the electronic device may not include unpreprocessed layers, that is, all foreground layers and background layers have been synthesized into corresponding intermediate images through preprocessing.

[0241] For example, Fig.13As shown, in the real-time processing stage, the electronic device obtains a layer list, which includes an intermediate image B[1] corresponding to the pre-synthesized background layer, an activated layer B[2], and foreground layers A[m+1]-A[n], wherein the foreground layers A[m+1]-A[n] include intermediate images corresponding to the pre-synthesized background layers. The electronic device mixes the layers and intermediate images in the layer list in a bottom-up order to obtain the final mixed result.

[0242] In some examples, the electronic device may apply for a memory for storing the blending result. Afterwards, the electronic device synthesizes the intermediate image corresponding to the background layer, the activated layer, and the layer or intermediate image corresponding to the foreground layer into the applied memory in a bottom-up order to obtain the target image of the layer blending.

[0243] In other examples, after completing the pre-synthesis of the background layer, the electronic device can obtain an intermediate image corresponding to the background layer. Afterwards, the electronic device synthesizes the layers or intermediate images corresponding to the activated layer and the foreground layer with the intermediate image corresponding to the background layer in order from bottom to top to obtain a target image of layer mixing.

[0244] In this way, the electronic device reduces the number of layers involved in real-time layer synthesis through at least one layer preprocessing method including composite layer synthesis, layer hierarchical order exchange, foreground layer grouping pre-synthesis, and background layer pre-synthesis, effectively improves the performance of real-time synthesis, thereby reducing latency, avoiding display freezes, and improving the user experience.

[0245] Combination of the above Figure 6-Figure 13 A variety of layer preprocessing implementations provided in the embodiments of the present application are introduced in detail. The layer processing process is introduced below through several specific example scenarios.

[0246] Scene 1: The layer list includes a background layer, an active layer, and multiple foreground layers.

[0247] For example, Fig.14 As shown, the electronic device obtains the background layer 141, the activation layer 142, the foreground layer 143, the foreground layer 144 and the foreground layer 145 which are set in sequence. Afterwards, the electronic device synthesizes the foreground layer 143, the foreground layer 144 and the foreground layer 145 to generate an intermediate image 146. Afterwards, the electronic device synthesizes the background layer 141, the activation layer 142 and the intermediate image 146 to generate a target image 147.

[0248] In this way, in the preprocessing stage, the electronic device pre-synthesizes multiple foreground layers, effectively reducing the number of foreground layers involved in layer synthesis in the real-time processing stage, thereby improving the efficiency of real-time layer synthesis.

[0249] In some embodiments, the electronic device determines that the foreground layer 143, the foreground layer 144, and the foreground layer 145 meet the combination condition based on the blending modes of the foreground layer 143, the foreground layer 144, and the foreground layer 145. Afterwards, the electronic device synthesizes the foreground layer 143, the foreground layer 144, and the foreground layer 145 to generate an intermediate image 146.

[0250] In some examples, the combination condition represents that the blending order between adjacent layers can be changed.

[0251] Exemplarily, the combination of conditions is specifically characterized as follows: if the electronic device synthesizes the foreground layer 144 and the foreground layer 145 to obtain the first transition image, then synthesizes the first transition image and the foreground layer 143 to obtain the second transition image. If the electronic device synthesizes the foreground layer 143 and the foreground layer 144 to obtain the third transition image, then synthesizes the third transition image and the foreground layer 145 to obtain the fourth transition image. Then, the second transition image is consistent with the fourth transition image.

[0252] For example, Fig.11 The combination conditions shown are that if the synthesis results of the layers are the same after the layer order is changed, then these layers meet the combination conditions. For example, the blending algorithms of these layers are the same and meet the combination conditions.

[0253] In some embodiments, the electronic device determines that the exchange condition is not satisfied between the intermediate image 146 and the activation layer 142 based on the blending mode of the intermediate image 146 and the activation layer 142, and maintains the hierarchical order of the background layer 141, the activation layer 142, and the intermediate image 146. The electronic device synthesizes the background layer 141, the activation layer 142, and the intermediate image 146 to generate the target image 147. The exchange condition indicates that the hierarchical order between adjacent layers is interchangeable.

[0254] For example, Fig.14 As shown, in the real-time processing stage, the electronic device maintains the hierarchical order of the background layer 141, the activation layer 142 and the intermediate image 146, and generates the target image 147 after synthesizing the background layer 141, the activation layer 142 and the intermediate image 146.

[0255] In other embodiments, the electronic device determines that the exchange condition is satisfied between the intermediate image 146 and the activation layer 142 based on the blending mode of the intermediate image 146 and the activation layer 142. The electronic device synthesizes the intermediate image 146 and the background layer 141 to generate the intermediate image 151. Afterwards, the electronic device synthesizes the intermediate image 151 and the activation layer 142 to generate the target image 147.

[0256] For example, the exchange condition is specifically characterized as follows: the background layer 141, the activation layer 142, and the intermediate image 146 are synthesized in order from bottom to top to obtain a fifth transition image; the background layer 141, the intermediate image 146, and the activation layer 142 are synthesized in order from bottom to top to obtain a sixth transition image; wherein the fifth transition image and the sixth transition image are consistent. Fig. 9 The swap condition shown does not affect the final layer synthesis result after swapping the active layer 142 and the intermediate image 146. For example, the blending algorithm of the active layer 142 and the intermediate image 146 satisfies the swap condition.

[0257] For example, Fig.15 As shown, in the pre-processing stage, the electronic device first pre-synthesizes the foreground layer 143, the foreground layer 144 and the foreground layer 145 into the intermediate image 146, and then determines that the intermediate image 146 and the activation layer 142 meet the exchange condition, such as the mixing algorithm of the intermediate image 146 and the activation layer 142 meets the exchange condition. Then, the electronic device exchanges the hierarchical order of the activation layer 142 and the intermediate image 146, and changes the intermediate image 146 into the background layer. Afterwards, the electronic device can pre-synthesize the intermediate image 146 and the background layer 141 to generate the intermediate image 151. In this way, in the real-time processing stage, the electronic device only needs to synthesize the activation layer 142 and the intermediate image 151 to generate the target image 152, effectively reducing the number of layers involved in the real-time layer synthesis.

[0258] In some embodiments, other foreground layers may be included above the foreground layer 145, but the other foreground layers do not meet the combination conditions with the foreground layer 143, the foreground layer 144 and the foreground layer 145, and thus cannot be preprocessed. Then, in the subsequent real-time processing stage, the other foreground layers also participate in the real-time layer synthesis.

[0259] In some embodiments, in the current scene, foreground layer 143, foreground layer 144 and foreground layer 145 are foreground layers adjacent to activation layer 142. After determining that foreground layer 143 and activation layer 142 meet the exchange condition, the electronic device may first exchange the hierarchical order of foreground layer 143 and activation layer 142. Afterwards, after determining that foreground layer 144 and activation layer 142 meet the exchange condition, the electronic device may exchange the hierarchical order of foreground layer 144 and activation layer 142. Afterwards, after determining that foreground layer 145 and activation layer 142 meet the exchange condition, the electronic device may exchange the hierarchical order of foreground layer 145 and activation layer 142. That is, the electronic device may not pre-synthesize the foreground layer first, but directly exchange the foreground layer that meets the exchange condition with the background layer. It should be understood that other foreground layers may be included above foreground layer 145, but the other foreground layers and activation layer 142 do not meet the exchange condition and cannot be pre-processed. Then, in the subsequent real-time processing stage, the other foreground also participates in the real-time layer synthesis.

[0260] In some embodiments, Fig.14 As shown, the electronic device determines that the pixel parameters of the activation layer 142 have changed, and re-synthesizes the background layer 141, the activation layer 142 after the pixel parameters have changed, and the intermediate image 146 to generate another target image.

[0261] In this way, the layers involved in real-time layer synthesis only include the background layer 141, the activation layer 142 and the intermediate image 146, which effectively improves the efficiency of layer synthesis.

[0262] In some embodiments, Fig.15 As shown, the electronic device determines that the pixel parameters of the activation layer 142 have changed, and re-synthesizes the activation layer 142 and the intermediate image 151 after the pixel parameters have changed to generate another target image.

[0263] In this way, the layers involved in real-time layer synthesis only include the active layer 142 and the intermediate image 151, which effectively improves the efficiency of layer synthesis.

[0264] Scene 2: The layer list includes the background layer set, the active layer, and the foreground layer.

[0265] For example, Fig.16 As shown, the electronic device obtains a background layer set 161, an activation layer 162, and a foreground layer 163 that are set in sequence. Afterwards, the electronic device synthesizes the foreground layer 163 and the background layer set 161 to generate an intermediate image 164. Afterwards, the electronic device synthesizes the activation layer 162 and the intermediate image 164 to generate a target image 165.

[0266] In this way, in the preprocessing stage, the electronic device exchanges the hierarchical order of the foreground layer and the activation layer, transforms the foreground layer into a background layer, and pre-synthesizes it with other background layers, effectively reducing the number of foreground layers involved in layer synthesis in the real-time processing stage, thereby improving the efficiency of real-time layer synthesis.

[0267] In some examples, the background layer set 161 includes a first background layer and a second background layer arranged in sequence. Alternatively, the background layer set 161 may include a single layer obtained by synthesizing the first background layer and the second background layer.

[0268] In this way, the electronic device can first swap the hierarchical order of the foreground layer and the active layer, and then pre-synthesize the background layer; the electronic device can also first pre-synthesize the background layer, and then swap the hierarchical order of the foreground layer and the active layer, thereby flexibly implementing the layer pre-processing process.

[0269] In some examples, the foreground layer 163 is a composite layer including an associated mask layer and a foreground layer.

[0270] In this way, the composite layer in the foreground layer can also participate in and activate the hierarchical order exchange between layers, thereby effectively reducing the number of layers participating in layer synthesis in real time.

[0271] In some embodiments, Fig.16 As shown, in the preprocessing stage, the electronic device determines that the foreground layer 163 and the activation layer 162 meet the exchange condition based on the blending mode of the foreground layer 163 and the activation layer 162. Afterwards, the electronic device synthesizes the foreground layer 163 and the background layer set 161 to generate an intermediate image 164.

[0272] In some examples, the swap condition indicates that the hierarchical order of adjacent layers is interchangeable.

[0273] Exemplarily, the background layer set 161 includes a first background layer and a second background layer that are sequentially arranged. The exchange condition is specifically characterized as follows: the first background layer, the second background layer, the activation layer 162, and the foreground layer 163 are sequentially synthesized from bottom to top to obtain a first transition image. The first background layer, the second background layer, the foreground layer 163, and the activation layer 162 are sequentially synthesized from bottom to top to obtain a second transition image. The first transition image and the second transition image are consistent. For example, Fig. 9 The swap condition shown does not affect the final layer synthesis result after swapping the active layer 162 and the foreground layer 163. For example, the mixing algorithm of the active layer 162 and the foreground layer 163 meets the swap condition.

[0274] In some embodiments, the electronic device determines that the pixel parameters of the activation layer 162 have changed, and re-synthesizes the activation layer 162 and the intermediate image 164 after the pixel parameters have changed to generate another target image.

[0275] In this way, the layers involved in real-time layer synthesis only include the active layer 162 and the intermediate image 164, which effectively improves the efficiency of layer synthesis.

[0276] In some embodiments, other foreground layers may be included above the foreground layer 163, but the other foreground layers do not meet the exchange condition with the active layer 162 and cannot be preprocessed. Then, in the subsequent real-time processing stage, the other foreground layers also participate in the real-time layer synthesis.

[0277] Scene 3: The layer list includes multiple background layers, active layers, and foreground layers.

[0278] In some embodiments, Fig.17 As shown, the electronic device obtains the background layer 171, the background layer 172, the background layer 173, the activation layer 174 and the foreground layer 175 which are set in sequence. Afterwards, the electronic device synthesizes the background layer 171, the background layer 172 and the background layer 173 to generate an intermediate image 176. Afterwards, the electronic device synthesizes the foreground layer 175 and the intermediate image 176 to generate an intermediate image 177. Afterwards, the electronic device synthesizes the activation layer 174 and the intermediate image 177 to generate a target image 178.

[0279] Thus, in the preprocessing stage, the electronic device pre-synthesizes multiple background layers. In addition, the electronic device swaps the hierarchical order of the foreground layer and the active layer, transforms the foreground layer into a background layer, and then pre-synthesizes it with other background layers, effectively reducing the number of foreground layers involved in layer synthesis in the real-time processing stage, thereby improving the efficiency of real-time layer synthesis.

[0280] In some embodiments, Fig.17 As shown, in the preprocessing stage, the electronic device determines that the foreground layer 175 and the activation layer 174 meet the exchange condition based on the blending mode of the foreground layer 175 and the activation layer 174. Afterwards, the electronic device synthesizes the foreground layer 175 and the intermediate image 176 to generate an intermediate image 177.

[0281] In some examples, the swap condition indicates that the hierarchical order of adjacent layers is interchangeable.

[0282] Exemplarily, the exchange condition is specifically characterized as follows: the intermediate image 176, the activated layer 174, and the foreground layer 175 are synthesized in sequence from bottom to top to obtain a first transition image; the intermediate image 176, the foreground layer 175, and the activated layer 174 are synthesized in sequence from bottom to top to obtain a second transition image. Among them, the first transition image and the second transition image are consistent. For example, Fig. 9 The swap condition shown does not affect the final layer synthesis result after swapping the active layer 174 and the foreground layer 175. For example, the blending algorithm of the active layer 174 and the foreground layer 175 meets the swap condition.

[0283] In some embodiments, Fig.17 As shown, in the preprocessing stage, the electronic device determines that the background layer 171, the background layer 172 and the background layer 173 meet the combination condition based on the mixing modes of the background layer 171, the background layer 172 and the background layer 173. Afterwards, the electronic device synthesizes the background layer 171, the background layer 172 and the background layer 173 to generate an intermediate image 176.

[0284] In some examples, the combination condition represents that the blending order between adjacent layers can be changed.

[0285] Exemplarily, the combined conditions are specifically characterized as follows: the background layer 171 and the background layer 172 are synthesized to obtain a third transition image; the third transition image and the background layer 173 are synthesized to obtain a fourth transition image. The background layer 172 and the background layer 173 are synthesized to obtain a fifth transition image; the fifth transition image and the background layer 171 are synthesized to obtain a sixth transition image. The fourth transition image and the sixth transition image are consistent.

[0286] For example, Fig.11 The combination conditions shown are that if the synthesis results of the layers are the same after the layer order is changed, then these layers meet the combination conditions. For example, the blending algorithms of these layers are the same and meet the combination conditions.

[0287] In some embodiments, other foreground layers may be included above the foreground layer 175, but the other foreground layers do not meet the exchange condition with the active layer 174 and cannot be pre-processed. Then, in the subsequent real-time processing stage, the other foreground layers also participate in the real-time layer synthesis.

[0288] In some scenarios, the electronic device displays a 4K canvas, and in response to user operations, the layer at the bottom layer is determined as the activated layer. Then, the current layer list does not include the background layer, but only includes the activated layer and the foreground layer above the activated layer. Taking the layer blending mode as the positive film overlay as an example, as shown in Table 3, when the number of layers included in the layer list is different, if the layers are mixed according to the original scheme that all layers participate in the real-time synthesis of the layers, as the number of layers increases, the number of frames per second (FPS) transmitted by the electronic device, that is, the frame rate, decreases accordingly, resulting in abnormal jams in the display of the electronic device. Moreover, when the number of layers is small, a good frame rate display effect cannot be obtained. If the electronic device preprocesses the layers, the number of layers participating in the real-time synthesis can be at least 2 layers, then the frame rate of the electronic device can be maintained at a higher frame rate display effect, improving the user experience.

[0289] Table 3

[0290]

[0291]

[0292] Combination of the above Figure 6-Figure 17 The layer synthesis method provided by the embodiment of the present application is described in detail. Fig.18 The electronic device provided by the embodiments of the present application is described in detail.

[0293] In one possible design, Fig.18 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.18 As shown, the electronic device 1800 may include: a transceiver unit 1801 and a processing unit 1802. The electronic device 1800 may be used to implement the functions of the electronic device involved in the above method embodiment.

[0294] In some examples, the transceiver unit 1801 is used to support the electronic device 1800 to perform Figure 6 S601 in.

[0295] In some examples, the processing unit 1802 is used to support the electronic device 1800 to execute Figure 6 S602, S603, S604 and S605 in; and / or, for supporting the electronic device 1800 to execute Figure 7 S6031, S6032 and S6033.

[0296] Among them, the transceiver unit may include a receiving unit and a sending unit, and may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module. The operations and / or functions of each unit in the electronic device 1800 are respectively to implement the corresponding process of the layer synthesis method described in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, they will not be repeated here.

[0297] In some examples, Fig.18 The electronic device 1800 shown may also include a storage unit ( Fig.18 (not shown), the storage unit stores a program or instruction. When the transceiver unit 1801 and the processing unit 1802 execute the program or instruction, Fig.18 The electronic device 1800 shown can execute the layer synthesis method described in the above method embodiment.

[0298] Fig.18 The technical effects of the electronic device 1800 shown can refer to the technical effects of the layer synthesis method described in the above method embodiment, and will not be repeated here.

[0299] In addition to being in the form of electronic device 1800, the technical solution provided in the present application may also be a functional unit or chip in the electronic device, or a device used in conjunction with the electronic device.

[0300] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.

[0301] In some examples, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0302] In some examples, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. For example, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.

[0303] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0304] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0305] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is run on a computer, the computer executes the above-mentioned related steps to implement the layer synthesis method in the above-mentioned embodiment.

[0306] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the layer synthesis method in the above-mentioned embodiment.

[0307] In addition, an embodiment of the present application further provides a device. The device may be a component or a module, and the device may include one or more processors and a memory connected to each other. The memory is used to store a computer program. When the computer program is executed by one or more processors, the device executes the layer synthesis method in the above-mentioned method embodiments.

[0308] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0309] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).

[0310] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0311] In the several embodiments provided in the present application, it should be understood that the disclosed method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of modules or units, which can be electrical, mechanical or other forms.

[0312] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0313] Computer-readable storage media include, but are not limited to, any of the following: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media that can store program codes.

[0314] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A layer synthesis method, applied to electronic equipment, It is characterized in that The method comprises: Get the background layer, active layer, first foreground layer, second foreground layer and third foreground layer set in sequence; synthesizing the first foreground layer, the second foreground layer and the third foreground layer to generate a first intermediate image; The background layer, the activation layer and the first intermediate image are synthesized to generate a first target image.

2. The method according to claim 1, It is characterized in that Before synthesizing the first foreground layer, the second foreground layer and the third foreground layer to generate a first intermediate image, the method further includes: Based on the blending modes of the first foreground layer, the second foreground layer and the third foreground layer, it is determined that the first foreground layer, the second foreground layer and the third foreground layer satisfy a combination condition; the combination condition indicates that a blending order between the adjacent multiple layers can be changed.

3. The method according to claim 2, It is characterized in that The binding conditions are specifically characterized by: synthesizing the second foreground layer and the third foreground layer to obtain a first transition image; synthesizing the first transition image and the first foreground layer to obtain the second transition image; synthesizing the first foreground layer and the second foreground layer to obtain a third transition image; synthesizing the third transition image and the third foreground layer to obtain a fourth transition image; The second transition image is consistent with the fourth transition image.

4. The method according to any one of claims 1 to 3, It is characterized in that Generating the first target image comprises: Based on the blending mode of the first intermediate image and the activation layer, determining that the first intermediate image and the activation layer do not satisfy an exchange condition, and maintaining the hierarchical order of the background layer, the activation layer, and the first intermediate image; the exchange condition indicates that the hierarchical order of adjacent layers is interchangeable; The background layer, the activation layer and the first intermediate image are synthesized to generate the first target image.

5. The method according to any one of claims 1 to 3, It is characterized in that Generating the first target image comprises: Based on a blending mode of the first intermediate image and the activated layer, determining that an exchange condition is satisfied between the first intermediate image and the activated layer; the exchange condition indicates that the hierarchical order of adjacent layers is interchangeable; synthesizing the first intermediate image and the background layer to generate a second intermediate image; The second intermediate image and the activated layer are synthesized to generate the first target image.

6. The method according to claim 4 or 5, It is characterized in that The exchange conditions are specifically characterized by: The background layer, the active layer, and the first intermediate image are synthesized in order from bottom to top to obtain a fifth transition image; The background layer, the first intermediate image, and the activation layer are synthesized in sequence from bottom to top to obtain a sixth transition image; The fifth transition image and the sixth transition image are consistent.

7. A layer synthesis method, applied to electronic equipment, It is characterized in that The method comprises: Get the background layer set, the active layer and the first foreground layer set in order; Combining the first foreground layer and the background layer set to generate a first intermediate image; The activated layer and the first intermediate image are synthesized to generate a first target image.

8. The method according to claim 7, It is characterized in that The background layer set includes a first background layer and a second background layer which are arranged in sequence.

9. The method according to claim 8, It is characterized in that Before synthesizing the first foreground layer and the background layer set to generate a first intermediate image, the method further includes: Based on the blending mode of the first foreground layer and the activation layer, it is determined that the first foreground layer and the activation layer satisfy an exchange condition; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable.

10. The method according to claim 9, It is characterized in that The exchange conditions are specifically characterized by: The first background layer, the second background layer, the activation layer and the first foreground layer are synthesized in sequence from bottom to top to obtain a first transition image; The first background layer, the second background layer, the first foreground layer and the activation layer are synthesized in sequence from bottom to top to obtain a second transition image; The first transition image and the second transition image are consistent.

11. The method according to any one of claims 7 to 10, It is characterized in that The first foreground layer is a composite layer, and the composite layer includes an associated mask layer and a foreground layer.

12. The method according to any one of claims 7 to 11, It is characterized in that The method further comprises: Determine the pixel parameter change of the activation layer, re-synthesize the activation layer after the pixel parameter change and the first intermediate image, and generate a second target image.

13. A layer synthesis method, applied to electronic equipment, It is characterized in that The method comprises: Get the first background layer, the second background layer, the third background layer, the active layer and the first foreground layer which are set in sequence; Combining the first background layer, the second background layer and the third background layer to generate a first intermediate image; synthesizing the first foreground layer and the first intermediate image to generate a second intermediate image; The activated layer and the second intermediate image are synthesized to generate a first target image.

14. The method according to claim 13, It is characterized in that Before synthesizing the first foreground layer and the first intermediate image to generate a second intermediate image, the method further includes: Based on the blending mode of the first foreground layer and the activation layer, it is determined that the first foreground layer and the activation layer satisfy an exchange condition; the exchange condition indicates that the hierarchical order between adjacent layers is interchangeable.

15. The method according to claim 14, It is characterized in that The exchange conditions are specifically characterized by: The first intermediate image, the activation layer, and the first foreground layer are synthesized in sequence from bottom to top to obtain a first transition image; The first intermediate image, the first foreground layer and the activated layer are synthesized in sequence from bottom to top to obtain a second transition image; The first transition image and the second transition image are consistent.

16. The method according to any one of claims 13 to 15, It is characterized in that Before synthesizing the first background layer, the second background layer and the third background layer to generate the first intermediate image, the method further includes: Based on the blending modes of the first background layer, the second background layer and the third background layer, it is determined that the first background layer, the second background layer and the third background layer satisfy a combination condition; the combination condition indicates that the blending order between the adjacent multiple layers can be changed.

17. The method according to claim 16, It is characterized in that The binding conditions are specifically characterized by: The first background layer and the second background layer are synthesized to obtain a third transition image; the third transition image and the third background layer are synthesized to obtain a fourth transition image; The second background layer and the third background layer are synthesized to obtain a fifth transition image; the fifth transition image and the first background layer are synthesized to obtain a sixth transition image; The fourth transition image is consistent with the sixth transition image.

18. An electronic device, It is characterized in that include: A processor and a memory, wherein the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the electronic device executes the method as described in any one of claims 1 to 6; or, the electronic device executes the method as described in any one of claims 7 to 12; or, the electronic device executes the method as described in any one of claims 13 to 17.

19. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a computer program, which, when executed on an electronic device, enables the electronic device to execute a method as described in any one of claims 1 to 6; or enables the electronic device to execute a method as described in any one of claims 7 to 12; or enables the electronic device to execute a method as described in any one of claims 13 to 17.

20. A computer program product, It is characterized in that When the computer program product runs on a computer, the computer is caused to execute the method as described in any one of claims 1 to 6; or, the computer is caused to execute the method as described in any one of claims 7 to 12; or, the computer is caused to execute the method as described in any one of claims 13 to 17.