Photographing preview method and apparatus, device, medium, and program product

WO2026166459A1PCT designated stage Publication Date: 2026-08-13BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2026-02-04
Publication Date
2026-08-13

Smart Images

  • Figure CN2026076966_13082026_PF_FP_ABST
    Figure CN2026076966_13082026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a photographing preview method and apparatus, a device, a medium, and a program product. The method comprises: in response to a photographing preview event, generating a preview image on the basis of an original image and a preset layer configuration file, and displaying the preview image in a preview interface, wherein the preset layer configuration file comprises editing logic of an editing item corresponding to at least one layer, and the editing item is used for characterizing a layer editing manner; in response to a trigger operation on the preview interface, determining a target layer; and in response to an editing operation on the target layer, acquiring editing parameters, editing the target layer on the basis of the editing parameters and the editing logic, and updating the preview image on the basis of the edited target layer.
Need to check novelty before this filing date? Find Prior Art

Description

A method, apparatus, device, medium, and program product for shooting preview.

[0001] Cross-references to related applications

[0002] This application claims priority to Chinese Patent Application No. 202510134497.4, filed on February 6, 2025, entitled "A Method, Apparatus, Device, Medium and Program Product for Taking Pictures and Previewing," the entire contents of which are incorporated herein by reference. Technical Field

[0003] This disclosure relates to image technology, and more particularly to a shooting preview method, apparatus, device, medium, and program product. Background Technology

[0004] Currently, the camera can capture the raw image of the subject. This raw image is then rendered onto the screen for preview. The preview image can be edited to optimize the display. Editing methods include, but are not limited to, at least one of the following: editing preview image properties, adding stickers, adding text, or adding special effects. Summary of the Invention

[0005] This disclosure provides a shooting preview method, apparatus, device, medium, and program product.

[0006] In a first aspect, embodiments of this disclosure provide a shooting preview method, including:

[0007] In response to a shooting preview event, a preview image is generated based on the original image and a preset layer configuration file, and the preview image is displayed in the preview interface. The preset layer configuration file includes editing logic for at least one layer's corresponding editing item, and the editing item is used to characterize the layer editing method.

[0008] In response to a trigger operation in the preview interface, a target layer is determined, wherein the target layer represents the layer that is selected among the at least one layers;

[0009] In response to an editing operation on the target layer, editing parameters are obtained, the target layer is edited according to the editing parameters and the editing logic, and the preview image is updated according to the edited target layer.

[0010] Secondly, this disclosure also provides a shooting preview device, which includes:

[0011] A preview image generation module is used to generate a preview image based on the original image and a preset layer configuration file in response to a shooting preview event, and to display the preview image in the preview interface. The preset layer configuration file includes editing logic for at least one layer's corresponding editing item, and the editing item is used to characterize the layer editing method.

[0012] A target layer determination module is used to determine a target layer in response to a trigger operation in the preview interface, wherein the target layer represents the layer that is selected among the at least one layers;

[0013] The layer editing module is used to respond to the editing operation on the target layer, obtain editing parameters, edit the target layer according to the editing parameters and the editing logic, and update the preview image according to the edited target layer.

[0014] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:

[0015] One or more processors;

[0016] Storage device for storing one or more programs.

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the shooting preview method as described in any embodiment of this disclosure.

[0018] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the shooting preview method as described in any embodiment of this disclosure.

[0019] Fifthly, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the shooting preview method as described in any embodiment of this disclosure.

[0020] The shooting preview method provided in this disclosure, in response to a shooting preview event, generates a preview image based on an original image and a preset layer configuration file, and displays the preview image in a preview interface. The preset layer configuration file includes editing logic for at least one layer's corresponding editing items. In response to a trigger operation in the preview interface, a target layer is determined. In response to an editing operation on the target layer, editing parameters are obtained, the target layer is edited according to the editing parameters and editing logic, and the preview image is updated based on the edited target layer. By adopting the above technical solution, multiple layers can be pre-configured using a preset layer configuration file, and the editing logic for the editing items corresponding to each layer can be configured. Therefore, when a shooting preview event is triggered, a preview image can be generated based on the original image and the preset layer configuration file, and the target layer can be determined based on the trigger operation. The target layer can be edited independently without affecting the content of other layers, and the preview image can be updated based on the edited target layer. Attached Figure Description

[0021] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0022] Figure 1 is a schematic flowchart of a shooting preview method provided in an embodiment of this disclosure;

[0023] Figure 2 is a schematic diagram of a layer tree structure provided in an embodiment of this disclosure;

[0024] Figure 3 is a schematic diagram of a preview interface provided in an embodiment of this disclosure;

[0025] Figure 4 is a flowchart illustrating another shooting preview method provided in an embodiment of this disclosure;

[0026] Figure 5 is a schematic diagram of a preview image position-following layout method provided in an embodiment of this disclosure;

[0027] Figure 6 is a flowchart illustrating another shooting preview method provided in an embodiment of this disclosure;

[0028] Figure 7 is a schematic diagram of a shooting preview device provided in an embodiment of this disclosure;

[0029] Figure 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0030] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0031] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0032] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0033] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0034] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0035] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0036] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0037] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0038] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0039] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0040] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0041] The above-described editing operations on the preview image are one-way; that is, after editing attribute A of the preview image, the operation of adding sticker materials is performed, and it is not possible to return to edit attribute A of the preview image again after adding sticker materials. This editing method fails to meet users' editing needs and lacks editing flexibility.

[0042] Figure 1 is a schematic flowchart of a shooting preview method provided in an embodiment of this disclosure. This embodiment is applicable to situations where the subject being photographed is previewed and edited, such as a scenario where the subject captured by the camera is previewed and edited. This method can be executed by a shooting preview device, which can be implemented in software and / or hardware, optionally through an electronic device, such as a mobile terminal.

[0043] As shown in Figure 1, the method includes:

[0044] S110. In response to the shooting preview event, generate a preview image based on the original image and the preset layer configuration file, and display the preview image in the preview interface.

[0045] The preset layer configuration file includes editing logic for at least one layer's corresponding editing items. The at least one layer includes camera layers, sticker layers, text layers, and filter layers, etc. The editing items characterize the layer editing methods. For example, editing items include, but are not limited to, at least one of color adjustment, deformation, and special effects for the layer's content. The editing logic is the implementation method of the editing items. The editing logic includes, but is not limited to, filter functions that implement at least one editing method such as color adjustment, deformation, and special effects.

[0046] In this embodiment of the disclosure, a preset layer configuration file can represent the configuration information of the layer tree. The layer tree represents layer groups and the layers included in the layer groups in a tree structure. A layer is a child node of the corresponding layer group. The editing logic of the editing item corresponding to the layer is the child node of the layer. Figure 2 is a schematic diagram of the structure of a layer tree provided in this embodiment of the disclosure. As shown in Figure 2, the child nodes of the root node layer 210 of the layer tree 200 include several layer groups 220. Layer group 220 includes several layers 230. The child nodes of layer 230 include several editing logics 240.

[0047] The capture preview event is used to trigger a preview operation on the subject being captured. For example, if the camera detects a new subject being captured, the capture preview event is triggered. Or, if the original subject being captured by the camera is detected to have changed, the capture preview event is triggered.

[0048] The original image refers to a picture or video frame of the subject captured by the camera without any image editing. The preview image refers to a picture or video frame displayed on the screen. It should be noted that the preview image includes not only pictures or video frames of the subject but also at least one effect element such as stickers, text, or special effects. Effect elements are added to the preview image through layer overlay. In this embodiment, the original image is used as input data for the camera layer. Image editing is performed on the original image using the editing logic of the editing items corresponding to the camera layer. The edited image data is then rendered to the screen to obtain the preview image. The preview interface represents the display interface of the preview image.

[0049] For example, in response to a capture preview event, generating a preview image based on the original image and a preset layer configuration file includes: triggering a capture preview event if a new original image is detected by the camera; and rendering the layer based on the original image and the preset layer configuration file in response to the capture preview event to obtain a preview image corresponding to the original image.

[0050] In some embodiments, the processor establishes a connection with the camera via a defined interface. The camera compares a new frame of the subject image acquired by the camera with a previous frame of the subject image. If the subject is different, the camera reports the new original image of the subject. Alternatively, if the subject is the same, but information such as the subject's position or posture has changed, the camera reports a new original image of the subject. If the camera reports a new original image, a shooting preview event is triggered. The processor then acquires the new original image reported by the camera.

[0051] In other embodiments, the processor creates a camera session for managing the camera. A listener can be registered in the camera session to listen for events indicating that the camera has acquired a new frame of raw image. This new frame of raw image includes images where the subject differs from previously acquired raw images, or images where the subject is the same but its position or pose is different. This listener is triggered each time the camera acquires a new raw image. When the listener is triggered, a preview event is triggered. The processor then retrieves the new raw image from the camera via a callback function.

[0052] The new original image is used as input data for the camera layer. The original image is then edited using the editing logic corresponding to the camera layer's editing options in the preset configuration file, resulting in a preview image. This preview image is then rendered and displayed in the preview interface.

[0053] In this embodiment of the disclosure, if a shooting preview event is triggered, the camera layer is used as the target layer. The input of the camera layer is updated based on the new original image, and the original image is edited according to the filter function corresponding to the editing item of the camera layer. The edited image is then rendered to update the preview image in the preview interface.

[0054] S120. In response to the trigger operation in the preview interface, determine the target layer.

[0055] The target layer represents the selected layer among the at least one layers. A set of candidate layer controls is displayed in the preview interface, including candidate layer controls corresponding to at least one layer. The candidate layer controls are used to select a target layer from the at least one layer. Triggering operations in the preview interface include layer selection operations or image processing operations. Layer selection operations can include interactive operations on candidate layer controls. For example, a layer selection operation includes clicking a candidate layer control to set the layer corresponding to the candidate layer control as the target layer. Further editing can be performed on the target layer. Image processing operations represent image processing of the preview image, with the layer associated with the image processing operation as the target layer. For example, if image processing is performed on a sticker in the preview image, the layer corresponding to the sticker is set as the target layer. Or, if image processing is performed on a target object in the preview image, the layer corresponding to the target object is set as the target layer.

[0056] Figure 3 is a schematic diagram of a preview interface provided in an embodiment of this disclosure. As shown in Figure 3, a set of candidate layer controls 320 is displayed in the preview interface 310. If a candidate layer control in the set of candidate layer controls 320 is clicked, the clicked candidate layer control is converted to a selected state, and the layer corresponding to the clicked candidate layer control is taken as the target layer.

[0057] For example, in response to a trigger operation in the preview interface, determining a target layer includes: displaying a set of candidate layer controls in the preview interface, the set of candidate layer controls including candidate layer controls, wherein the candidate layer controls are used to select the target layer from the at least one layer; in response to a selection operation on the set of candidate layer controls, taking the layer corresponding to the selected candidate layer control as the target layer, and displaying a set of candidate materials corresponding to the target layer in the preview interface; and in response to a selection operation on the set of candidate materials, rendering the target layer based on the target materials.

[0058] The candidate material set includes candidate materials, which are associated with the layer type. For example, if the target layer is a sticker layer, the candidate materials include stickers. If the target layer is a text layer, the candidate materials include artistic fonts. This disclosure does not specifically limit the meaning of the candidate materials.

[0059] In some embodiments, a set of candidate layer controls is displayed in the preview interface. This set includes, but is not limited to, at least one of sticker layer controls, text layer controls, and effect layer controls. In response to a click operation on a sticker layer control, the sticker layer corresponding to the sticker layer control is selected as the target layer. A set of candidate stickers is displayed in the preview interface. In response to a selection operation on the set of candidate stickers, a target sticker is determined, and a sticker layer is rendered based on the target sticker. Here, the target sticker represents the selected candidate sticker from the set of candidate stickers.

[0060] In other embodiments, in response to a click operation on a text layer control, the text layer corresponding to the text layer control is used as the target layer. In response to a text input operation on the target layer, the text layer is rendered based on the input text.

[0061] Optionally, determining the target layer in response to a trigger operation in the preview interface includes:

[0062] In response to an image processing operation in the preview interface, the layer corresponding to the image processing operation is designated as the target layer. A set of candidate materials corresponding to the target layer is displayed in the preview interface. In response to a selection operation on the set of candidate materials, the target layer is rendered based on the target material.

[0063] For example, in response to an image processing operation in the preview interface, where the image processing operation is associated with at least one layer of the preview image, the layer corresponding to the image processing operation is designated as the target layer.

[0064] S130. In response to the editing operation on the target layer, obtain editing parameters, edit the target layer according to the editing parameters and the editing logic, and update the preview image according to the edited target layer.

[0065] In this embodiment of the disclosure, the editing operation on the target layer includes editing the layer content of the target layer. Editing parameters characterize the parameters of the editing item corresponding to the editing operation. Optionally, the editing parameters include at least one of image editing methods such as color adjustment parameters, deformation degree, and special effects parameters. At least one editing item, such as a color editing item, deformation editing item, and special effects editing item, corresponding to the target layer is displayed in the preview interface. Optionally, the editing parameters can be adjusted based on the sliding operation of the slider control corresponding to the editing item. In response to the sliding operation of the slider control, the offset of the corresponding editing item is adjusted, and the editing parameters are determined based on the offset. The offset characterizes the distance by which the slider in the slider control is offset relative to its original position due to the sliding operation. The editing parameters are determined based on the offset distance. Alternatively, the offset characterizes the value or adjustment degree corresponding to the stop position of the slider in the slider control corresponding to the sliding operation. The value or adjustment degree is applied to the layer content of the target layer through editing logic to adjust the display effect of the layer content.

[0066] For example, the preview interface displays a set of candidate editing controls corresponding to the target layer, wherein the candidate editing controls are used to adjust the editing parameters of the editing item. In response to an adjustment operation on the target editing control, the editing parameters of the target editing item corresponding to the target editing control are obtained, wherein the target editing control represents the candidate editing control being adjusted in the set of candidate editing controls. Based on the target layer and the target editing item, the editing logic corresponding to the target editing item in the preset configuration file is determined. The target layer is edited according to the editing logic and editing parameters corresponding to the target editing item, and the preview image is updated based on the edited target layer.

[0067] The preview interface displays a set of candidate editing controls for the editable items corresponding to the target layer. Optionally, the set of candidate editing controls may include at least one control such as a slider control, a drop-down control, or a color adjustment control. The color adjustment control represents the color adjustment editable item corresponding to the target layer. In response to an adjustment operation on the color adjustment control, the selected target color is determined based on the adjustment operation. The editing logic corresponding to the color adjustment editable item is determined based on the preset configuration file, the target layer, and the color adjustment editable item. Combining the editing logic corresponding to the color adjustment editable item and the target color, the layer content in the target layer is edited, and the edited target layer and the remaining layers are overlaid to update the preview image.

[0068] In response to adjustments made to the target slider control, the slider is controlled to slide within the slider control. When the slider stops sliding, an offset is determined based on the slider's position and the starting position of the slide. The editing parameters for the target editable item are then determined based on this offset. The editing logic corresponding to the target editable item is determined based on the preset configuration file, the target layer, and the target editable item. Combining the editing logic and parameters corresponding to the target editable item, the layer content in the target layer is edited, and the edited sticker layer and the remaining layers are overlaid to update the preview image.

[0069] Optionally, candidate layout types for the target layer are displayed in the preview interface, including fill layout, fixed layout, or position-following layout. In response to a selection operation for a candidate layout type, the selected candidate layout type is used as the target layout type. The layout information of the target layer is adjusted according to the target layout type.

[0070] It should be noted that the target layer includes camera layers, sticker layers, filter layers, or text layers, etc. Since each layer has its own corresponding editing logic, editing operations on the target layer will not affect other layers. After performing an editing operation on a layer, if you need to return to re-edit that layer, you only need to select the layer to be edited using the candidate layer control. There is no need for region recognition operations, nor is it necessary to re-acquire the original image from the camera and start processing again, greatly reducing the consumption of processing resources.

[0071] For example, the preview interface displays a set of candidate editing controls corresponding to the preview image and the camera layer. These candidate editing controls can include deformation controls and special effects controls. Deformation controls are used to adjust the shape of the layer content. For example, the deformation control corresponding to the camera layer can change the shape of a specific area of ​​the target object. The target object can include a real human portrait, a cartoon character, a model-generated character, a real animal, a cartoon animal, or a model-generated animal. Special effects controls are used to adjust at least one of the following: clarity, contrast, transparency, saturation, and shadow effects of the layer content. In response to interactive operations on the eye editing controls for the human face area, eye editing parameters are obtained. The human face area in the preview image is edited using the eye editing parameters and the editing logic corresponding to the eye editing item to update the preview image's display effect. Alternatively, in response to interactive operations on the deformation controls for the human face area, deformation parameters are obtained. The human face area in the preview image is deformed using the deformation parameters and the editing logic corresponding to the deformation editing item to update the preview image's display effect.

[0072] Furthermore, in response to a click on the sticker layer control, the sticker layer is selected, and the camera layer is deselected. A set of candidate materials corresponding to the sticker layer is displayed in the preview interface. Candidate materials include sticker materials, etc. In response to a selection operation on the candidate material set, the selected sticker material is used as the target sticker material. The target sticker material is used as input data for the sticker layer to render the sticker layer based on it. The sticker layer and camera layer are overlaid to adjust the display effect of the preview image according to the target sticker material. A preview image with the target sticker material and a set of candidate editing controls corresponding to the sticker layer are displayed in the preview interface. Candidate editing controls may include at least one control such as color adjustment controls, deformation controls, and special effects controls. The color adjustment control is used to adjust the color of the target sticker material. In response to an interaction with the color adjustment control, the target color parameters of the target sticker material are obtained. The target sticker material is adjusted in color by combining the target color parameters and the editing logic corresponding to the color adjustment editing item to update the target sticker material in the preview image, thereby updating the display effect of the preview image.

[0073] Furthermore, in response to a click on the text layer control, the text layer is selected, and the sticker layer is deselected. A set of candidate materials for the text layer is displayed in the preview interface. These candidate materials include text templates with different fonts. In response to a selection operation on the candidate material set, text content is input based on the selected text template. The text content is used as input data for the text layer to render it. The text layer, sticker layer, and camera layer are overlaid to adjust the display effect of the preview image according to the text content. The preview interface not only displays a preview image with text content and the target sticker material but also a set of candidate editing controls. These candidate editing controls include, but are not limited to, at least one of color adjustment controls, deformation controls, and special effects controls. In response to an interaction with the deformation control, the deformation parameters of the text content are determined. The text content is shaped and adjusted using the deformation parameters and deformation filter functions to update the text content in the preview image, thus updating the preview image's display effect.

[0074] After editing the text content of the text layer, if you need to return and readjust the eye area of ​​the target object in the preview image, you can select the camera layer through the candidate layer control set in the preview interface, and obtain new eye editing parameters based on the interactive operation of the eye editing control corresponding to the camera layer. Then, update the eye area of ​​the preview image based on the new eye editing parameters and editing logic.

[0075] The technical solution of this disclosure, in response to a shooting preview event, generates a preview image based on the original image and a preset layer configuration file, and displays the preview image in a preview interface. The preset layer configuration file includes editing logic for at least one layer's corresponding editing items. In response to a trigger operation in the preview interface, a target layer is determined. In response to an editing operation on the target layer, editing parameters are obtained, and the target layer is edited according to the editing parameters and editing logic. The preview image is then updated based on the edited target layer. By adopting the above technical solution, multiple layers can be pre-configured using a preset layer configuration file, and the editing logic for the editing items corresponding to each layer can be configured. Thus, when a shooting preview event is triggered, a preview image can be generated based on the original image and the preset layer configuration file, and the target layer can be determined based on the trigger operation. The target layer can be edited independently without affecting the content of other layers, and the preview image can be updated based on the edited target layer. This allows for flexible selection of layers for editing, and after editing, one can return to the previously edited layer for re-editing, solving the problem of the lack of flexibility in general preview image editing methods.

[0076] Figure 4 is a flowchart illustrating another shooting preview method provided by an embodiment of this disclosure. Based on the above embodiments, this disclosure adds and defines related steps for adjusting the layer layout. As shown in Figure 4, the method includes:

[0077] S410, in response to a shooting preview event, generates a preview image based on the original image and a preset layer configuration file, and displays the preview image in the preview interface.

[0078] The preset layer configuration file includes editing logic for at least one layer's corresponding editing item, which is used to characterize the layer editing method.

[0079] S420. In response to a trigger operation in the preview interface, a target layer is determined, wherein the target layer represents the layer that is selected among the at least one layers.

[0080] S430. In response to the editing operation on the target layer, obtain editing parameters, edit the target layer according to the editing parameters and the editing logic, and update the preview image according to the edited target layer.

[0081] S440, Obtain the new original image.

[0082] The new original image includes the target object.

[0083] For example, a new original image is obtained by querying the camera cache or a callback function. If the new original image is a picture or video frame with the same subject as the preview image but a different pose, a layer shift event is triggered to perform subsequent operations to adjust the position of the layer to be shifted. For example, the position of the target person's face in the new original image is different from that in the preview image. Or, the position of the target person in the new original image is different from that in the preview image.

[0084] S450. Determine the layer to be shifted based on the layout type of the at least one layer and the target object.

[0085] This disclosure allows setting layout types for each layer and also allows setting a global layout type. The global layout type can apply to multiple layers. That is, by configuring the global layout type and the multiple layers corresponding to the global layout type, the layout types of the multiple layers are determined. Based on the positional correspondence between at least one layer and the target object in the original image, and the layout type, the layer to be shifted among at least one layer is determined. For example, if the global layout type is set to a position-following layout, and the layers corresponding to the position-following layout include layer A, layer B, layer C, and layer D, then if the position of the target object changes, or the position of the target object's face changes, the layer among layers A, B, C, and D that has a positional correspondence with the target object is selected as the layer to be shifted. For example, if there is a sticker 'a' on a person's face, and the position of the person's face changes, the sticker layer corresponding to sticker 'a' is selected as the layer to be shifted to maintain the relative position of sticker 'a' to the person's face.

[0086] S460. Update the position of the layer to be shifted according to the position information of the target object in the new original image, and update the preview image corresponding to the new original image according to the updated layer to be shifted.

[0087] For example, based on the position information of the portrait in the preview image and the position information of the layer content in the layer to be shifted, the positional correspondence between the portrait and the layer content in the layer to be shifted is determined. Based on the position information of the portrait in the new original image and the positional correspondence, the positional offset information of the layer content in the layer to be shifted is determined. The position of the layer to be shifted is updated based on the positional offset information. The position-updated layer to be shifted and the remaining layers are superimposed to update the display position of the layer to be shifted in the preview image corresponding to the new original image.

[0088] Figure 5 is a schematic diagram of a preview image position-following layout method provided in an embodiment of this disclosure. As shown in Figure 5, a sticker material 520 is provided on the left side of the portrait face in the preview image 510, and target text 530 is provided on the head of the preview image 510. If the portrait in the new original image tilts its head to the right, the position of the sticker layer is adjusted to maintain the relative positional relationship between the sticker material 520 and the portrait face.

[0089] The technical solution of this disclosure involves acquiring a new original image, determining the layer to be shifted based on the layout type of at least one layer, updating the position of the layer to be shifted based on the position information of the target object in the new original image, and updating the preview image corresponding to the new original image based on the updated layer to be shifted. This technical solution allows for the determination of the layer to be shifted from at least one layer to the target object based on the positional correspondence and layout type of the target object in the new original image, and updating the position of the layer to be shifted based on the position information of the target object in the new original image. This maintains the relative positional relationship between the layer to be shifted and the target object after the target object's position is moved.

[0090] Figure 6 is a flowchart illustrating another shooting preview method provided by an embodiment of this disclosure. Based on the above embodiments, this disclosure adds and defines related steps for layer caching. As shown in Figure 6, the method includes:

[0091] S610, in response to a shooting preview event, generates a preview image based on the original image and a preset layer configuration file, and displays the preview image in the preview interface.

[0092] The preset layer configuration file includes editing logic for at least one layer's corresponding editing item, which is used to characterize the layer editing method.

[0093] S620. In response to a layer cache event, determine the target cache data based on the layer content of the layer in the layer group, and cache the target cache data corresponding to the layer group.

[0094] Here, a layer group represents a collection of layers. The correspondence between layer groups and layers can be defined in a preset layer configuration file. Alternatively, layers can be grouped according to the order of multiple layers corresponding to the preview image to obtain layer groups. The number of layers included in a layer group can be preset. Optionally, the number of layers included in a layer group can be flexibly adjusted based on the storage space of the electronic device's storage resources. For example, storage resources include memory, etc.

[0095] Layer cache events are used to trigger layer caching operations. Conditions for triggering layer cache events include timed triggering, triggering at set time intervals, or triggering based on layer rendering progress. Layer rendering progress represents the ratio of rendered to unrendered input data for the layer. For example, a layer cache event can be triggered after the layer rendering is complete.

[0096] Layer content represents the data content drawn on a layer. For example, the layer content of a camera layer includes the image content of the photographed object. The layer content of a sticker layer includes the layer content of the sticker material. The layer content of a text layer includes the text. This disclosure does not specifically limit the specific meaning of layer content.

[0097] The target cache data represents the overlay result of the layer content within a layer group. Assuming the layer group includes layers A, B, and C, the target cache data for this layer group can be media data obtained by overlaying layers A, B, and C. This media data includes, but is not limited to, images, text, and special effects animations.

[0098] For example, if at least one layer group meets the layer group caching time, a layer caching event for at least one layer group is triggered. For any layer group that meets the layer caching time, target cached data is determined based on the layer content of the layers in the layer group, and the target cached data corresponding to the layer group is cached.

[0099] Alternatively, if the caching interval of at least one layer group meets a set time interval threshold, a layer caching event for at least one layer group is triggered. For any layer group that meets the time interval threshold, target cache data is determined based on the layer content of the layers in the layer group, and the target cache data corresponding to the layer group is cached.

[0100] Alternatively, if at least one layer in a layer group has finished rendering, a layer caching event for that layer group is triggered. For any layer group that has finished rendering, target cache data is determined based on the layer content of the layers in the layer group, and the target cache data corresponding to the layer group is cached.

[0101] By caching the target cache data corresponding to the layer group, rendering overhead can be reduced, and the situation where caching the layer content of each layer consumes too much storage resources can also be avoided.

[0102] Optionally, since image zooming is typically not performed in preview scenes, for any layer group, target cache data is determined based on the layer content of the layers within the layer group, and the target cache data corresponding to the layer group is cached according to the screen size. Because target cache data the size of the screen can be cached, storage resource usage is reduced, saving storage resources and achieving a balance between rendering overhead and caching overhead.

[0103] S630. In response to the trigger operation in the preview interface, determine the target layer.

[0104] For example, if the target layer is not a cached layer, then in response to a selection operation on the candidate layer control set, the layer corresponding to the selected candidate layer control is taken as the target layer, and the candidate material set corresponding to the target layer is displayed in the preview interface. In response to a selection operation on the candidate material set, the target layer is rendered according to the target material.

[0105] If you need to edit a cached layer, determine the target layer through the trigger operation in the preview interface.

[0106] S640. If the target layer is a cached layer, then obtain the target cache data corresponding to the target layer group.

[0107] The target layer group includes the target layer.

[0108] For example, the target cache data corresponding to the target layer group to which the target layer belongs is retrieved from the cache. Optionally, the target layer group to which the target layer belongs is determined based on the correspondence between layers and layer groups. The target cache data corresponding to the target layer group is retrieved from the cache based on the identification information of the target layer group.

[0109] S650. Render the layers included in the target layer group according to the target cache data corresponding to the target layer group to obtain the target layer.

[0110] For example, the target cache data corresponding to the target layer group is split into layers to obtain the layer content of each layer included in the target layer group. Based on the layer content of each layer, layer rendering is performed to obtain the target layer.

[0111] S660. In response to the editing operation on the target layer, obtain editing parameters, edit the target layer according to the editing parameters and the editing logic, and update the preview image according to the edited target layer.

[0112] The technical solution of this disclosure embodiment responds to a layer caching event, determines the target cache data based on the layer content of the layers in the layer group, and caches the target cache data corresponding to the layer group. This can reduce rendering overhead and avoid caching the layer content of each layer from consuming too much storage resources, thus achieving a balance between rendering overhead and caching overhead.

[0113] Figure 7 is a schematic diagram of a shooting preview device provided in an embodiment of this disclosure. This device can be implemented in software and / or hardware, optionally through an electronic device, such as a mobile terminal. As shown in Figure 7, the device includes: a preview image generation module 710, a target layer determination module 720, and a layer editing module 730.

[0114] The preview image generation module 710 is used to generate a preview image based on the original image and the preset layer configuration file in response to a shooting preview event, and to display the preview image in the preview interface. The preset layer configuration file includes editing logic for at least one layer's corresponding editing item, and the editing item is used to characterize the layer editing method.

[0115] The target layer determination module 720 is used to determine the target layer in response to a trigger operation in the preview interface, wherein the target layer represents the layer that is selected among the at least one layers;

[0116] The layer editing module 730 is used to respond to the editing operation on the target layer, obtain editing parameters, edit the target layer according to the editing parameters and the editing logic, and update the preview image according to the edited target layer.

[0117] Optionally, the preview image generation module 710 is specifically used for:

[0118] If the camera detects that it has acquired a new raw image, a shooting preview event is triggered;

[0119] In response to the shooting preview event, the layer is rendered according to the original image and the preset layer configuration file to obtain the preview image corresponding to the original image.

[0120] Optionally, the target layer determination module 720 is specifically used for:

[0121] The preview interface displays a set of candidate layer controls, which includes candidate layer controls used to select the target layer from the at least one layer;

[0122] In response to a selection operation on the candidate layer control set, the layer corresponding to the selected candidate layer control is taken as the target layer, and the candidate material set corresponding to the target layer is displayed on the preview interface;

[0123] In response to a selection operation on the candidate material set, the target layer is rendered based on the target material.

[0124] Optionally, the target layer determination module 720 is specifically used for:

[0125] In response to the image processing operation in the preview interface, the layer corresponding to the image processing operation is used as the target layer;

[0126] The preview interface displays a set of candidate materials corresponding to the target layer.

[0127] In response to a selection operation on the candidate material set, the target layer is rendered based on the target material.

[0128] Optionally, the layer editing module 730 is specifically used for:

[0129] The preview interface displays a set of candidate editing controls corresponding to the target layer, wherein the candidate editing controls are used to adjust the editing parameters of the editing item;

[0130] In response to an adjustment operation on a target editing control, the editing parameters of the target editing item corresponding to the target editing control are obtained, wherein the target editing control represents the candidate editing control to be adjusted in the set of candidate editing controls;

[0131] Based on the target layer and the target edit item, determine the editing logic in the preset configuration file corresponding to the target edit item;

[0132] The target layer is edited according to the editing logic and editing parameters corresponding to the target editing item, and the preview image is updated according to the edited target layer.

[0133] Optionally, the device further includes:

[0134] A layer shifting device is used to acquire a new original image after updating the preview image based on the edited target layer, wherein the new original image includes a target object; determine a layer to be shifted based on the layout type of the at least one layer and the target object; update the position of the layer to be shifted based on the position information of the target object in the new original image; and update the preview image corresponding to the new original image based on the updated layer to be shifted.

[0135] Optionally, the device further includes:

[0136] A layer caching module is used to respond to a layer caching event, determine the target cache data based on the layer content of the layers in the layer group, and cache the target cache data corresponding to the layer group, wherein the layer group represents a collection of layers.

[0137] Furthermore, it also includes:

[0138] The cached data acquisition module is used to acquire target cached data corresponding to the target layer group if the target layer is a cached layer after the target layer is determined, wherein the target layer group includes the target layer.

[0139] The layer rendering module is used to render the layers included in the target layer group according to the target cache data corresponding to the target layer group, so as to obtain the target layer.

[0140] The shooting preview device provided in this disclosure can execute the shooting preview method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0141] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.

[0142] Figure 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Referring now to Figure 8, a schematic diagram of the structure of an electronic device (e.g., the terminal device in Figure 8) suitable for implementing an embodiment of this disclosure is shown. The terminal device in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), etc. The electronic device shown in Figure 8 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this disclosure.

[0143] As shown in Figure 8, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the electronic device 800. The processing device 801, ROM 802, and RAM 803 are interconnected via a bus 804. An edit / output (I / O) interface 805 is also connected to the bus 804.

[0144] Typically, the following devices can be connected to I / O interface 805: input devices 806 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 807 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 808 including, for example, magnetic tapes, hard disks, etc.; and communication devices 809. Communication device 809 allows electronic device 800 to communicate wirelessly or wiredly with other devices to exchange data. Although FIG8 shows an electronic device 800 with various devices, it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0145] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by a processing device 801, it performs the functions defined in the methods of embodiments of this disclosure.

[0146] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0147] The electronic device provided in this embodiment and the shooting preview method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0148] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the shooting preview method provided in the above embodiments.

[0149] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0150] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0151] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0152] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to:

[0153] In response to a shooting preview event, a preview image is generated based on the original image and a preset layer configuration file, and the preview image is displayed in the preview interface. The preset layer configuration file includes editing logic for at least one layer's corresponding editing item, and the editing item is used to characterize the layer editing method.

[0154] In response to a trigger operation in the preview interface, a target layer is determined, wherein the target layer represents the layer that is selected among the at least one layers;

[0155] In response to an editing operation on the target layer, editing parameters are obtained, the target layer is edited according to the editing parameters and the editing logic, and the preview image is updated according to the edited target layer.

[0156] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0157] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0158] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0159] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0160] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0161] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0162] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0163] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A shooting preview method, comprising: In response to a shooting preview event, a preview image is generated based on the original image and a preset layer configuration file, and the preview image is displayed in the preview interface. The preset layer configuration file includes editing logic for at least one layer's corresponding editing item, and the editing item is used to characterize the layer editing method. In response to a trigger operation in the preview interface, a target layer is determined, wherein the target layer represents the layer that is selected among the at least one layers; In response to an editing operation on the target layer, editing parameters are obtained, the target layer is edited according to the editing parameters and the editing logic, and the preview image is updated according to the edited target layer.

2. The method according to claim 1, wherein generating a preview image based on the original image and a preset layer configuration file in response to a shooting preview event includes: If the camera detects that it has acquired a new raw image, a shooting preview event is triggered; In response to the shooting preview event, the layer is rendered according to the original image and the preset layer configuration file to obtain the preview image corresponding to the original image.

3. The method according to claim 1, wherein determining the target layer in response to a trigger operation in the preview interface includes: The preview interface displays a set of candidate layer controls, which includes candidate layer controls used to select the target layer from the at least one layer; In response to a selection operation on the candidate layer control set, the layer corresponding to the selected candidate layer control is taken as the target layer, and the candidate material set corresponding to the target layer is displayed on the preview interface; In response to a selection operation on the candidate material set, the target layer is rendered based on the target material.

4. The method according to claim 1, wherein determining the target layer in response to a trigger operation in the preview interface includes: In response to the image processing operation in the preview interface, the layer corresponding to the image processing operation is used as the target layer; The preview interface displays a set of candidate materials corresponding to the target layer. In response to a selection operation on the candidate material set, the target layer is rendered based on the target material.

5. The method according to claim 1, wherein in response to an editing operation on the target layer, obtaining editing parameters, editing the target layer according to the editing parameters and the editing logic, and updating the preview image according to the edited target layer, comprises: The preview interface displays a set of candidate editing controls corresponding to the target layer, wherein the candidate editing controls are used to adjust the editing parameters of the editing item; In response to an adjustment operation on a target editing control, the editing parameters of the target editing item corresponding to the target editing control are obtained, wherein the target editing control represents the candidate editing control to be adjusted in the set of candidate editing controls; Based on the target layer and the target edit item, determine the editing logic in the preset configuration file corresponding to the target edit item; The target layer is edited according to the editing logic and editing parameters corresponding to the target editing item, and the preview image is updated according to the edited target layer.

6. The method of claim 1, further comprising, after updating the preview image according to the edited target layer: Acquire a new original image, wherein the new original image includes the target object; The layer to be shifted is determined based on the layout type of the at least one layer and the target object; Based on the position information of the target object in the new original image, update the position of the layer to be shifted, and update the preview image corresponding to the new original image based on the updated layer to be shifted.

7. The method according to claim 1, further comprising: In response to a layer caching event, target cache data is determined based on the layer content of the layers in the layer group, and the target cache data corresponding to the layer group is cached, wherein the layer group represents a collection of layers.

8. The method of claim 7, further comprising, after determining the target layer: If the target layer is a cached layer, then obtain the target cache data corresponding to the target layer group, wherein the target layer group includes the target layer; The target layer is obtained by rendering the layers included in the target layer group based on the target cache data corresponding to the target layer group.

9. A shooting preview device, comprising: A preview image generation module is used to generate a preview image based on the original image and a preset layer configuration file in response to a shooting preview event, and to display the preview image in the preview interface. The preset layer configuration file includes editing logic for at least one layer's corresponding editing item, and the editing item is used to characterize the layer editing method. A target layer determination module is used to determine a target layer in response to a trigger operation in the preview interface, wherein the target layer represents the layer that is selected among the at least one layers; The layer editing module is used to respond to the editing operation on the target layer, obtain editing parameters, edit the target layer according to the editing parameters and the editing logic, and update the preview image according to the edited target layer.

10. An electronic device, the electronic device comprising: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the shooting preview method as described in any one of claims 1-8.

11. A storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the shooting preview method as described in any one of claims 1-8.

12. A computer program product comprising a computer program that, when executed by a processor, implements the shooting preview method as described in any one of claims 1-8.