Image processing method and electronic device

By providing a dynamic image editing interface on electronic devices, users can easily edit and save static images in dynamic images, solving a variety of problems in the prior art, improving user experience and supporting high-resolution storage.

WO2024244639A9PCT designated stage expired Publication Date: 2025-12-26HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/083161
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-26
Filing Date
2024-03-22
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

The prior art is difficult to edit every frame of the static image in a dynamic image in an easy and efficient manner, resulting in a large number of user operations and poor user experience.

Method used

An image processing method is provided. By displaying the editing interface corresponding to the moving image on an electronic device, the user can select any static image and edit it. After editing, save or view it directly, without additional operations, setting the cover.

Benefits of technology

It realizes convenient editing and saving of multi-frame still images in dynamic images, reduces user operations, improves user experience, and supports high-resolution image saving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083161_26122025_PF_FP_ABST
    Figure CN2024083161_26122025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are an image processing method and an electronic device. The electronic device can: display a first editing interface, which comprises a thumbnail corresponding to a static image in a first dynamic image; in response to a user operation of selecting the thumbnail, display the static image corresponding to the thumbnail, and display the thumbnail as a selected state; and edit the static image in response to a user operation of editing the static image, and further display the effect of the static image after editing is performed. Or, the electronic device can: display a first editing interface, which comprises a thumbnail corresponding to a static image in a first dynamic image; in response to a user operation of selecting the thumbnail, display the static image corresponding to the thumbnail, and display the thumbnail as a selected state; and store the static image in response to a user operation of storing the static image. By means of the method, any static image frame of a dynamic image can be edited or stored.
Need to check novelty before this filing date? Find Prior Art

Description

An image processing method and electronic device

[0001] This application claims priority to Chinese Patent Application No. 202310613144.3, filed on May 26, 2023, entitled "An Image Processing Method and Electronic Device", and Chinese Patent Application No. 202310610328.4, filed on May 26, 2023, entitled "An Image Processing Method and Electronic Device", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of electronic technology, and in particular to an image processing method and an electronic device. Background Technology

[0003] Currently, many electronic devices are capable of capturing moving images. These moving images can produce dynamic effects during playback, providing users with a wonderful visual experience.

[0004] In some applications, users want to further edit animated images to obtain static images that meet their personalized needs. How to conveniently and efficiently achieve this editing is a problem that the industry urgently needs to solve.

[0005] Summary of the Invention

[0006] This application provides an image processing method and electronic device that can conveniently and efficiently edit each frame of static image in a dynamic image.

[0007] In a first aspect, this application provides an image processing method applied to an electronic device, the method comprising:

[0008] Display a first interface, which includes a first static image and a first control. The first static image corresponds to a first dynamic image, and the first dynamic image includes multiple frames of static images.

[0009] In response to a user operation applied to the first control, a first editing interface is displayed. The first editing interface includes a first thumbnail, a second thumbnail, and a second static image. The first thumbnail and the second thumbnail are thumbnails corresponding to two static images in the first dynamic image. The first thumbnail is in a selected state. The first thumbnail corresponds to the second static image. The first static image and the second static image correspond to the same static image in the first dynamic image. The first editing interface also includes a second control.

[0010] In response to a user action on the second thumbnail, a third static image corresponding to the second thumbnail is displayed at the location of the second static image, with the second thumbnail in a selected state;

[0011] In response to a user operation applied to the second control, a second editing interface is displayed. The second editing interface includes a fourth static image and a third control. The third static image and the fourth static image correspond to the same frame of static image in the first dynamic image.

[0012] In response to user actions applied to the fourth static image, display the editing effect of the fourth static image;

[0013] In response to a user operation applied to a third control, a first editing interface is displayed. The first editing interface displays the editing effect of the fourth static image at the position of the third static image, and also displays the editing effect of the fourth static image at the position of the second thumbnail.

[0014] In this embodiment, after a user selects any static image from the dynamic images and determines a second control (such as a doodle control), the electronic device can display a second editing interface for the user to edit, and then display the effect of the edited static image. This method eliminates the need for the user to perform additional operations such as setting the selected image as a cover, reducing user intervention and improving the user experience.

[0015] The editing effect of the fourth static image can be the display content after overlaying editing effects onto the fourth static image. For example, it can be the display content after overlaying graffiti marks or filters onto the fourth static image, or it can be the display content of the cropped portion of the fourth static image.

[0016] In conjunction with the first aspect, in some embodiments, the first editing interface includes a first save control; the method further includes: in response to a user operation applied to the first save control, generating a target image based on the editing effect of the fourth static image; and saving the target image.

[0017] In this embodiment, the user can save the edited effect of the fourth static image as a single static image using the first save control in the first editing interface. This method can meet the user's need to save an edited static image.

[0018] In conjunction with the first aspect, in some embodiments, the method further includes: in response to a user operation on the first save control, displaying a first prompt box on the first editing interface, the first prompt box indicating that an image is being saved; after saving the target image, displaying a second prompt box on the first editing interface, the second prompt box indicating that the image has been successfully saved; and canceling the display of the second prompt box.

[0019] In this embodiment, the electronic device can display prompt boxes during and after saving the target image; then, it can cancel the display of the prompt boxes and still display the current interface, i.e., the first editing interface. Furthermore, the electronic device can reset the first editing interface, and then reselect a static image from the dynamic image for editing. This method can meet the user's need to edit multiple frames of static images in a dynamic image, avoiding the cumbersome operation of manually re-entering the current interface after exiting it, thus effectively improving the user experience.

[0020] In conjunction with the first aspect, in some embodiments, the second editing interface further includes a second save control, and the method further includes: when a user operation is received on the second save control, generating a target image based on the editing effect of the fourth static image; saving the target image; and displaying the second interface after saving the target image, the second interface including the target image.

[0021] In this embodiment, the electronic device can exit the current interface (i.e., the first editing interface) after saving the target image; then, it can display a second interface including the target image. This method can meet the user's need to view the target image.

[0022] Optionally, the second interface may also include processing controls such as editing controls and sharing controls. Furthermore, the electronic device can process the target image in response to user operations applied to these processing controls; for example, it can share the target image in response to user operations applied to the sharing controls. This method can meet the user's need for further operations on the target image, reduce the user's need to exit the first editing interface and then re-enter the second interface from the gallery application, and effectively improve the user experience.

[0023] In conjunction with the first aspect, in some embodiments, generating a target image includes: determining the position information of a fourth static image in the video corresponding to the first dynamic image based on a second thumbnail; obtaining a first image from the video based on the position information; increasing the resolution of the first image to obtain a second image; and processing the second image based on the editing effect of the fourth static image to obtain the target image.

[0024] In this embodiment, the electronic device can acquire a high-resolution fourth static image and edit it to achieve the same editing effect as the fourth static image. However, the resolution of the target image can be higher than the resolution of the edited fourth static image displayed on the screen. This method can save higher-resolution images, allowing users to view higher-resolution images later when viewing or processing them, thus improving the user experience.

[0025] In conjunction with the first aspect, in some embodiments, displaying a second editing interface includes: taking a screenshot of the area where a third static image will be displayed to obtain a fourth static image.

[0026] In this embodiment, when the electronic device switches from the first editing interface to the second editing interface, it can take a screenshot of the area where the third static image will be displayed to obtain a fourth static image. Since the screenshot speed is faster than the speed of re-acquiring the third static image, this method can display the second editing interface more quickly, reducing the user's waiting time for the interface to display and improving the user experience.

[0027] In conjunction with the first aspect, in some embodiments, the first editing interface includes a reset control; the method further includes: displaying the first editing interface in response to a user operation on the reset control, the first editing interface including a first thumbnail, a second thumbnail, and a second static image, the first thumbnail being selected.

[0028] In this embodiment, the electronic device can reset the first editing interface, and then reselect a static image from the dynamic image for editing. This method can meet the user's need to edit multiple frames of static images in the dynamic image, avoiding the cumbersome operation of manually re-entering the current interface after exiting it, and effectively improving the user experience. In conjunction with the first aspect, in some embodiments, the first static image is the cover image of the first dynamic image.

[0029] In conjunction with the first aspect, in some embodiments, the electronic device stores the target image, including:

[0030] Obtain the storage path corresponding to the first dynamic image, the initial exchangeable image file Exif, and the initial database information; the initial Exif includes the parameters of the first dynamic image, including the time.

[0031] The electronic device obtains the storage path corresponding to the target image based on the storage path corresponding to the first dynamic image and the current time;

[0032] Create a target file corresponding to the target image based on the storage path of the target image;

[0033] Modify the time in the initial Exif to the current time to obtain the target Exif;

[0034] Write the target Exif file and the target image to the target file;

[0035] Update the initial database information with the file information of the target image to obtain the target database information; the file information of the target image includes the storage path corresponding to the target image and the creation time of the target file.

[0036] Save the target database information to the database.

[0037] In this embodiment, the electronic device can generate target image data based on the data of the first dynamic image. This method modifies the data of the first dynamic image faster than regenerating the target image data, thus improving the speed of saving the target image.

[0038] In conjunction with the first aspect, in some embodiments, displaying a first editing interface includes: acquiring a video corresponding to a first dynamic image; and decoding the video using an encoding / decoding module to obtain multiple frames of static images.

[0039] In conjunction with the first aspect, in some embodiments, the second control is any one of a cropping control, a graffiti control, a watermark control, a filter control, a text control, a mosaic control, a blur control, a frame control, and a color preservation control.

[0040] In this embodiment, the specific function of the second control is not limited. The electronic device can perform arbitrary editing operations on any frame of the first dynamic image, which can meet the user's personalized needs and effectively improve the user experience.

[0041] Secondly, this application provides an image processing method applied to an electronic device, the method comprising:

[0042] Display a first interface, which includes a first static image and a first control. The first static image corresponds to a first dynamic image, and the first dynamic image includes multiple frames of static images.

[0043] In response to a user operation applied to the first control, a first editing interface is displayed. The first editing interface includes a first thumbnail, a second thumbnail, and a second static image. The first thumbnail and the second thumbnail are thumbnails corresponding to two static images in the first dynamic image. The first thumbnail is in a selected state. The first thumbnail corresponds to the second static image. The first static image and the second static image correspond to the same static image in the first dynamic image. The first editing interface also includes a second control.

[0044] In response to a user action on the second thumbnail, a third static image corresponding to the second thumbnail is displayed at the location of the second static image, with the second thumbnail in a selected state;

[0045] In response to a user action applied to the second control, save the third static image.

[0046] In this embodiment, after a user selects any static image from the animated images, the electronic device can save any static image in response to the user's operation. This method eliminates the need for the user to perform additional operations such as setting the selected image as a cover image, reducing user intervention and improving the user experience.

[0047] In conjunction with the second aspect, in some embodiments, the method further includes:

[0048] In response to a user action on the second control, a first prompt box is displayed on the first editing interface, the first prompt box indicating that an image is being saved;

[0049] After saving the third still image, a second prompt box is displayed on the first editing interface to indicate that the image has been successfully saved.

[0050] Cancel the display of the second prompt box.

[0051] In this embodiment, the electronic device can display prompt boxes during and after saving the third static image; then, it can cancel the display of the prompt boxes and still display the current interface, i.e., the first editing interface. Furthermore, the electronic device can reselect a static image from the dynamic image for saving or editing. This method can meet the user's need to edit multiple frames of static images in a dynamic image, avoiding the cumbersome operation of manually re-entering the current interface after exiting it, thus effectively improving the user experience.

[0052] In conjunction with the second aspect, in some embodiments, the method further includes:

[0053] After saving the third static image, the second interface is displayed, which includes the third static image.

[0054] In conjunction with the second aspect, in some embodiments, storing a third still image includes:

[0055] Based on the second thumbnail, determine the position information of the third static image in the video corresponding to the first dynamic image;

[0056] Based on location information, the first image is obtained from the video;

[0057] Increase the resolution of the first image to obtain the second image;

[0058] Save the second image.

[0059] In this embodiment, the electronic device can save a high-resolution third static image, and the resolution of the saved third static image can be higher than that of the third static image currently displayed on the interface. This method can save higher-resolution images, allowing users to view or process images later, thus improving the user experience.

[0060] In conjunction with the second aspect, in some embodiments, the first editing interface further includes a third control; the method further includes:

[0061] In response to a user operation applied to a third control, a second editing interface is displayed. The second editing interface includes a fourth static image and a fourth control. The third static image and the fourth static image correspond to the same frame of static image in the first dynamic image.

[0062] In response to user actions applied to the fourth static image, display the editing effect of the fourth static image;

[0063] In response to a user operation applied to the fourth control, a first editing interface is displayed. The first editing interface displays the editing effect of the fourth static image at the position of the third static image, and also displays the editing effect of the fourth static image at the position of the second thumbnail.

[0064] In this embodiment, after a user selects any static image from the dynamic images and determines a second control (such as a doodle control), the electronic device can display a second editing interface for the user to edit, and then display the effect of the edited static image. This method eliminates the need for the user to perform additional operations such as setting the selected image as a cover, reducing user intervention and improving the user experience.

[0065] The editing effect of the fourth static image can be the display content after overlaying editing effects onto the fourth static image. For example, it can be the display content after overlaying graffiti marks or filters onto the fourth static image, or it can be the display content of the cropped portion of the fourth static image.

[0066] In conjunction with the second aspect, in some embodiments, the second editing interface further includes a fifth control, and the method further includes:

[0067] When a user action is received on the fifth control, the target image is generated based on the editing effect of the fourth static image;

[0068] Save the target image;

[0069] After saving the target image, a third interface is displayed, which includes the target image.

[0070] In this embodiment, the electronic device can exit the current interface, i.e., the first editing interface, after saving the target image; then, it can display a third interface including the target image. This method can meet the user's need to view the editing effect of a fourth static image.

[0071] In conjunction with the second aspect, in some embodiments, the first editing interface includes a reset control; the method further includes:

[0072] In response to a user action on the reset control, a first editing interface is displayed. The first editing interface includes a first thumbnail, a second thumbnail, and a second static image. The first thumbnail is in a selected state.

[0073] In this embodiment, the electronic device can reset the first editing interface, and then reselect a static image from the dynamic image for editing and saving. This method can meet the user's need to operate on multiple frames of static images in the dynamic image, avoiding the cumbersome operation of manually re-entering the current interface after exiting it, and effectively improving the user experience.

[0074] In conjunction with the second aspect, in some embodiments, the first static image is the cover image of the first dynamic image.

[0075] In conjunction with the second aspect, in some embodiments, the electronic device stores a third still image, including:

[0076] Obtain the storage path corresponding to the first dynamic image, the initial exchangeable image file Exif, and the initial database information; the initial Exif includes the parameters of the first dynamic image, including the time.

[0077] The electronic device obtains the storage path corresponding to the third static image based on the storage path corresponding to the first dynamic image and the current time;

[0078] Create the target file corresponding to the third static image based on the storage path of the third static image;

[0079] Modify the time in the initial Exif to the current time to obtain the target Exif;

[0080] Write the target Exif file and the third static image to the target file;

[0081] Update the initial database information with the file information of the third static image to obtain the target database information; the file information of the third static image includes the storage path corresponding to the third static image and the creation time of the target file.

[0082] Save the target database information to the database.

[0083] In this embodiment, the electronic device can generate data for a third static image based on data from a first dynamic image. This method modifies the data of the first dynamic image faster than regenerating the data of the third static image, thus improving the speed of saving the third static image.

[0084] In conjunction with the second aspect, in some embodiments, a first editing interface is displayed, including:

[0085] Obtain the video corresponding to the first dynamic image;

[0086] The video is decoded using the encoding / decoding module to obtain multiple frames of still images.

[0087] In conjunction with the second aspect, in some embodiments, the second interface is a large image interface corresponding to a third static image in the gallery application of an electronic device, and the second interface includes at least one of an edit control, a favorite control, a share control, and a delete control.

[0088] In this embodiment, the electronic device can process the third static image in response to a user operation applied to at least one of the above-mentioned editing control, favorite control, share control, and delete control. For example, in response to a user operation applied to the above-mentioned share control, the third static image can be shared. This method can meet the user's need for further operations on the third static image, reduce the user operation of exiting the first editing interface and then entering the second interface from the gallery application, and effectively improve the user experience.

[0089] Thirdly, this application provides an electronic device including one or more processors and one or more memories; wherein the one or more memories are coupled to one or more processors, and the one or more memories are used to store computer program code, the computer program code including computer instructions, which, when executed by one or more processors, cause the electronic device to perform the method described in the first aspect and any possible implementation thereof.

[0090] Fourthly, embodiments of this application provide a chip system applied to an electronic device. The chip system includes one or more processors, which are configured to invoke computer instructions to cause the electronic device to perform the methods described in the first aspect and any possible implementation thereof.

[0091] Fifthly, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect and any possible implementation thereof.

[0092] In a sixth aspect, this application provides a computer program product containing instructions that, when the computer program product is run on an electronic device, cause the electronic device to perform the method described in the first aspect and any possible implementation thereof.

[0093] Understandably, the electronic device provided in the third aspect, the chip system provided in the fourth aspect, the computer storage medium provided in the fifth aspect, and the computer program product provided in the sixth aspect are all used to execute the method provided in this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here. Attached Figure Description

[0094] Figures 1A to 1D exemplarily illustrate the user interface for enabling the "edit" function for any static image in a moving image;

[0095] Figures 2A to 2K exemplarily illustrate the user interface of an electronic device when drawing on a static image in a moving image;

[0096] Figures 3A to 3C exemplarily illustrate the user interface of an electronic device when cropping a static image from a moving image;

[0097] Figure 4 is a flowchart of an image processing method provided in an embodiment of this application;

[0098] Figure 5 is a file format structure diagram of a dynamic image provided in an embodiment of this application;

[0099] Figure 6A is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0100] Figure 6B is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;

[0101] Figures 7 and 8 are flowcharts of the image processing method provided in the embodiments of this application;

[0102] Figures 9 and 10A to 10D exemplarily illustrate the user interface when an electronic device saves a static image from a dynamic image;

[0103] Figure 11 is a flowchart of an image processing method provided in an embodiment of this application;

[0104] Figure 12 is a file format structure diagram of a dynamic image provided in an embodiment of this application;

[0105] Figures 13 and 14 are flowcharts of the image processing method provided in the embodiments of this application. Detailed Implementation

[0106] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.

[0107] Currently, many electronic devices have the function of capturing moving images, which can also be called moving photos.

[0108] For example, the camera application of an electronic device includes a control for enabling dynamic images in its shooting interface. The electronic device can then activate the function to capture dynamic images in response to a user's click on this control. Furthermore, when the electronic device detects a user's instruction to capture images, it can capture dynamic images in response to that user action. In this embodiment, the number of frames and duration of the dynamic images are not limited. For example, the duration of the dynamic images may include 3 seconds, specifically 1.5 seconds before and 1.5 seconds after the moment the electronic device detects the user's instruction to capture images. The dynamic images consist of 90 frames of still images captured by the electronic device within these 3 seconds.

[0109] In some application scenarios, users, due to personalized needs, may wish to obtain a static image from a dynamic image and edit that static image. For example, when shooting a close-up of a person in a dynamic image, if a user is satisfied with a particular frame of the person in the dynamic image, they may want to save that frame separately; or, in a dynamic image recording the movement of an object, a user may want to perform text editing or other operations on a particular frame of the object in the dynamic image.

[0110] Currently, electronic devices require the user to first set a static image selected from dynamic images as the cover image before saving, editing, or performing other operations on that image. This method results in numerous user operations and a poor user experience.

[0111] In view of this, embodiments of this application provide an image processing method that can improve the efficiency of processing static images within dynamic images. The processing includes two parts: editing and saving, which will be described separately below.

[0112] (I) Editing Section

[0113] In this embodiment, the electronic device can display a first editing interface corresponding to a dynamic image. A user can select a target frame from the first editing interface and trigger first editing of that target frame. Correspondingly, in response to the user's operation of selecting a target frame from the dynamic image for first editing, the electronic device displays a second editing interface for the first editing of the target frame. In response to the user's operation on the second editing interface, the target frame is edited on the second editing interface, and the edited target frame is displayed. In this method, the user can select any static frame of the dynamic image for editing, reducing user operations and improving the user experience.

[0114] Electronic devices are devices that provide display services, such as smartphones, tablets, and large-screen devices. The image processing method provided in this application embodiment can be manifested as an "editing" function on an electronic device.

[0115] First, in conjunction with the user interface (UI) provided on the electronic device, this application embodiment provides an "editing" function for any static image in a dynamic image.

[0116] Figures 1A to 1D exemplify the relevant UI for enabling the "Edit" function for any static image within a moving image. Wherein:

[0117] Figure 1A exemplarily illustrates a user interface 11 according to an embodiment of this application. This user interface 11 is an application interface for a gallery application exemplarily provided in this embodiment of the application, and includes a thumbnail 110 of a first animated image. Optionally, the user interface 11 may also include static images and videos, etc., which are not limited here.

[0118] In this context, a dynamic image refers to an image with dynamic effects. These dynamic effects can be manifested as the switching and display of multiple static images according to preset rules, or the playback of a video. A static image is an image whose frame remains unchanged. In this embodiment, a dynamic image may include a static image (such as a cover image) and a video (such as an MP4 file). For example, when an electronic device displays a dynamic image, it may display the cover image of the dynamic image when no user operation is received, and display the corresponding video when a user operation is received (such as a long press).

[0119] It should be noted that a moving image includes a video segment, that is, a moving image can include multiple frames of still images obtained based on the video.

[0120] The cover image, also known as the cover frame, is an example of a video image with the same content but different resolution.

[0121] As shown in Figure 1A, the electronic device can detect a user operation that instructs the display of thumbnail 110, and in response to the operation, the electronic device can display the user interface 12 as shown in Figure 1B.

[0122] Figure 1B exemplarily illustrates a preview interface corresponding to the first dynamic image provided in an embodiment of this application. As shown in Figure 1B, the preview interface may include an identifier 120A, a parameter 120B, a preview window 121, and an editing control 122. It should be noted that the preview interface corresponding to the first dynamic image may also be referred to as the first interface, and the editing control 122 may also be referred to as the first control.

[0123] In this configuration, identifier 120A indicates that the image displayed on the current interface is a dynamic image; parameter 120B displays information such as the shooting parameters of the image displayed on the current interface; preview window 121 displays the first dynamic image, for example, the dynamic image is played in a loop in preview window 121, meaning that the image displayed in preview window 121 may not be static; editing control 122 is used to edit the first dynamic image. Optionally, the preview interface may also include sharing controls and favorite controls, etc., but this embodiment does not limit this.

[0124] As shown in Figure 1B, when the electronic device detects a user operation on the editing control 122, it can respond to the user operation by opening the editing function for the first dynamic image and displaying the editing interface corresponding to the first dynamic image. For example, when the electronic device detects the user operation, it can display the user interface 13 shown in Figure 1C, that is, the user interface 13 is the editing interface corresponding to the first dynamic image. It should be noted that the editing interface corresponding to the first dynamic image (i.e., the user interface 13) can also be referred to as the first editing interface.

[0125] The user interface 13 includes a preview window 131, a "Set as Cover" control 132, a "Save As" control 133 (also known as a first save control), a slider 134, an options bar 135, and a return control 136. The image displayed in the preview window 131 can be the cover image of the first animated image, and the selected thumbnail 134a in the slider 134 is the thumbnail corresponding to that cover image. This cover image can be any frame in the first animated image; however, this embodiment does not limit its scope.

[0126] The slider 134 is used to display thumbnails of static images in the dynamic images (i.e., the first dynamic images) that make up the preview window 131, such as thumbnail 134a corresponding to the cover image and thumbnail 134b of the first static image shown in FIG1C; FIG1C shows 6 frames of static images in the user interface 13 for example, but the number of images displayed by the slider in this embodiment is not limited, and can also be 10 frames, etc.

[0127] Optionally, the image in the slider 134 can be displayed in response to user operation. For example, the slider 134 in the user interface 13 can display only a thumbnail of a portion of the static image of the first dynamic image. When the electronic device detects a left swipe operation on the slider 134, the slider 134 can display a thumbnail of the static image not shown in FIG1B.

[0128] In this embodiment of the application, the selected image in the current slider is represented by a thick border. For example, if a user selects a thumbnail from the slider, the thumbnail can be displayed with a thick border to indicate the selected state.

[0129] Optionally, when the user does not make a selection operation on the slider, such as when the interface entered after clicking the aforementioned editing control 122 and receiving the user's selection operation, the selected thumbnail can be a thumbnail corresponding to a preset static image, such as the thumbnail corresponding to the cover image. As shown in Figure 1C, the border of the thumbnail 134a corresponding to the cover image in the slider 134 is thickened, that is to say, the selected image in the slider 134 is the thumbnail 134a corresponding to the cover image. In other embodiments of this application, the selected image can also be represented by a color image, and the unselected image can be represented by a grayscale static image; this application does not limit this.

[0130] Preview window 131 is used to display the selected static image in the dynamic image. As shown in Figure 1C, the image selected in slider 134 is the thumbnail 134a corresponding to the cover image, and the image displayed in preview window 131 is the cover image.

[0131] The cover control 132 is used to set the image displayed in the preview window 131 as the cover image of a static image.

[0132] The Save As control 133 is used to save the image displayed in the preview window 131 as a static image to the gallery.

[0133] The option bar 135 may include a dynamic image homepage option 135a and various editing options, such as a cropping option 135b and a drawing option 135c. This application embodiment does not limit the specific content or number of editing options. The editing options may also be referred to as a second control; the dynamic image homepage option 135a may be referred to as a third control.

[0134] In this embodiment of the application, the selected option interface in the option bar 135 is represented by bold text, and this option interface is the current interface. As shown in Figure 1C, at this time, the dynamic image homepage option 135a in the option bar 135 is in bold, that is, the dynamic image homepage option 135a is in the selected state, and the current user interface 13 is the editing interface corresponding to the dynamic image.

[0135] The return control 136 is used to display the previous screen of the current interface. For example, when the electronic device detects a user operation on the return control 136, it can display the user interface 12 as shown in FIG1B in response to the user operation. It should be noted that in some embodiments of this application, after the cover image of the dynamic image is modified, the preview window 121 in the user interface 12 shown in FIG1B can display the modified dynamic image.

[0136] In some embodiments, a user can select any frame of static image in the first dynamic image from a slider (such as slider 142) in the editing interface (such as user interface 14) corresponding to the first dynamic image.

[0137] As shown in Figure 1C, when the electronic device detects a user operation that slides to the thumbnail 134b of the first static image, it can respond to the user operation by displaying the editing interface corresponding to the first static image, as shown in the user interface 14 in Figure 1D. It should be noted that the above-described sliding operation is only one implementation shown as an example, and it can also be a click or voice operation, for example, the electronic device can display the editing interface corresponding to the first static image when it detects a user operation that clicks on the thumbnail 134b of the first static image.

[0138] It should be noted that, in the embodiments of this application, any of the user operations can be a user's touch operation (such as a click operation, a long press operation, an up swipe operation, a down swipe operation, or a side swipe operation), or a non-contact operation (such as an air gesture), or a user's voice command. The embodiments of this application do not impose specific limitations on this.

[0139] The user interface 14 includes a preview window 141, a slider 134, a "Set as Cover" control 132, a "Save As" control 133, an options bar 135, and a return control 136. The static image selected in the slider 134 is a thumbnail 134b of the first static image, and the image displayed in the preview window 141 is the first static image. The thumbnail 134a corresponding to the cover image in the slider 134 is unselected. The difference between user interface 14 and user interface 13 lies in the selected image in the slider 134 and the content displayed in the preview windows 131 and 141.

[0140] In addition to the methods shown in Figures 1A-1D for enabling the "edit" function of an electronic device for static images in a moving image, users can also enable the "edit" function in other ways, such as long-pressing the moving image to enable the "edit" function, or long-pressing any frame in the moving image to enable the "edit" function for that frame.

[0141] In some embodiments, after an electronic device enables the editing function for a static image frame in a dynamic image, it can perform editing operations such as doodling, cropping, filtering, and watermarking on the static image.

[0142] The following example uses the graffiti function for illustration.

[0143] Please refer to Figures 2A to 2K, which exemplarily illustrate the UI diagrams involved when an electronic device doodles on a static image in a dynamic image.

[0144] Figure 2A is an exemplary user interface 14 for editing a first static image 1410 in a first dynamic image, as shown in an embodiment of this application. The user interface 14 includes a slider 134 and a preview window 141, wherein the image selected in the slider 134 is a thumbnail 134b of the first static image 1410, and the image displayed in the preview window 141 is the first static image 1410.

[0145] As shown in Figure 2A, when the electronic device detects a user operation applied to the drawing option 135c, it can respond to the operation by displaying the user interface 21 shown in Figure 2B. It should be understood that, as an example of using the drawing option 135c as the second control, the user interface 21 is the second editing interface corresponding to the second control.

[0146] The user interface 21 includes an editing window 211, a drawing area 212, an options bar 213, a save control 214 (also known as a second save control), and a return control 215. Among them:

[0147] The editing window 211 is used to display the first static image 1410 and the graffiti effect of graffiti on the first static image 1410.

[0148] The graffiti function area 212 includes multiple graffiti function controls, such as line controls, pencil settings, and eraser, etc., which are not limited in this embodiment.

[0149] The option bar 213 includes selected options (i.e., doodle option 213c) and unselected options (such as the dynamic image homepage option 213a, cropping options, and filter options). In Figure 2B, doodle option 213c is in bold, indicating that doodle option 213c is the selected option, that is, it indicates that the current interface (i.e., user interface 22) is the interface for doodles on static images. It can be understood that the interface when the doodle option is in bold is the doodle interface for the image in the preview window. This interface is used to perform doodle operations on the image in the preview window. For example, this user interface 21 is the doodle interface for the first static image 1410.

[0150] The return control 215 is used to return to the preview interface corresponding to the first animated image. When the electronic device detects a user operation on the return control 215, it can display the user interface 12 as shown in Figure 1B.

[0151] In some embodiments, a user can use the drawing function of the drawing area 212 to draw on the first static image 1410 within the editing window 211. As shown in FIG2B, when the electronic device detects a drawing operation (such as a line with an arrow) acting on the editing window 211, it can respond to the above operation by displaying the user interface 22 shown in FIG2C.

[0152] It should be noted that, in this embodiment of the application, the first static image 1410 can also be referred to as the fourth static image, and the above-mentioned graffiti operation is a user operation performed on the fourth static image. The number of user operations performed on the fourth static image is not limited here; it can be one user operation or multiple user operations. For example, the above-mentioned graffiti operation can include user operations such as selecting the graffiti function control in the graffiti function area 212 and performing graffiti operations in the editing window 211.

[0153] The user interface 22 includes an editing window 221, a drawing area 212, an options bar 213, a save control 214, and a return control 215. The editing window 221 displays the static image after drawing. The difference between user interface 22 and user interface 21 lies in the different images displayed in the editing window. It should be noted that in this embodiment, the first static image 1410 can also be referred to as the fourth static image; in this case, the content displayed in the editing window 221 is the edited effect of the fourth static image, specifically the first static image 1410 with drawing marks.

[0154] In some embodiments, after a user doodles on a static image within a dynamic image, the user can instruct the electronic device to save the doodled static image. The specific process of the electronic device saving the doodled static image can be found in the relevant content of the embodiments below.

[0155] In one implementation, after an electronic device doodles on a static image in a dynamic image, it can respond to a user operation that returns to the editing interface corresponding to the dynamic image and display the doodled static image in the editing interface corresponding to the dynamic image; furthermore, when a user operation is received to save the doodled static image as an image, the doodled static image is saved.

[0156] As shown in Figure 2C, when the electronic device detects a user operation on the dynamic image homepage option 213a in the user interface 22, it displays the user interface 23 shown in Figure 2D. This user interface 23 includes a preview window 231 and a slider 232. The preview window 231 displays the static image after drawing, and the selected image in the slider 232 is also a thumbnail 232b of the static image after drawing. Optionally, the unselected image in the slider 232 can be in a closed state, for example, it can be untouchable.

[0157] It should be noted that, in Figure 2D, the selected state is illustrated by a bold border. In other embodiments of this application, the thumbnail of the selected state may be displayed in grayscale, or the thumbnail of the selected state may be displayed in color while the thumbnails of other unselected states may be displayed in grayscale. This application does not limit this.

[0158] Furthermore, when the electronic device detects a user operation on the save control 133, it responds to the user operation by saving the doodled static image. During the saving process, the user interface 24 shown in Figure 2E is displayed. This user interface 24 includes a prompt box 240, which indicates that the doodled static image is being saved. For example, the content of the prompt box 240 can be "Saving". After successful saving, the user interface 25 shown in Figure 2F is displayed. This user interface 25 may include a prompt box 250, which indicates that the doodled static image has been successfully saved. For example, the content of the prompt box 250 can be "Saved to gallery". Except for the prompt boxes, the other displayed content of user interfaces 24 and 25 can be the same as that of user interface 23, and will not be described further here. The prompt box 240 can also be referred to as the first prompt box; the prompt box 250 can also be referred to as the second prompt box.

[0159] Furthermore, the electronic device can stop displaying the prompt box 250 after a preset duration and instead display the user interface 23. In other words, after the electronic device saves a static image from the dynamic image as a picture using the save control in the editing interface corresponding to the dynamic image, the electronic device does not exit the current interface. Therefore, the user can continue editing the static image within the dynamic image in the current interface (i.e., the editing interface corresponding to the dynamic image). Understandably, this method can meet the user's need to edit multiple static images within a dynamic image, thus improving the user experience.

[0160] Alternatively, when the electronic device detects a user operation on the save control 133, it may also save the static image after drawing in response to the user operation, without displaying the user interface 24 shown in FIG2E and the user interface 25 shown in FIG2F, and still display the current interface (such as user interface 23).

[0161] In another implementation, after an electronic device doodles on a static image within a dynamic image, it can save the doodled static image in response to a save operation performed on the doodle interface for that static image.

[0162] As shown in Figure 2G, when the electronic device detects a user operation on the save control 214 in the user interface 22, it saves the doodled image (hereinafter referred to as the doodle image for ease of description), i.e., the image in the editing window 221, and then displays the preview interface corresponding to the doodle image, as shown in the user interface 26 in Figure 2H. The user interface 26 includes a preview window 261 and other controls, wherein the preview window is used to display the doodle image.

[0163] In this embodiment, after saving the edited image, the electronic device redirects to a large-screen interface of the image, allowing the user to edit or share it. This method satisfies the user's need to process the saved image and improves the user experience. The large-screen interface (e.g., user interface 26) that the electronic device redirects to after saving the edited image can also be referred to as the second interface.

[0164] It should be noted that the resolution of the doodle image displayed in the preview window of the electronic device and the saved doodle image may be different. For example, the electronic device can increase the resolution of the doodle image displayed in the preview window, and then save the doodle image with the increased resolution. In this embodiment, a high-resolution image is saved, which can be displayed when the user views the doodle image, thereby improving the user experience.

[0165] For example, the image displayed in the editing window 221 of the user interface 22 shown in Figure 2G has a different resolution than the image displayed in the preview window 261 of the user interface 26 shown in Figure 2H; the image displayed in the user interface 26 has a higher resolution. How the electronic device obtains the doodle image with increased resolution can be found in the relevant embodiments below, which will not be elaborated upon here.

[0166] In some other embodiments of this application, after a user has doodled on a static image in a dynamic image, they can abandon the doodle operation and return to the preview interface. As shown in FIG2I, when the electronic device detects a user operation on the return control 215 in the user interface 22, it can respond to the user operation by displaying the user interface 27 shown in FIG2J. The user interface 27 includes an editing window 221, a doodle function area 212, an option bar 213, a save control 214, a return control 215, and a prompt box 270. The prompt box 270 includes a confirm control 270A and a cancel control 270B. If the electronic device detects a user operation on the confirm control 270A, the electronic device can display the user interface 12 shown in FIG1B; if the electronic device detects a user operation on the cancel control 270B, the electronic device can display the user interface 22 shown in FIG2I.

[0167] In some embodiments, after saving the doodle image, the electronic device displays a thumbnail of the doodle image when the user opens the gallery application. For example, the electronic device saves the doodle image when it receives a user operation to click the save control 133 as shown in FIG2C or a user operation to click the save control 214 as shown in FIG2G; after saving the doodle image, if the electronic device receives a user operation to open the gallery, it can display the user interface 28 as shown in FIG2K. The user interface 28 includes a thumbnail 280 corresponding to the doodle image and a thumbnail 110 corresponding to the first animated image. The difference between the user interface 28 and the user interface 11 is that the user interface 28 has a thumbnail 280 added, and the position of the thumbnail 110 is different in the two interfaces.

[0168] The following example uses the cropping function as an illustration.

[0169] Please refer to Figures 3A to 3C, which exemplarily illustrate the UI diagrams involved when an electronic device crops a static image in a dynamic image.

[0170] Figure 3A is an exemplary user interface 14 for editing a first static image in a first dynamic image, as shown in an embodiment of this application. The user interface 14 includes a slider 134 and a preview window 141, wherein the image selected in the slider 134 is a thumbnail 134b of the first static image, and the image displayed in the preview window 141 is the first static image.

[0171] As shown in Figure 3A, when the electronic device detects a user operation applied to the cropping option 135b, it can display the user interface 31 shown in Figure 3B in response to the operation. This user interface 31 is a cropping interface for the first static image.

[0172] The user interface 31 may include a save control 311, a cropping window 312, a cropping function area 313, an options bar 314, and a return control 315. Wherein:

[0173] The save control 311 is used to save the cropped image.

[0174] The cropping window 312 is used to display the cropping process.

[0175] The cropping function area 313 includes multiple cropping function controls, such as free adjustment controls, original scaling controls, and rotation controls, etc. This application embodiment does not limit these.

[0176] The options bar 314 includes selected options (i.e., cropping option 314b) and unselected options (such as the animated image homepage option 314a, the graffiti option 314c, and the filter option 314d). In Figure 3B, the selected cropping option 314b is used to indicate that the current interface (i.e., user interface 32) is an interface for cropping static images.

[0177] The return control 215 is used to return to the preview interface corresponding to the first animated image. When the electronic device detects a user operation on the return control 215, it can display the user interface 12 as shown in Figure 1A.

[0178] In some embodiments, a user can crop a static image within a cropping window 312 by setting a cropping function area 313. As shown in FIG2B, the electronic device can detect user operations performed on the cropping window 312, and in response to the above operations, the electronic device can display the user interface 32 shown in FIG3C.

[0179] It should be noted that, in this embodiment, the image displayed in the cropping window 312 can also be referred to as the fourth static image. The user operation performed on the cropping window 312 is the user operation performed on the fourth static image. The number of user operations performed on the fourth static image is not limited here; it can be one user operation or multiple user operations. For example, the user operation performed on the cropping window 312 may include the user operation of selecting the cropping function control in the cropping function area 313 and the operation of cropping within the cropping window 312.

[0180] The user interface 32 includes a cropping window 320, a save control 311, a cropping function area 313, an option bar 314, and a return control 315. The cropping window 320 displays the cropped image. The difference between user interface 23 and user interface 22 lies in the different images displayed in the cropping window. It should be noted that, in this embodiment, the image displayed in the cropping window 312 can also be referred to as the fourth static image. In this case, the content displayed in the editing window 221 is the edited effect of the fourth static image, specifically the cropped portion of the image displayed in the cropping window 312.

[0181] In some embodiments, after cropping a static image, the user can instruct the electronic device to save the cropped static image through user operation. The user interface for saving the cropped static image can be found in the user interface for saving the doodled static image described above, and will not be repeated here. In this embodiment, the saved cropped static image or the doodled static image can be referred to as the target image.

[0182] Based on the user interface displayed on the aforementioned electronic device, the image processing method provided in the embodiments of this application is described below.

[0183] Figure 4 illustrates an image processing method provided by an embodiment of this application. The method includes some or all of the following steps:

[0184] Step S401: In response to a first user operation instructing the display of a first dynamic image, the electronic device displays a preview interface corresponding to the first dynamic image. The preview interface includes a preview area and editing controls. The preview area is used to display the first dynamic image, and the editing controls are used to edit the first dynamic image.

[0185] In some embodiments, the electronic device may display an application interface of a gallery application (user interface 11 as shown in FIG1A), the application interface including a thumbnail of a first animated image (such as thumbnail 110 in user interface 11); when the electronic device detects a user operation on the thumbnail, in response to the user operation, it displays a preview interface corresponding to the first animated image (user interface 12 as shown in FIG1B), the preview interface including a preview area (such as preview window 121 in user interface 12) and editing controls (such as editing control 122 in user interface 12), the preview area being used to display the first animated image, and the editing controls being used to edit the first animated image.

[0186] The first dynamic image can be a static image, a dynamic image, or a video, etc.

[0187] Please refer to Figure 5, which is a file format structure diagram of a dynamic image provided in an embodiment of this application. As shown in Figure 5, the file format of the dynamic image may include three fields. The first field is a JPEG image, which serves as the cover image of the dynamic image. The second field is the mixed video data, such as an mp4 file. The third field is the description field (TAG) of the dynamic image, which may include three subfields. The first subfield is the version number, for example, if the current version is the second version, the version number can be v2; the second subfield includes the start time and duration, that is, the second subfield is used to record the playback start time and duration during gallery preview. The start time is the time point when the first frame of the video is played during gallery preview; the third subfield is used to record the file length of the video data, which can also be called the video byte stream length.

[0188] The video file length is used to determine the video's position information within the file, which can include the start and end positions. The video offset is the sum of the length of the second field (i.e., the video file length) and the length of the third field. The start position of the video within the file can be determined based on the video offset. The end position of the video within the file can be determined based on the video offset and the video byte stream length.

[0189] Step S402: In response to a second user operation on the editing control, the electronic device displays a first editing interface corresponding to the first dynamic image. The first editing interface includes a slider and a preview window. The slider is used to determine the image to be edited in the first dynamic image, and the preview window is used to display the image to be edited.

[0190] The first editing interface is used to process the first dynamic image, including updating the cover image of the first dynamic image and editing any frame of the static image in the first dynamic image.

[0191] In some embodiments, when the electronic device detects the second user operation, it displays a first editing interface in its initial state. The image to be edited in the first editing interface in its initial state can be a frame from the first animated image, a cover image, or a preset frame. For example, the preview window in the first editing interface in its initial state displays the cover image of the first animated image, and the slider in the first editing interface in its initial state also displays the cover image.

[0192] Optionally, the editing interface corresponding to the first dynamic image may also include at least one editing option and other controls, wherein the at least one editing option includes a first editing option, which is used to perform a first edit on the selected image, wherein the first edit can be graffiti, cropping, filtering, watermarking, etc.

[0193] For example, the editing interface corresponding to the first dynamic image can be referred to as the user interface 13 shown in Figure 1C and the user interface 14 shown in Figure 1D. The user interface 13 is the first editing interface in the initial state, and the user interface 14 is the first editing interface after the user reselects the static image in the first dynamic image. The preview window can be referred to in the relevant description of the preview window 131, the slider can be referred to in the relevant description of the slider 134, and at least one editing option can be referred to in the relevant description of the option bar 135.

[0194] In some embodiments, when the electronic device detects a second user operation applied to the editing control, it determines, in response to the user operation, whether the image on the current interface is a dynamic image. If the image is determined to be a dynamic image, the editing interface corresponding to the dynamic image is initialized. It is understood that the editing interfaces corresponding to dynamic images and static images may be different.

[0195] In one implementation, the process of an electronic device initializing a first editing interface corresponding to a first dynamic image may specifically include initializing an interface animation, initializing a slider, and initializing a cache, wherein the cache is used to store data during the editing process of the first dynamic image.

[0196] For example, the initialization interface animation of an electronic device may include: (1) executing a cover image movement animation, which refers to the interface change of switching the preview area of ​​the preview interface to the preview window of the editing interface. The initial position is the preview area of ​​the preview interface, and the ending position is the preview window of the editing interface. For example, the animation is the movement of the cover image of the preview window 121 shown in Figure 1B to the preview window 131 shown in Figure 1C; (2) performing a callback after the animation is executed to load the video resources of the first dynamic image. At this time, the preview window of the editing interface has two layers of views. The upper layer is the cover image of the first dynamic image, and the lower layer is the surface view. The surface view is used to display the video resources of the first dynamic image. In this embodiment, the image selected in the slider may be different from the cover image, for example, the resolution may be different. Therefore, the cover image of the first dynamic image is placed on the upper layer to achieve visual consistency.

[0197] The specific process of an electronic device acquiring video resources may include: the electronic device obtaining the address of a first dynamic image in the file system; then, obtaining the file of the first dynamic image based on the address; obtaining the position of the video in the file from the tag at the end of the file; then, obtaining the video based on the position of the video in the file; associating the video with an encoder, which is used to subsequently obtain static images from the first dynamic image, for example, the encoder can be a MediaMetadataRetriever, the electronic device sets the video to the retriever, which provides a unified interface for retrieving frames and metadata from the input media file; associating the video with a media player, that is, setting the video to the MediaPlayer, and combining the MediaPlayer with the SurfaceView to play the video; the electronic device can locate the position of the selected static image based on the percentage of the selected static image number to the total number of video frames by calling the seekTo method of the MediaPlayer; binding the SurfaceView with the MediaPlayer; and then, controlling the image displayed in the SurfaceView by calling the seekTo method of the MediaPlayer.

[0198] For example, initializing a slider in an electronic device may include: initializing a basic view of the slider, which can be a custom view, meaning that the size of the slider, the number of images in the slider, etc., can be preset; then, drawing a cover image as the background image for each frame of the slider; drawing a selection box for the slider, with the cover image drawn in the box, or other effects, such as the size of the selection box being larger than the size of the images in other positions; after acquiring the video, parsing multiple static images from the video, for example, the electronic device can use a MediaExtractor and a MediaCodec to parse specified frames in the video, the number of frames is not limited, such as taking one frame from the video at preset intervals to obtain 10 frames of static images; then, updating the slider background image with the above multiple static images, for example, after obtaining the video of the first dynamic image in the preview window 121 shown in Figure 1B, acquiring multiple static images of the first dynamic image, and then updating the multiple static images to the slider 134 in Figure 1C through alpha animation.

[0199] Step S403: In response to a user operation that instructs the selection of a target frame in the first dynamic image as an image to be edited, the electronic device updates the first editing interface, and the preview window in the updated first editing interface is used to display the target frame.

[0200] In one implementation, when the electronic device detects a user's swipe operation on the slider, it sets the dynamic cover image of the preview window to invisible and displays the underlying SurfaceView; it displays the swipe position on the slider using a checkbox; when a user operation to swipe to the target frame is detected, it displays the checkbox on the target frame; it calculates the percentage of the checkbox on the slider; based on the percentage, it calculates the time point of the target frame in the video; and then, it calls the MediaPlayer's seekTo method to adjust the MediaPlayer's display content to the position corresponding to that time point in the video, causing the SurfaceView to update to the target frame corresponding to that time point. The SurfaceView is used to carry the MediaPlayer's display content.

[0201] For example, the target frame is the first static image corresponding to the thumbnail 134b shown in FIG1C. When the electronic device detects a user operation that slides to the thumbnail 134b of the first static image, it responds to the user operation by displaying the user interface 14 shown in FIG1D. The image of the surfaceview in the preview window 141 in the user interface 14 is the target frame, i.e., the first static image.

[0202] Furthermore, based on the updated first edited image, in some embodiments, the electronic device can, in response to a user operation instructing the target frame to be set as the cover image of the first moving image, update the cover image of the first moving image to the target frame, thereby obtaining a second moving image. For example, when detecting a user operation targeting the cover control 132 in the user interface 14 shown in FIG. 1D, the electronic device can set the image to be edited displayed in the preview window 141 of the interface as the cover image of the first moving image, thereby obtaining a second moving image.

[0203] In one implementation, the electronic device can display a loading dialog box on the user interface when it detects a user action to set the target frame as the cover image. This loading dialog box indicates that the image is currently being set as the cover image. Optionally, the electronic device can be configured not to respond to any user actions while the loading dialog box is displayed, meaning the user cannot perform other operations. During the display of the loading dialog box, the electronic device can execute the process of setting the target frame as the cover image of the first moving image.

[0204] For example, the execution process may specifically include: (1) First, obtaining the position percentage of the target frame thumbnail on the slider in the current interface (such as the first editing interface after the update mentioned above); obtaining the video duration of the video corresponding to the first dynamic image through MediaMetadataRetriever, and then calculating the progress of the target frame in the video based on the above position percentage; using the search method of MediaMetadataRetriever.(1) Get the bitmap corresponding to the progress in the video using getScaledFrameAtTime, scale the bitmap to the same resolution as the cover image of the first dynamic image, and obtain the target cover image corresponding to the second dynamic image; (2) Obtain the file corresponding to the first dynamic image according to the path of the first dynamic image, specifically, obtain the video data in the first dynamic image and the TAG data at the end of the file; (3) Obtain the original exchangeable image file (Exif) of the first dynamic image; change the image update time in the original Exif to the current time, and obtain the target Exif corresponding to the second dynamic image; (4) Obtain the original database information (ContentValues) of the first dynamic image; (5) Delete the data related to the first dynamic image in the database according to the file path, specifically, delete the data related to the first dynamic image in the MediaLibrary data, delete the data related to the first dynamic image in the MediaProvider database, and delete the file corresponding to the first dynamic image; (6) Create a new file for the second dynamic image, specifically, create a new file according to the absolute path of the first dynamic image; open the file; write the target Exif to the file (that is, write to the file); and write the target Exif to the file. The cover image is compressed in JPEG format and written to a file; the video data in the first dynamic image and the TAG data at the end of the file corresponding to the first dynamic image are appended to the end of the file; the file is closed; the cover image number data at the end of the image file is updated; ContentValues ​​are updated, which may include attributes such as date and time, and whether it is a favorite; the relevant data of the second dynamic image is inserted into the database, such as the storage path, creation time, update time and file size of the second dynamic image being inserted into the MediaProvider database, and the above basic information and the special file type of the second dynamic image being inserted into the MediaLibrary database, where the special file type includes dynamic images and high dynamic range imaging (HDR); (7) the preview interface corresponding to the second dynamic image and the grid interface in the gallery (user interface 11 as shown in Figure 1A) are refreshed; (8) because the file of the first dynamic image is deleted, MediaMetadataRetriever, MediaPlayer and surfaceview are reinitialized.

[0205] The image's Exif data may include information such as camera brand, mobile phone model, flash, shutter speed, aperture size, ISO, and GPS coordinates, which are not limited in this embodiment. The image's database information may include information such as the image's path, creation time, update time, special file type, and file size.

[0206] In other embodiments, after a user selects a target frame as an image to be edited using a slider, the user can save the target frame as a still image. Correspondingly, the electronic device can save the target frame as a still image in response to the save operation.

[0207] For example, assuming the first static image corresponding to the thumbnail 134b shown in FIG1C is the target frame, the electronic device can, in response to the user operation of sliding to the thumbnail 134b of the first static image, determine the first static image as the image to be edited and display the editing interface corresponding to the first static image, such as the user interface 14 shown in FIG1D; furthermore, the electronic device can, in response to the user operation of the save control 133 in the user interface 14, save the first static image.

[0208] In one implementation, the electronic device can display a loading dialog box on the updated first editing interface, indicating that a target frame is being saved. Optionally, the electronic device can be configured not to respond to any user operation while the loading dialog box is displayed, meaning the user cannot perform other operations. During the display of the loading dialog box, the electronic device can perform the saving of the target frame.

[0209] For example, the process of saving the target frame by an electronic device may specifically include: (1) First, obtaining the percentage position of the thumbnail of the target frame on the slider in the current interface (such as the first editing interface after the update mentioned above); obtaining the video duration of the video corresponding to the first dynamic image through MediaMetadataRetriever, and then calculating the progress of the target frame in the video based on the aforementioned percentage position; using the search method (.getScaledFrameAtTime) of MediaMetadataRetriever to obtain the bitmap corresponding to the progress from the video, and the bitmap may be scaled to the same resolution as the cover image of the first dynamic image to obtain a high-resolution target frame; (2) obtaining the original exchangeable image file of the first dynamic image. (3) Determine the absolute path of the target frame. For example, the parent path of the first dynamic image can be set as the parent path of the saved image, and the current time can be set as the name of the target frame to obtain the absolute path of the target frame. (4) Create a new file of the target frame according to the absolute path, open the file, write the target Exif into the file, compress the high-resolution target frame in jpeg format, write the compressed image into the file, and close the file. (5) Obtain the database information (ContentValues) of the first dynamic data, and set the time in ContentValues ​​to the date. (6) Update the time to the current time, update the file path in ContentValues ​​to the absolute path, and obtain the ContentValues ​​of the high-resolution target frame; (7) Insert the ContentValues ​​of the high-resolution target frame into the database, which may include inserting the storage path, creation time, update time and file size of the high-resolution target frame into the MediaProvider database and inserting the above basic information and the special file type of the high-resolution target frame into the MediaLibrary database; (8) Trigger the data refresh of the preview interface corresponding to the high-resolution target frame and the grid interface in the gallery (user interface 11 as shown in Figure 1A).

[0210] Step S404: In response to a third user operation instructing the first editing of the target frame, the electronic device displays a second editing interface for the first editing of the target frame, the second editing interface including an editing window, the editing window including the target frame.

[0211] The first editing interface can perform editing operations such as doodling, cropping, filtering, and watermarking. The second editing interface includes functional controls corresponding to the first editing interface, such as functional controls for doodling and functional controls for filtering. The editing window is used to display the editing process when the user performs the first editing on the target frame.

[0212] In some embodiments, the updated first editing interface includes editing options corresponding to the first editing, and the electronic device displays a second editing interface when it detects a user operation on the editing option.

[0213] For example, suppose the target frame is the first static image corresponding to thumbnail 134b in the user interface 14 shown in FIG2A. The user interface 14 includes a preview window 141 and multiple editing options, such as doodle option 135c. Suppose the editing option corresponding to the first editing is doodle option 135c. Then, when the electronic device detects a user operation on doodle option 135c, the electronic device can display an editing interface for doodle on the first static image, as shown in user interface 21 in FIG2B. The first static image is displayed in the editing window 211 of user interface 21.

[0214] Optionally, the target frame displayed in the preview window of the second editing interface can be obtained from a screenshot of the updated first editing interface. In this embodiment, using a screenshot can improve the display speed of the second editing interface.

[0215] For example, when the electronic device detects the aforementioned third user operation applied to the updated first editing interface, it obtains the percentage position of the selected static image in the slider in the updated first editing interface; based on this percentage position, it obtains a screenshot of the SurfaceView area using a screenshot tool (such as pixelCopy), where pixelCopy can obtain screenshots based on the SurfaceView at millisecond speeds, greatly improving the display speed of the second editing interface; and then, it updates the editing window of the second editing interface with the obtained screenshot.

[0216] Step S405: The electronic device responds to the editing operation applied to the target frame and displays the editing effect of the target frame.

[0217] The editing operation applied to the target frame can be one or more editing operations, and this application embodiment does not limit this; the editing effect of the target frame refers to the displayed content at the location of the target frame. For example, when editing doodles, the editing effect of the target frame is that the target frame has doodle marks. Or, when editing crop, the editing effect of the target frame is that the target frame is changed in size and content after being cropped.

[0218] It should be noted that, in this embodiment of the application, the target frame displayed in the editing window may also be referred to as the fourth static image, the above-mentioned editing operation on the target frame is the user operation on the fourth static image, and the editing effect of displaying the target frame is the editing effect of displaying the fourth static image.

[0219] For example, assuming the editing operation is to add a doodle, the electronic device can respond to the editing operation by adding a doodle on the target frame and adding a proportionally reduced doodle on the thumbnail corresponding to the target frame, as shown in Figures 2B and 2C.

[0220] Step S406: In response to a fourth user operation instructing the electronic device to save the edited target frame, the electronic device saves the edited target frame.

[0221] In one implementation, when a fourth user operation is detected, the electronic device, in response to the user operation, acquires a high-resolution target frame; overlays an editing effect onto the target frame to obtain an edited target frame; and saves the edited target frame. In this embodiment, the edited target frame saved by the electronic device can also be referred to as a target image.

[0222] For example, an electronic device can first obtain the percentage position of the target frame's thumbnail within a slider; then, based on this percentage, it uses the MediaMetadataRetriever search method (.getScaledFrameAtTime) to obtain the bitmap of the current video progress; this bitmap is scaled to the same resolution as the cover image (or another resolution) to obtain the original target frame without overlaying editing effects; the editing effects of the second editing interface are then overlaid on the original target frame to obtain the edited target frame; the original Exif of the corresponding animated image (i.e., the first animated image) is obtained, and this original Exif includes, but is not limited to, the following information. Information includes: time information (such as shooting time or update time), shooting parameters, etc.; updating the time information in the original Exif according to the current time to obtain the target Exif, which includes time information updated to the current time; determining the absolute path of the target frame, for example, setting the parent path of the first dynamic image as the parent path of the target frame, and setting the current time as the name of the target frame to obtain the absolute path of the target frame; creating a new file and opening the corresponding read / write file according to the absolute path, writing the target Exif to the file, compressing the edited target frame in JPEG format, writing the compressed image to the file, and closing the file.

[0223] In some other embodiments of this application, after editing the target frame in the second editing interface, the user can trigger a return to the first editing interface (as shown in the user interface 22 in Figure 2C). In the returned first editing interface (as shown in the user interface 23 in Figure 2D), the preview window (such as preview window 231) displays the edited target frame, and the selection box of the slider (such as slider 232) is a thumbnail of the edited target frame. The areas of the slider other than the selection box area are grayed out. The grayed-out state can be displayed as gray and cannot be triggered.

[0224] Furthermore, assuming the user triggers a reset of the first editing interface, the electronic device can respond to the reset operation applied to the first editing interface (such as clicking the reset control 132 in the user interface shown in Figure 2D), delete the editing effects superimposed on the target frame, and display the first editing interface in its initial state (user interface 13 shown in Figure 1C). Specifically, the electronic device can first delete the editing effects of the target frame on the preview window of the first editing interface and the target frame thumbnail on the slider; initialize the display content of MediaPlayer and SurfaceView; move MediaPlayer seekTo to the position of the cover image; update the preview window of the first editing interface to the cover image; un-gray out the slider and set the slider progress to the position of the cover image thumbnail.

[0225] Next, the form and hardware / software architecture of the electronic device provided in the embodiments of this application will be described.

[0226] Electronic devices can be equipped with Or other portable terminal devices with different operating systems, such as mobile phones, tablets, desktop computers, laptops, handheld computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices and / or smart city devices, etc.

[0227] Figure 6A exemplarily illustrates the hardware structure of an electronic device according to an embodiment of this application. As shown in Figure 6A, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 126, a camera 130, a display screen 140, an audio module 150, a speaker 150A, a receiver 150B, a microphone 150C, a headphone jack 150D, and a sensor module 160. The sensor module 160 may include a pressure sensor 160A, a distance sensor 160F, a proximity light sensor 160G, a touch sensor 160K, an ambient light sensor 160L, etc.

[0228] The processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.

[0229] The controller can serve as the nerve center and command center of an electronic device. Based on the instruction opcode and timing signals, the controller generates operation control signals to control the fetching and execution of instructions.

[0230] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0231] In some embodiments, the processor 110 may include one or more interfaces. Interfaces 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.

[0232] In this embodiment, the processor 110 can be used to run a gallery application. The processor 110 is used to control the various modules in the gallery application to execute the editing functions of the embodiments in Figures 1A-1D, 2A-2K, and 3A-3C, so as to realize the image processing method provided in this application.

[0233] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a limitation on the structure of the electronic device. In other embodiments of this application, the electronic device may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0234] Internal memory 126 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).

[0235] Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, fifth generation DDR SDRAM is generally called DDR5 SDRAM), etc.

[0236] Non-volatile memory can include disk storage devices and flash memory.

[0237] Flash memory can be classified according to its operating principle, including NOR FLASH, NAND FLASH, 3D NAND FLASH, etc.; according to the level of the storage cell, including single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; and according to the storage specification, including universal flash storage (UFS) and embedded multimedia card (eMMC), etc.

[0238] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.

[0239] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.

[0240] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, music, video, and other files can be stored in the external non-volatile memory.

[0241] Electronic devices implement display functions through a GPU, a display screen 140, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 140 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0242] Display screen 140 is used to display images, videos, etc. Display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be manufactured using organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), miniled, microLEDs, micro-OLEDs, quantum dot light-emitting diodes (QLEDs), etc. In some embodiments, the electronic device may include one or N displays 140, where N is a positive integer greater than 1.

[0243] Electronic devices can achieve shooting functions through ISP, camera 130, video codec, GPU, display 140 and application processor.

[0244] The ISP (Image Signal Processor) is used to process data fed back from the camera 130. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimizations on image noise, brightness, etc. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 130.

[0245] Camera 130 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device may include one or N cameras 130, where N is a positive integer greater than 1.

[0246] In this embodiment, the camera 130 may be a telephoto camera, a main camera, a wide-angle camera, etc.

[0247] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when an electronic device is selecting a frequency, a DSP can perform a Fourier transform on the frequency energy.

[0248] Video codecs are used to compress or decompress digital video. Electronic devices can support one or more video codecs. This allows the electronic device to play or record video in various encoded formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0249] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0250] Electronic devices can implement audio functions, such as music playback and recording, through audio modules 150, speakers 150A, receivers 150B, microphones 150C, headphone jacks 150D, and application processors.

[0251] The audio module 150 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 150 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 150 may be located in the processor 110, or some functional modules of the audio module 150 may be located in the processor 110.

[0252] The speaker 150A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Electronic devices can listen to music or make hands-free calls through the speaker 150A.

[0253] The receiver 150B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When an electronic device answers a phone call or voice message, the receiver 150B can be brought close to the ear to hear the voice.

[0254] Microphone 150C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 150C, inputting the sound signal into microphone 150C. Electronic devices can have at least one microphone 150C. In some embodiments, electronic devices can have two microphones 150C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic devices can have three, four, or more microphones 150C, enabling sound signal collection, noise reduction, sound source identification, and directional recording, among other functions.

[0255] The 150D headphone jack is used to connect wired headphones. The 150D headphone jack can be a USB interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0256] The structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. For example, the electronic device may also include buttons, motors, indicators, and a subscriber identification module (SIM) card interface, etc. As another example, the sensor module may also include: a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an accelerometer, a fingerprint sensor, a temperature sensor, a bone conduction sensor, etc.

[0257] Figure 6B illustrates the software architecture of an electronic device according to an embodiment of this application.

[0258] As shown in Figure 6B, the layered architecture divides the system into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom: application layer, application framework layer, system layer, and kernel layer. Wherein:

[0259] The application layer can include a series of application packages. For example, an application package may include a gallery app, a camera app, and other applications.

[0260] The image library application may include, but is not limited to: image preview modules, dynamic image editing modules, encoding / decoding modules, other editing modules, image saving modules, and image caching modules (not shown), etc.

[0261] The image preview module is mainly responsible for the human-computer interaction of the gallery application, such as controlling the gallery display interface (the preview interface below) and the display of the preview screen, and sensing and responding to user operations that occur in the preview interface.

[0262] The dynamic image editing module is used to display the editing interface corresponding to the dynamic image (the first editing interface below), and to process the content displayed on the editing interface (e.g., capturing the content displayed in the preview window). Specifically, the dynamic image editing module may include a video track management module, which is used to edit the sliders in the editing interface corresponding to the dynamic image.

[0263] The encoding / decoding module is used to extract static images from the video corresponding to the dynamic images.

[0264] Other editing modules are used to edit static images within dynamic images. These other editing modules can specifically include multiple modules, such as a doodle editing module, a watermark editing module, and a cropping editing module.

[0265] The image saving module is used to save static images within a dynamic image as a separate static image. It should be noted that the static images saved by the image saving module can be either unedited or static images created through editing by other editing modules.

[0266] The image caching module is a shared functional module with other modules outside the gallery. It is used to manage image caching, as well as the storage of editing effects and editing effects (doodles, cropping, etc.).

[0267] The application framework layer mainly involves the camera framework, which may include camera access interfaces such as camera management and camera devices. It plays a bridging role and can interact with the camera application through the application programming interface (API) and with the HAL through the HAL interface definition language (HIDL).

[0268] The software architecture may also include a hardware abstraction layer (HAL), which is not shown in Figure 6B. The hardware abstraction layer is an interface layer located between the application framework layer and the kernel layer, providing a virtual hardware platform for the operating system.

[0269] The kernel layer serves as the layer between hardware and software. It includes drivers for various hardware components, such as display drivers, camera drivers, audio drivers, and sensor drivers. The kernel layer may also include digital signal processor (DSP) drivers (not shown) and image processor (IP) drivers (not shown). Specifically, the camera driver drives the image sensors of one or more cameras in the camera module to acquire images and drives the image signal processor to preprocess the images. The DSP driver drives the digital signal processor to process images. The IPC driver drives the graphics processor to process images.

[0270] Based on the hardware and software architecture of the above-mentioned electronic device, the image processing methods provided by various embodiments of this application will be described in detail below with reference to Figures 7 and 8.

[0271] Figure 7 illustrates an image processing method for editing a static image within a dynamic image using an electronic device, as described in an embodiment of this application. The method includes some or all of the following steps:

[0272] S11: The image preview module receives a request to display the first dynamic image.

[0273] In some embodiments, a user can trigger an electronic device to launch a gallery application, and then trigger the electronic device to display images from the gallery application. These images may include animated images, still images, and videos. Assuming the user triggers the display of a first animated image, as shown in Figure 1A, the user can click on the thumbnail 110 of the first animated image displayed in the user interface 11. Correspondingly, the image preview module of the electronic device can receive the request to display the first animated image.

[0274] It is understandable that users can also trigger the display of the first dynamic image through voice, gestures, or other means. This application does not restrict the specific way in which a user triggers the display of the first dynamic image on an electronic device.

[0275] S12: The image preview module acquires the first dynamic image.

[0276] In some embodiments, after receiving a request to display a first animated image, the image preview module obtains the display data of the first animated image from the media library. For example, the file format of the first animated image obtained by the image preview module can be as shown in Figure 5. Furthermore, based on the third field of the first animated image, the image preview module selects or regions from the first animated image, specifically the first field (i.e., the cover image corresponding to the first animated image) and the second field (i.e., the video corresponding to the first animated image). The display data of the first animated image can be the first field and the second field from the first animated image.

[0277] S13: The image preview module displays the preview interface corresponding to the first dynamic image.

[0278] In some embodiments, after acquiring the display data of the first animated image, the gallery preview module displays a preview interface corresponding to the first animated image based on the display data. This preview interface includes a preview area for displaying the first animated image. The preview interface corresponding to the first animated image may also include other controls; the specific content of the preview interface can be found in the relevant descriptions above. As shown in Figure 1A, the user can click on the thumbnail 110 of the first animated image displayed in the user interface 11. Correspondingly, after acquiring the first animated image, the image preview module of the electronic device can display the user interface 12 shown in Figure 1B. The preview window 121 in the user interface 12 can display the cover image of the first animated image, and when the user long-presses the preview window 121, the video of the first animated image is played.

[0279] S14: The image preview module receives a request to edit the first dynamic image.

[0280] For example, the preview interface corresponding to the first animated image includes an editing control for editing the first animated image. When the user clicks the editing control, the preview module of the electronic device can receive a request to edit the first animated image.

[0281] For example, the preview interface corresponding to the first dynamic image is shown in Figure 1B. The user can click the editing control 122 displayed in the user interface 12 shown in Figure 1B. Correspondingly, the image preview module of the electronic device receives the request to edit the first dynamic image.

[0282] S15: The image preview module can send a display request to the dynamic image editing module. The display request is used to request the display of the first editing interface corresponding to the first dynamic image. The request includes the first dynamic image.

[0283] The request may also include database information of the first animated image, which includes the image file's attributes (such as storage path, file size, creation time, update time, etc.). The database information of the first animated image is used to browse, view, and edit the first animated image.

[0284] In some embodiments, when the image preview module receives a user operation instructing it to display an image, it can determine whether the image requested by the user to be edited is a dynamic image. If the image requested by the user to be edited is a dynamic image, it can send a request to the dynamic image editing module to display the first editing interface corresponding to the image. If the image requested by the user to be edited is not a dynamic image, it can obtain the data of the image and display the preview interface of the image based on the obtained data.

[0285] S16: The dynamic image editing module parses the first dynamic image to obtain the video.

[0286] In one implementation, the file format of the first dynamic image can be as shown in Figure 5. The dynamic image editing module reads the first dynamic image starting from the end. That is, the dynamic image editing module can first parse the end marker of the third field of the first dynamic image to obtain the length of the video byte stream; add the length of the video byte stream and the length of the third field to obtain the video offset; then, determine the start position of the video in the first dynamic image based on the video offset, and determine the end position of the video in the first dynamic image based on the length of the third field; and parse the video from the first dynamic image based on the start position and the end position.

[0287] S17: The dynamic image editing module sends a request to the encoding / decoding module to parse the video.

[0288] S18: The encoding / decoding module parses the video and obtains multiple still images.

[0289] For example, the encoding / decoding module extracts multiple still images from the video at preset intervals, and there is no limit to the number of images extracted.

[0290] S19: The encoding / decoding module sends multiple static images to the dynamic image editing module.

[0291] S20: The dynamic image editing module displays the first editing interface corresponding to the first dynamic image based on multiple static images. The first editing interface includes a slider and a preview window.

[0292] The slider is used to display thumbnails corresponding to multiple static images; the slider in the first editing interface can display thumbnails corresponding to some or all of the multiple static images.

[0293] In one implementation, the dynamic image editing module initializes the slider and preview window of the first editing interface based on the video, and the first editing interface is in its initial state. The slider is used to display thumbnails of the static images corresponding to the first dynamic image (the currently selected thumbnail can be the thumbnail corresponding to the cover image of the first dynamic image); the preview window is used to display the static images corresponding to the thumbnails selected in the slider 134 (the currently displayed preview window can be the cover image pair of the first dynamic image). The specific initialization process can be found in the relevant description in S402, and will not be repeated here.

[0294] For example, the first editing interface can be the user interface 13 shown in FIG1C. The user interface 13 includes a slider 134 and a preview window 131. The slider 134 is used to display a thumbnail of the static image corresponding to the first dynamic image. The thumbnail in the selected state of the slider 134 is the thumbnail corresponding to the cover image of the first dynamic image. The preview window is used to display the cover image of the first dynamic image.

[0295] S21: The dynamic image editing module responds to user operation on the slider by displaying the target frame in the preview window. The target frame is a frame in the static image of the first dynamic image.

[0296] In one implementation, the dynamic image editing module responds to user actions on the slider by displaying the target frame in the preview window and updating the image selected in the slider from the cover image to the target frame.

[0297] For example, as shown in FIG1C, the user can select the thumbnail 134b of the first static image from the slider 134 of the user interface 13. The first static image is the target frame. Correspondingly, the electronic device can display the user interface 14 shown in FIG1D. The thumbnail of the target frame (i.e. the thumbnail 134b of the first static image) in the slider 134 of the user interface 14 is selected, and the target frame is displayed in the preview window 141.

[0298] S22: When the dynamic image editing module receives a request to doodle on the target frame, it requests the doodle editing module to display a second editing interface for doodle on the target frame.

[0299] For example, as shown in Figure 2A, when the electronic device responds to a user operation on the drawing option 135c, it takes a screenshot of the target frame displayed in the preview window 141 through the dynamic image editing module to obtain a screenshot, and then displays the screenshot on the second editing interface.

[0300] It should be understood that the operation is carried out using graffiti as an example. In other embodiments of this application, users can also perform editing operations such as cropping, filtering, and watermarking on the target frame. That is, the second editing interface includes the functional controls corresponding to the first editing, such as the functional controls corresponding to graffiti and the functional controls corresponding to filters. The editing window is used to display the editing process when the user performs the first editing on the target frame.

[0301] S23: The graffiti editing module sends a request to the dynamic image editing module to obtain a screenshot of the target frame.

[0302] S24: The dynamic image editing module performs pixel copying of the target frame displayed in the preview window to obtain a screenshot corresponding to the target frame. For example, the dynamic image editing module can use a screenshot tool (such as pixelCopy) to obtain a screenshot of the SurfaceView area in the preview window to obtain a screenshot corresponding to the target frame.

[0303] In this embodiment, screenshots can improve the display speed of the interface. Specifically, pixelCopy can acquire screenshots based on SurfaceView at millisecond speeds, significantly improving the speed of image display on the interface.

[0304] S25: The dynamic image editing module sends a screenshot to the graffiti editing module.

[0305] S26: The graffiti editing module displays a second editing interface, and the editing window of the second editing interface displays the screenshot.

[0306] For example, the second editing interface can be shown as user interface 21 in Figure 2B, where the electronic device displays a screenshot obtained by the dynamic image editing module from the preview window 141 in Figure 2A on the editing window 211 of user interface 21.

[0307] S27: The graffiti editing module responds to graffiti operations and displays graffiti traces in the screenshot.

[0308] In some embodiments, the electronic device can detect user operations on the editing window of the second editing interface and display the corresponding graffiti marks in a screenshot. For example, the second editing interface can be user interface 21 as shown in FIG2B. As shown in FIG2B, the user can doodle on the screenshot displayed in the editing window 211, and the graffiti editing module of the electronic device responds to the graffiti operation and displays the graffiti marks (arrows) in the screenshot as shown in FIG2C.

[0309] In other embodiments of this application, after the electronic device displays the doodle marks in a screenshot, the user can trigger a return to the first editing interface. Correspondingly, the electronic device updates the first editing interface in response to this user action. The updated first editing interface adds the doodle marks to the preview window, and the thumbnail of the selected state in the slider also adds proportionally reduced doodle marks. For example, this user action could be clicking the dynamic image homepage option 213a as shown in Figure 2C, and the updated first editing interface could be the user interface 23 as shown in Figure 2D.

[0310] Furthermore, after editing a static image within a dynamic image, the electronic device can save the edited image. Please refer to Figure 8, which illustrates an image processing method for saving an edited static image by an electronic device according to an embodiment of this application. This method includes some or all of the following steps:

[0311] S28: When the dynamic image editing module receives a request to save the edited target frame, it sends a save request to the image saving module.

[0312] In one implementation, the electronic device can edit the target frame upon detecting user operation on the editing window of the second editing interface (user interface 21 as shown in Figure 2B); then display the edited target frame (the image in the editing window 221 as shown in Figure 2C) and a save control (save control 214 as shown in Figure 2C); the user can click the save control, and correspondingly, the dynamic image editing module of the electronic device can receive a request to save the edited target frame.

[0313] In another implementation, after the electronic device displays the edited target frame, the user can trigger a return to the first editing interface. Accordingly, the electronic device responds to the user's operation by updating the first editing interface. The updated first editing interface (user interface 23 as shown in Figure 2D) includes the edited target frame and a save control (save as control 133 as shown in Figure 2D). Then, the user can click the save control, and the dynamic image editing module of the electronic device can receive a request to save the edited target frame.

[0314] S29: The dynamic image editing module requests the dynamic image module to save the initialization data of the edited target frame.

[0315] S30: The dynamic image editing module obtains the current slider percentage. The current slider percentage refers to the percentage of the target frame's thumbnail position within the slider.

[0316] S31: The dynamic image editing module sends a request to the video decoding module to obtain the target frame with high resolution.

[0317] In this embodiment, the electronic device can save high-resolution images, so that when the user views the saved image, the electronic device can display the high-resolution image, which can improve the user experience.

[0318] S32: The video decoding module obtains the high-resolution target frame based on the slider percentage and gets the first image.

[0319] For example, the video decoding module calculates the timestamp of the target frame based on the percentage of the slider; then, it extracts the bitmap corresponding to the timestamp from the video of the first dynamic image based on the timestamp to obtain the first image.

[0320] S33: The video decoding module sends the first image to the dynamic image editing module.

[0321] S34: The dynamic image editing module determines the target Exif, target absolute path, and target database information corresponding to the edited target frame.

[0322] For example, the dynamic image editing module can obtain the original Exif of the first dynamic image, modify the image update time in the original Exif to the current time, and obtain the target Exif; obtain the path of the first dynamic image, change the name of the path to the current time and date, and obtain the target absolute path; obtain the database information of the first dynamic image, and obtain the target database information.

[0323] S35: The dynamic image editing module sends initialization data to the image saving module. This initialization data includes the first image, the target Exif, the target absolute path, and the target database information.

[0324] S36: The image saving module creates the first file based on the target's absolute path.

[0325] For example, the image saving module can create a new first file based on the target absolute path.

[0326] S37: The image saving module writes the target Exif file to the first file.

[0327] For example, the image saving module opens the first file and writes the target Exif to the first file.

[0328] S38: The image saving module overlays the effect of the first editing operation onto the first image to obtain a second image.

[0329] S39: The image saving module writes the second image to the first file.

[0330] For example, the image saving module can compress the second image in JPEG format, and then write the compressed second image to the first file; after writing, the file is closed.

[0331] S40: The image saving module uses the updated target database information as the database information for the second image.

[0332] In one implementation, the image saving module can update certain fields in the database information of the first animated image, and use the updated database information as the database information of the second image. The updated fields may include time, hash value, file size, special file type, and whether the image is saved. For example, the image saving module can update the time to the current time, the file size to the file size of the second image, change the special file type to none, and update the saved status to not saved.

[0333] S41: The image saving module inserts the database information of the first file and the second image into the database.

[0334] S42: The image saving module requests the image preview module to refresh the browsing interface of the image library. The refreshed browsing interface includes the second image.

[0335] For example, assuming that before the electronic device saves the edited target frame, the browsing interface of the electronic device's gallery is as shown in the user interface 11 of Figure 1A, and the user interface 11 includes a thumbnail 110 of the first dynamic image; then, after the electronic device saves the edited target frame, the browsing interface of the electronic device's gallery can be as shown in the user interface 28 of Figure 2K, and the user interface 28, compared with the user interface 11, adds a thumbnail 280 of the edited target frame.

[0336] S43: The image saving module sends a message to the dynamic image editing module that the edited target frame has been successfully saved.

[0337] S44: The dynamic image editing module displays that the edited target frame has been successfully saved.

[0338] For example, the dynamic image editing module can display a prompt box on the current interface, which indicates that the edited target frame has been successfully saved.

[0339] For example, the electronic device displays a user interface 23 as shown in FIG2D. When the electronic device detects a user operation on the Save As control 133, it can respond to the user operation and save the doodled static image. During the saving process, a user interface 24 as shown in FIG2E is displayed. The user interface 24 includes a prompt box 240, which is used to indicate that the doodled static image is being saved. For example, the content of the prompt box 240 can be "Saving". After the saving is successful, a user interface 25 as shown in FIG2F is displayed. The user interface 25 can include a prompt box 250, which is used to indicate that the doodled static image has been saved successfully. For example, the content of the prompt box 250 can be "Saved to gallery".

[0340] S45: When the dynamic image editing module receives a reset request, it displays the first editing interface.

[0341] For example, the first editing interface displayed is the first editing interface in its initial state.

[0342] For example, assuming the user triggers a reset on the first editing interface, the electronic device can respond to the reset operation applied to the first editing interface (such as clicking the reset control 132 in the user interface shown in Figure 2D), delete the editing effects superimposed on the target frame, and display the first editing interface in its initial state (user interface 13 shown in Figure 1C).

[0343] S46: When the dynamic image editing module receives a request to exit the first editing interface, it destroys the editing resources.

[0344] The editing resources include cached data of editing effects overlaid on the target frame.

[0345] S47: The dynamic image editing module requests to display the preview interface corresponding to the first dynamic image.

[0346] S48: The image preview module displays the preview interface.

[0347] For example, after the user resets the first editing interface and clicks the return control, the image preview module displays a preview interface of the first dynamic image. Assuming the reset first editing interface is as shown in user interface 13 of Figure 1C, when the electronic device receives a user operation on the return control 136, it can display user interface 12 as shown in Figure 1B, where user interface 12 is the preview interface corresponding to the first dynamic image.

[0348] (II) Preservation Section

[0349] This application provides an image processing method that can improve the efficiency of saving static images in dynamic images.

[0350] In this embodiment, the electronic device can display a first editing interface corresponding to the dynamic image. The user can select a target frame from the first editing interface and trigger the saving of that target frame. Correspondingly, the electronic device, in response to the user's operation of saving the target frame in the dynamic image, saves the target frame as a static image. In this method, the user can select any frame of the dynamic image for individual saving, reducing user operations and improving the user experience.

[0351] In some embodiments, after the electronic device enables the editing function for a static image in a moving image (in the manner shown in Figures 1A-1D or other ways), it can save the static image.

[0352] Assuming the above editing function is enabled, the interface displayed by the electronic device is as shown in Figure 9. The following explanation uses the user interface 14 shown in Figure 9 as an example. In this user interface 14, the image selected in the slider 134 is a thumbnail 134b corresponding to the first static image, and the image displayed in the preview window 141 is the first static image. In one implementation, when the electronic device detects a user operation on the save control 133 in the user interface 14, it can save the first static image in response to the user operation. During the saving process, the user interface 21 shown in Figure 10A can be displayed.

[0353] The difference between the user interface 21 and the user interface 14 may be that the user interface 21 adds a prompt box 210, which is used to indicate that the first static image is being saved. For example, the content of the prompt box 210 may be "Saving".

[0354] Furthermore, after successful saving, the electronic device can display user interface 22 as shown in Figure 10B. The only difference between user interface 22 and user interface 21 is that the prompt box 210 is updated to a prompt box 220. The prompt box 220 is used to indicate that the first static image has been successfully saved; for example, the content of the prompt box 220 could be "Saved to gallery". Apart from the prompt boxes, the other displayed content of user interfaces 21 and 22 can be the same as that of user interface 14, and will not be described further here.

[0355] It should be noted that the prompt box 210 can also be called the first prompt box; the prompt box 220 can also be called the second prompt box.

[0356] In one implementation, the electronic device can stop displaying the prompt box 220 after a preset duration, while still displaying the user interface 14. That is, after the electronic device saves a static image from the dynamic image as a picture using the save control in the editing interface corresponding to the dynamic image, the electronic device can continue displaying the current interface without exiting. Furthermore, the user can continue to select a static image again in the current interface (i.e., the editing interface corresponding to the dynamic image) for saving or editing.

[0357] In some embodiments, assuming the user returns to the gallery application's image gallery interface after saving the first static image, this interface can be represented by user interface 23 as shown in Figure 10C. User interface 23 includes a thumbnail 110 of the first animated image and a thumbnail 230 of the first static image. The user can then click on thumbnail 230 to view the saved first static image. It should be noted that the resolution of the saved first static image may differ from the resolution of the first static image displayed in the preview window 141; the specific saving process can be found in the relevant content below.

[0358] In other embodiments of this application, when the electronic device detects a user operation on the save control 133 in the user interface 14, it saves the selected static image in response to the user operation. During the saving process, the user interface 21 shown in FIG10A may not be displayed. After successful saving, the user interface 24 shown in FIG10D is displayed. This user interface 24 is a large-image interface corresponding to the selected static image. In the embodiments of this application, the large-image interface corresponding to the saved static image (such as user interface 24) can be referred to as the second interface.

[0359] The user interface 24 includes a prompt box 240 and a function area 241. The function area 241 includes multiple function controls. The prompt box 240 is used to display a saved static image in a selected state. Figure 10D exemplarily shows that the function controls include an edit control, a favorite control, a share control, a delete control, and more controls. The edit control is used to edit the image displayed in the prompt box 240; the favorite control sets the image displayed in the prompt box 240 to a favorite state; the share control is used to share the image displayed in the prompt box 240; the delete control is used to delete the image displayed in the prompt box 240; and the more controls are used to display other functions that can be applied to the image displayed in the prompt box 240.

[0360] It should be noted that the image displayed in the prompt box 240 has the same content as the image displayed in the preview window 141, but the resolution may be different. The resolution of the image displayed in the preview window 141 may be lower than that of the image displayed in the prompt box 240.

[0361] In this embodiment, the static image in the first dynamic image displayed in the preview interface corresponding to the first dynamic image (the cover image of the first dynamic image displayed in the preview window 121 of the user interface 12 as shown in Figure 1B) can be called the first static image; the static image displayed in the initial state of the first editing interface (the cover image of the first dynamic image displayed in the preview window 131 of the user interface 13 as shown in Figure 1C) can be called the second static image; and the image displayed after the first editing interface is updated (the static image corresponding to the thumbnail 134b of the selected state displayed in the preview window 141 of the user interface 14 as shown in Figure 9) can be called the third static image.

[0362] Based on the user interface displayed on the aforementioned electronic device, the image processing method provided in the embodiments of this application is described below.

[0363] Figure 11 illustrates an image processing method provided by an embodiment of this application. The method includes some or all of the following steps:

[0364] Step S301: In response to a first user operation instructing the display of a first dynamic image, the electronic device displays a preview interface corresponding to the first dynamic image. The preview interface includes a preview area and editing controls. The preview area is used to display the first dynamic image, and the editing controls are used to edit the first dynamic image.

[0365] In some embodiments, the electronic device may display an application interface of a gallery application (user interface 11 as shown in FIG1A), the application interface including a thumbnail of a first animated image (such as thumbnail 110 in user interface 11); when the electronic device detects a user operation on the thumbnail, in response to the user operation, it displays a preview interface corresponding to the first animated image (user interface 12 as shown in FIG1B), the preview interface including a preview area (such as preview window 121 in user interface 12) and editing controls (such as editing control 122 in user interface 12), the preview area being used to display the first animated image, and the editing controls being used to edit the first animated image.

[0366] The first dynamic image can be a static image, a dynamic image, or a video, etc.

[0367] Please refer to Figure 12, which is a file format structure diagram of a dynamic image provided in an embodiment of this application. As shown in Figure 12, the file format of a dynamic image may include three fields. The first field is a JPEG image, which serves as the cover image of the dynamic image. The second field is the mixed video data, such as an mp4 file. The third field is the description field (TAG) of the dynamic image, which may include three subfields. The first subfield is the version number, for example, if the current version is the second version, the version number can be v2; the second subfield includes the start time and duration, that is, the second subfield is used to record the playback start time and duration during gallery preview. The start time is the time point when the first frame of the video is played during gallery preview; the third subfield is used to record the file length of the video data, which can also be called the video byte stream length.

[0368] The video file length is used to determine the video's position information within the file, which can include the start and end positions. The video offset is the sum of the length of the second field (i.e., the video file length) and the length of the third field. The start position of the video within the file can be determined based on the video offset. The end position of the video within the file can be determined based on the video offset and the video byte stream length.

[0369] Step S302: In response to a second user operation on the editing control, the electronic device displays a first editing interface corresponding to the first dynamic image. The first editing interface includes a slider and a preview window. The slider is used to determine the image to be edited in the first dynamic image, and the preview window is used to display the image to be edited.

[0370] The first editing interface is used to process the first dynamic image, including updating the cover image of the first dynamic image and editing any frame of the static image in the first dynamic image.

[0371] In some embodiments, when the electronic device detects the second user operation, it displays a first editing interface in its initial state. The image to be edited in the first editing interface in its initial state can be a frame from the first animated image, a cover image, or a preset frame. For example, the preview window in the first editing interface in its initial state displays the cover image of the first animated image, and the slider in the first editing interface in its initial state also displays the cover image.

[0372] Optionally, the editing interface corresponding to the first dynamic image may also include at least one editing option and other controls, wherein the at least one editing option includes a first editing option, which is used to perform a first edit on the selected image, wherein the first edit can be graffiti, cropping, filtering, watermarking, etc.

[0373] For example, the editing interface corresponding to the first dynamic image can be seen in the user interface 13 shown in Figure 1C and the user interface 14 shown in Figure 9. The user interface 13 is the first editing interface in the initial state, and the user interface 14 is the first editing interface after the user reselects the static image in the first dynamic image. The preview window can be seen in the relevant description of the preview window 131, the slider can be seen in the relevant description of the slider 134, and at least one editing option can be seen in the relevant description of the option bar 135.

[0374] In some embodiments, when the electronic device detects a second user operation applied to the editing control, it determines, in response to the user operation, whether the image on the current interface is a dynamic image. If the image is determined to be a dynamic image, the editing interface corresponding to the dynamic image is initialized. It is understood that the editing interfaces corresponding to dynamic images and static images may be different.

[0375] In one implementation, the process of an electronic device initializing a first editing interface corresponding to a first dynamic image may specifically include initializing an interface animation, initializing a slider, and initializing a cache, wherein the cache is used to store data during the editing process of the first dynamic image.

[0376] For example, the initialization interface animation of an electronic device may include: (1) executing a cover image movement animation, which refers to the interface change of switching the preview area of ​​the preview interface to the preview window of the editing interface. The initial position is the preview area of ​​the preview interface, and the ending position is the preview window of the editing interface. For example, the animation moves the cover image of the preview window 121 shown in Figure 1B to the preview window 131 shown in Figure 1C; (2) performing a callback after the animation is executed to load the video resources of the first dynamic image. At this time, the preview window of the editing interface has two layers of views. The upper layer is the cover image of the first dynamic image, and the lower layer is the surface view. The surface view is used to display the video resources of the first dynamic image. In this embodiment, the image selected in the slider may be different from the cover image, for example, the resolution may be different. Therefore, the cover image of the first dynamic image is placed on the upper layer to achieve visual consistency.

[0377] The specific process of an electronic device acquiring video resources may include: the electronic device obtaining the address of a first dynamic image in the file system; then, obtaining the file of the first dynamic image based on the address; obtaining the position of the video in the file from the tag at the end of the file; then, obtaining the video based on the position of the video in the file; associating the video with an encoder, which is used to subsequently obtain static images from the first dynamic image, for example, the encoder can be a MediaMetadataRetriever, the electronic device sets the video to the retriever, which provides a unified interface for retrieving frames and metadata from the input media file; associating the video with a media player, that is, setting the video to the MediaPlayer, and combining the MediaPlayer with the SurfaceView to play the video; the electronic device can locate the position of the selected static image based on the percentage of the selected static image number to the total number of video frames by calling the seekTo method of the MediaPlayer; binding the SurfaceView with the MediaPlayer; and then, controlling the image displayed in the SurfaceView by calling the seekTo method of the MediaPlayer.

[0378] For example, initializing a slider in an electronic device may include: initializing a basic view of the slider, which can be a custom view, meaning that the size of the slider, the number of images in the slider, etc., can be preset; then, drawing a cover image as the background image for each frame of the slider; drawing a selection box for the slider, with the cover image drawn in the box, or other effects, such as the size of the selection box being larger than the size of the images in other positions; after acquiring the video, parsing multiple static images from the video, for example, the electronic device can use a MediaExtractor and a MediaCodec to parse specified frames in the video, the number of frames is not limited, such as taking one frame from the video at preset intervals to obtain 10 frames of static images; then, updating the slider background image with the above multiple static images, for example, after obtaining the video of the first dynamic image in the preview window 121 shown in Figure 1B, acquiring multiple static images of the first dynamic image, and then updating the multiple static images to the slider 134 in Figure 1C through alpha animation.

[0379] Step S303: In response to a user operation that instructs the selection of a target frame in the first dynamic image as an image to be edited, the electronic device updates the first editing interface, and the preview window in the updated first editing interface is used to display the target frame.

[0380] In one implementation, when the electronic device detects a user's swipe operation on the slider, it sets the dynamic cover image of the preview window to invisible and displays the underlying SurfaceView; it displays the swipe position on the slider using a checkbox; when a user operation to swipe to the target frame is detected, it displays the checkbox on the target frame; it calculates the percentage of the checkbox on the slider; based on the percentage, it calculates the time point of the target frame in the video; and then, it calls the MediaPlayer's seekTo method to adjust the MediaPlayer's display content to the position corresponding to that time point in the video, causing the SurfaceView to update to the target frame corresponding to that time point. The SurfaceView is used to carry the MediaPlayer's display content.

[0381] For example, the target frame is the first static image corresponding to the thumbnail 134b shown in FIG1C. When the electronic device detects a user operation that slides to the thumbnail 134b of the first static image, it responds to the user operation by displaying the user interface 14 shown in FIG9. The image of the surfaceview in the preview window 141 in the user interface 14 is the target frame, i.e., the first static image.

[0382] Furthermore, based on the updated first edited image, in some embodiments, the electronic device can, in response to a user operation instructing the target frame to be set as the cover image of the first moving image, update the cover image of the first moving image to the target frame, thereby obtaining a second moving image. For example, when the electronic device detects a user operation targeting the cover control 132 in the user interface 14 shown in FIG9, it can set the image to be edited displayed in the preview window 141 of the interface as the cover image of the first moving image, thereby obtaining a second moving image.

[0383] Step S304: In response to the operation of saving the target frame, the electronic device saves the target frame as a still image.

[0384] In one embodiment, a user can select a target frame as an image to be edited using a slider and then save the target frame as a still image. Correspondingly, the electronic device can save the target frame as a still image in response to the save operation.

[0385] For example, assuming the first static image shown in FIG1C is the target frame, the electronic device can, in response to the user operation of sliding to the thumbnail 134b corresponding to the first static image, display the first static image as an image to be edited. The displayed interface can be the user interface 14 shown in FIG9. Furthermore, the electronic device can, in response to the user operation of the save control 133 in the user interface 14, save the first static image.

[0386] In one implementation, the electronic device can display a loading dialog box on the updated first editing interface, indicating that a target frame is being saved. Optionally, the electronic device can be configured not to respond to any user operation while the loading dialog box is displayed, meaning the user cannot perform other operations. During the display of the loading dialog box, the electronic device can perform the saving of the target frame.

[0387] For example, the process of saving the target frame by an electronic device may specifically include: (1) First, obtaining the percentage of the target frame's position on the slider in the current interface (such as the updated first editing interface mentioned above); obtaining the video duration of the video corresponding to the first dynamic image through MediaMetadataRetriever, and then calculating the progress of the target frame in the video based on the aforementioned percentage of position; using the search method (.getScaledFrameAtTime) of MediaMetadataRetriever to obtain the bitmap corresponding to the progress from the video, and the bitmap may be scaled to the same resolution as the cover image of the first dynamic image to obtain a high-resolution target frame; (2) obtaining the original exchangeable image file of the first dynamic image. (3) Determine the absolute path of the target frame. For example, the parent path of the first dynamic image can be set as the parent path of the saved image, and the current time can be set as the name of the target frame to obtain the absolute path of the target frame. (4) Create a new file of the target frame according to the absolute path, open the file, write the target Exif into the file, compress the high-resolution target frame in jpeg format, write the compressed image into the file, and close the file. (5) Obtain the database information (ContentValues) of the first dynamic data, and set the time in ContentValues ​​to the date. (6) Update the time to the current time, update the file path in ContentValues ​​to the absolute path, and obtain the ContentValues ​​of the high-resolution target frame; (7) Insert the ContentValues ​​of the high-resolution target frame into the database, which may include inserting the storage path, creation time, update time and file size of the high-resolution target frame into the MediaProvider database and inserting the above basic information and the special file type of the high-resolution target frame into the MediaLibrary database; (8) Trigger the data refresh of the preview interface corresponding to the high-resolution target frame and the grid interface in the gallery (user interface 11 as shown in Figure 1A).

[0388] In some other embodiments of this application, after performing the above step S303, the electronic device can set the target frame as a cover image or perform a first edit on the target frame.

[0389] In one implementation, the electronic device can display a loading dialog box on the user interface when it detects a user action to set the target frame as the cover image. This loading dialog box indicates that the image is currently being set as the cover image. Optionally, the electronic device can be configured not to respond to any user actions while the loading dialog box is displayed, meaning the user cannot perform other operations. During the display of the loading dialog box, the electronic device can execute the process of setting the target frame as the cover image of the first moving image.

[0390] For example, the execution process may specifically include: (1) First, obtaining the position percentage of the target frame thumbnail on the slider in the current interface (such as the first editing interface after the update mentioned above); obtaining the video duration of the video corresponding to the first dynamic image through MediaMetadataRetriever, and then calculating the progress of the target frame in the video based on the above position percentage; using the search method of MediaMetadataRetriever.(1) Get the bitmap corresponding to the progress in the video using getScaledFrameAtTime, scale the bitmap to the same resolution as the cover image of the first dynamic image, and obtain the target cover image corresponding to the second dynamic image; (2) Obtain the file corresponding to the first dynamic image according to the path of the first dynamic image, specifically, obtain the video data in the first dynamic image and the TAG data at the end of the file; (3) Obtain the original exchangeable image file (Exif) of the first dynamic image; change the image update time in the original Exif to the current time, and obtain the target Exif corresponding to the second dynamic image; (4) Obtain the original database information (ContentValues) of the first dynamic image; (5) Delete the data related to the first dynamic image in the database according to the file path, specifically, delete the data related to the first dynamic image in the MediaLibrary data, delete the data related to the first dynamic image in the MediaProvider database, and delete the file corresponding to the first dynamic image; (6) Create a new file for the second dynamic image, specifically, create a new file according to the absolute path of the first dynamic image; open the file; write the target Exif to the file (that is, write to the file); and write the target Exif to the file. The cover image is compressed in JPEG format and written to a file; the video data in the first dynamic image and the TAG data at the end of the file corresponding to the first dynamic image are appended to the end of the file; the file is closed; the cover image number data at the end of the image file is updated; ContentValues ​​are updated, which may include attributes such as date and time, and whether it is a favorite; the relevant data of the second dynamic image is inserted into the database, such as the storage path, creation time, update time and file size of the second dynamic image being inserted into the MediaProvider database, and the above basic information and the special file type of the second dynamic image being inserted into the MediaLibrary database, where the special file type includes dynamic images and high dynamic range imaging (HDR); (7) the preview interface corresponding to the second dynamic image and the grid interface in the gallery (user interface 11 as shown in Figure 1A) are refreshed; (8) because the file of the first dynamic image is deleted, MediaMetadataRetriever, MediaPlayer and surfaceview are reinitialized.

[0391] The image's Exif data may include information such as camera brand, mobile phone model, flash, shutter speed, aperture size, ISO, and GPS coordinates, which are not limited in this embodiment. The image's database information may include information such as the image's path, creation time, update time, special file type, and file size.

[0392] In another implementation, based on a third user operation in response to an instruction to perform a first edit on a target frame, the electronic device displays a second editing interface for performing the first edit on the target frame. The second editing interface includes an editing window that includes the target frame. Furthermore, the electronic device can display the edited target frame in the editing window in response to an editing operation on the target frame. Furthermore, it can also save the edited target frame in response to a fourth user operation in response to an instruction to save the edited target frame.

[0393] The first editing interface can perform editing operations such as doodling, cropping, filtering, and watermarking. The second editing interface includes functional controls corresponding to the first editing interface, such as functional controls for doodling and functional controls for filtering. The editing window is used to display the editing process when the user performs the first editing on the target frame.

[0394] The form and hardware / software structure of the electronic device used in the (II) storage section can be found in the electronic device used in the (I) editing section above, and will not be repeated here.

[0395] Based on the hardware and software architecture of the above-mentioned electronic device, the image processing methods provided by various embodiments of this application will be described in detail below with reference to Figures 13 and 14.

[0396] Figure 13 illustrates an image processing method for editing a static image within a moving image using an electronic device, as described in an embodiment of this application. The method includes some or all of the following steps:

[0397] S11: The image preview module receives a request to display the first dynamic image.

[0398] In some embodiments, a user can trigger an electronic device to launch a gallery application, and then trigger the electronic device to display images from the gallery application. These images may include animated images, still images, and videos. Assuming the user triggers the display of a first animated image, as shown in Figure 1A, the user can click on the thumbnail 110 of the first animated image displayed in the user interface 11. Correspondingly, the image preview module of the electronic device can receive the request to display the first animated image.

[0399] It is understandable that users can also trigger the display of the first dynamic image through voice, gestures, or other means. This application does not restrict the specific way in which a user triggers the display of the first dynamic image on an electronic device.

[0400] S12: The image preview module acquires the first dynamic image.

[0401] In some embodiments, after receiving a request to display a first animated image, the image preview module obtains the display data of the first animated image from the media library. For example, the file format of the first animated image obtained by the image preview module can be as shown in Figure 13. Furthermore, based on the third field of the first animated image, the image preview module selects or regions from the first animated image, specifically the first field (i.e., the cover image corresponding to the first animated image) and the second field (i.e., the video corresponding to the first animated image). The display data of the first animated image can be the first field and the second field from the first animated image.

[0402] S13: The image preview module displays the preview interface corresponding to the first dynamic image.

[0403] In some embodiments, after acquiring the display data of the first animated image, the gallery preview module displays a preview interface corresponding to the first animated image based on the display data. This preview interface includes a preview area for displaying the first animated image. The preview interface corresponding to the first animated image may also include other controls; the specific content of the preview interface can be found in the relevant descriptions above. As shown in Figure 1A, the user can click on the thumbnail 110 of the first animated image displayed in the user interface 11. Correspondingly, after acquiring the first animated image, the image preview module of the electronic device can display the user interface 12 shown in Figure 1B. The preview window 121 in the user interface 12 can display the cover image of the first animated image, and when the user long-presses the preview window 121, the video of the first animated image is played.

[0404] S14: The image preview module receives a request to edit the first dynamic image.

[0405] For example, the preview interface corresponding to the first animated image includes an editing control for editing the first animated image. When the user clicks the editing control, the preview module of the electronic device can receive a request to edit the first animated image.

[0406] For example, the preview interface corresponding to the first dynamic image is shown in Figure 1B. The user can click the editing control 122 displayed in the user interface 12 shown in Figure 1B. Correspondingly, the image preview module of the electronic device receives the request to edit the first dynamic image.

[0407] S15: The image preview module can send a display request to the dynamic image editing module. The display request is used to request the display of the first editing interface corresponding to the first dynamic image. The request includes the first dynamic image.

[0408] The request may also include database information of the first animated image, which includes the image file's attributes (such as storage path, file size, creation time, update time, etc.). The database information of the first animated image is used to browse, view, and edit the first animated image.

[0409] In some embodiments, when the image preview module receives a user operation instructing it to display an image, it can determine whether the image requested by the user to be edited is a dynamic image. If the image requested by the user to be edited is a dynamic image, it can send a request to the dynamic image editing module to display the first editing interface corresponding to the image. If the image requested by the user to be edited is not a dynamic image, it can obtain the data of the image and display the preview interface of the image based on the obtained data.

[0410] S16: The dynamic image editing module parses the first dynamic image to obtain the video.

[0411] In one implementation, the file format of the first dynamic image can be as shown in Figure 12. The dynamic image editing module reads the first dynamic image starting from the end. That is, the dynamic image editing module can first parse the end marker of the third field of the first dynamic image to obtain the length of the video byte stream; add the length of the video byte stream and the length of the third field to obtain the video offset; then, determine the start position of the video in the first dynamic image based on the video offset, and determine the end position of the video in the first dynamic image based on the length of the third field; and parse the video from the first dynamic image based on the start position and the end position.

[0412] S17: The dynamic image editing module sends a request to the encoding / decoding module to parse the video.

[0413] S18: The encoding / decoding module parses the video and obtains multiple still images.

[0414] For example, the encoding / decoding module extracts multiple still images from the video at preset intervals, and there is no limit to the number of images extracted.

[0415] S19: The encoding / decoding module sends multiple static images to the dynamic image editing module.

[0416] S20: The dynamic image editing module displays the first editing interface corresponding to the first dynamic image based on multiple static images. The first editing interface includes a slider and a preview window.

[0417] The slider is used to display thumbnails corresponding to multiple static images; the slider in the first editing interface can display thumbnails corresponding to some or all of the multiple static images.

[0418] In one implementation, the dynamic image editing module initializes the slider and preview window of the first editing interface based on the video, and the first editing interface is in its initial state. The slider is used to display thumbnails of the static images corresponding to the first dynamic image (the currently selected thumbnail can be the thumbnail corresponding to the cover image of the first dynamic image); the preview window is used to display the static images corresponding to the thumbnails selected in the slider 134 (the currently displayed preview window can be the cover image pair of the first dynamic image). The specific initialization process can be found in the relevant description in S302, and will not be repeated here.

[0419] For example, the first editing interface can be the user interface 13 shown in FIG1C. The user interface 13 includes a slider 134 and a preview window 131. The slider 134 is used to display a thumbnail of the static image corresponding to the first dynamic image. The thumbnail in the selected state of the slider 134 is the thumbnail corresponding to the cover image of the first dynamic image. The preview window is used to display the cover image of the first dynamic image.

[0420] S21: The dynamic image editing module responds to user operation on the slider by displaying the target frame in the preview window. The target frame is a frame in the static image of the first dynamic image.

[0421] In one implementation, the dynamic image editing module responds to user actions on the slider by displaying the target frame in the preview window and updating the image selected in the slider from the cover image to the target frame.

[0422] For example, as shown in FIG1C, the user can select the thumbnail 134b of the first static image from the slider 134 of the user interface 13. The first static image is the target frame. Correspondingly, the electronic device can display the user interface 14 as shown in FIG9. The thumbnail of the target frame (i.e. the thumbnail 134b of the first static image) in the slider 134 of the user interface 14 is selected, and the target frame is displayed on the preview window 141.

[0423] Furthermore, after selecting a target frame from a static image within a dynamic image, the electronic device can save the target frame. Please refer to Figure 14, which illustrates an image processing method for saving a target frame by an electronic device in an embodiment of this application. This method includes some or all of the following steps:

[0424] S22: When the dynamic image editing module receives a request to save the target frame, it sends a save request to the image saving module.

[0425] In one implementation, when the electronic device detects a user operation on the save control 133 in the first editing interface (user interface 14 as shown in FIG9), the electronic device's dynamic image editing module can receive a request to save the target frame.

[0426] S23: The dynamic image editing module requests the dynamic image module to save the initialization data of the target frame.

[0427] S24: The dynamic image editing module obtains the current slider percentage. The current slider percentage refers to the percentage of the target frame's thumbnail position within the slider.

[0428] S25: The dynamic image editing module sends a request to the video decoding module to obtain the target frame with high resolution.

[0429] In this embodiment, the electronic device can save high-resolution images, so that when the user views the saved image, the electronic device can display the high-resolution image, which can improve the user experience.

[0430] S26: The video decoding module obtains the high-resolution target frame based on the slider percentage and gets the first image.

[0431] For example, the video decoding module calculates the timestamp of the target frame based on the percentage of the slider; then, it extracts the bitmap corresponding to the timestamp from the video of the first dynamic image based on the timestamp to obtain the first image.

[0432] S27: The video decoding module sends the first image to the dynamic image editing module.

[0433] S28: The dynamic image editing module determines the target Exif, target absolute path, and target database information corresponding to the target frame.

[0434] For example, the dynamic image editing module can obtain the original Exif of the first dynamic image, modify the image update time in the original Exif to the current time, and obtain the target Exif; obtain the path of the first dynamic image, change the name of the path to the current time and date, and obtain the target absolute path; obtain the database information of the first dynamic image, and obtain the target database information.

[0435] S29: The dynamic image editing module sends initialization data to the image saving module. The initialization data includes the first image, the target Exif, the target absolute path, and the target database information.

[0436] S30: The image saving module creates the first file based on the target's absolute path.

[0437] For example, the image saving module can create a new first file based on the target absolute path.

[0438] S31: The image saving module writes the target Exif file to the first file.

[0439] For example, the image saving module opens the first file and writes the target Exif to the first file.

[0440] S32: The image saving module overlays the effect of the first editing operation onto the first image to obtain a second image.

[0441] S33: The image saving module writes the second image to the first file.

[0442] For example, the image saving module can compress the second image in JPEG format, and then write the compressed second image to the first file; after writing, the file is closed.

[0443] S34: The image saving module uses the updated target database information as the database information for the second image.

[0444] In one implementation, the image saving module can update certain fields in the database information of the first animated image, and use the updated database information as the database information of the second image. The updated fields may include time, hash value, file size, special file type, and whether the image is saved. For example, the image saving module can update the time to the current time, the file size to the file size of the second image, change the special file type to none, and update the saved status to not saved.

[0445] S35: The image saving module inserts the database information of the first file and the second image into the database.

[0446] S36: The image saving module requests the image preview module to refresh the browsing interface of the image library. The refreshed browsing interface includes the second image.

[0447] For example, assuming that before the electronic device saves the target frame, the browsing interface of the electronic device's gallery is as shown in the user interface 11 of Figure 1A, and the user interface 11 includes a thumbnail 110 of the first dynamic image; then, after the electronic device saves the target frame, the browsing interface of the electronic device's gallery can be as shown in the user interface 23 of Figure 10C, and the user interface 23 adds a thumbnail 230 of the target frame compared to the user interface 11.

[0448] S37: The image saving module sends a message to the dynamic image editing module that the target frame has been successfully saved.

[0449] S38: The dynamic image editing module indicates that the target frame has been successfully saved.

[0450] For example, the dynamic image editing module can display a prompt box on the current interface to indicate that the target frame has been successfully saved.

[0451] For example, the electronic device displays the user interface 14 shown in FIG9. When the electronic device detects a user operation on the save control 133, it responds to the user operation and saves the selected static image. During the saving process, the user interface 21 shown in FIG10A is displayed. The user interface 21 includes a prompt box 210, which is used to indicate that the selected static image is being saved. For example, the content of the prompt box 210 can be "Saving". After the saving is successful, the user interface 22 shown in FIG10B is displayed. The user interface 22 can include a prompt box 220, which is used to indicate that the selected static image has been saved successfully. For example, the content of the prompt box 220 can be "Saved to gallery".

[0452] Furthermore, in some embodiments, when the dynamic image editing module receives a request to exit the first editing interface, the image preview module displays a preview interface corresponding to the first dynamic image.

[0453] The term "user interface (UI)" used in the specification, claims, and drawings of this application refers to the medium through which an application or operating system interacts and exchanges information with the user. It converts information from its internal form to a form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java or Extensible Markup Language (XML). This source code is parsed and rendered on the terminal device, ultimately presenting user-recognizable content such as images, text, and buttons. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, images, and text. The attributes and content of controls in the interface are defined using tags or nodes, such as XML tags. <textview> 、 <imgview> 、 <videoview>Nodes define the controls contained in the interface. A node corresponds to a control or property in the interface, and after parsing and rendering, the node is presented as the content visible to the user. In addition, many applications, such as hybrid applications, often contain web pages within their interfaces. A web page, also known as a webpage, can be understood as a special control embedded in the application interface. Web pages are source code written in a specific computer language, such as Hypertext Markup Language (HTML), Cascading Style Sheets (CSS), JavaScript (JS), etc. Web page source code can be loaded and displayed as user-readable content by a browser or a web page display component with browser-like functionality. The specific content contained in a webpage is also defined through tags or nodes in the webpage source code; for example, HTML uses tags or nodes to define the content. 、 、 <video> 、 <canvas>Used to define the elements and attributes of a webpage.

[0454] The most common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be an icon, window, control, or other interface element displayed on the screen of an electronic device. Controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0455] It should be understood that the steps in the above-described method embodiments provided in this application can be implemented by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.

[0456] This application also provides an electronic device that may include a memory and a processor. The memory may be used to store a computer program; the processor may be used to invoke the computer program in the memory to cause the electronic device to perform the methods in any of the above embodiments.

[0457] This application also provides a chip system including at least one processor for implementing the functions involved in the methods performed by the electronic device in any of the above embodiments. In one possible design, the chip system further includes a memory for storing program instructions and data, the memory being located within or outside the processor. The chip system may be composed of chips or may include chips and other discrete devices.

[0458] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.

[0459] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. 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 disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.

[0460] For example, the chip system may 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 micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0461] This application also provides a computer program product, which includes a computer program (also referred to as code or instructions) that, when run, causes a computer to perform the method executed by the electronic device in any of the above embodiments.

[0462] This application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions). When the computer program is run, it causes the computer to perform the method executed by the electronic device in any of the above embodiments.

[0463] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.

[0464] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk).

[0465] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0466] In summary, the above are merely embodiments of the technical solution of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made according to the disclosure of the present invention should be included within the scope of protection of the present invention.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. An image processing method, characterized in that, Applied to electronic devices, the method includes: Display a first interface, the first interface including a first static image and a first control, the first static image corresponding to a first dynamic image, the first dynamic image including multiple frames of static images; In response to a user operation applied to the first control, a first editing interface is displayed. The first editing interface includes a first thumbnail, a second thumbnail, and a second static image. The first thumbnail and the second thumbnail are thumbnails corresponding to two static images in the first dynamic image. The first thumbnail is in a selected state. The first thumbnail corresponds to the second static image. The first static image and the second static image correspond to the same static image in the first dynamic image. The first editing interface also includes a second control. In response to a user action applied to the second thumbnail, a third static image corresponding to the second thumbnail is displayed at the location of the second static image, wherein the second thumbnail is selected. In response to a user operation applied to the second control, a second editing interface is displayed. The second editing interface includes a fourth static image and a third control. The third static image and the fourth static image correspond to the same frame static image in the first dynamic image. In response to a user operation applied to the fourth static image, the editing effect of the fourth static image is displayed; In response to a user operation applied to the third control, the first editing interface is displayed, whereby the editing effect of the fourth static image is displayed at the position of the third static image, and the editing effect of the fourth static image is also displayed at the position of the second thumbnail.

2. The method according to claim 1, characterized in that, The first editing interface includes a first save control; the method further includes: In response to a user operation applied to the first save control, a target image is generated based on the editing effect of the fourth static image; Save the target image.

3. The method according to claim 2, characterized in that, The method further includes: In response to a user operation on the first save control, a first prompt box is displayed on the first editing interface, the first prompt box indicating that an image is being saved; After the target image is saved, a second prompt box is displayed on the first editing interface. The second prompt box is used to indicate that the image has been successfully saved. Cancel the display of the second prompt box.

4. The method according to any one of claims 1-3, characterized in that, The second editing interface also includes a second save control, and the method further includes: When a user operation is received that is applied to the second save control, the target image is generated based on the editing effect of the fourth static image; Save the target image; After the target image is saved, a second interface is displayed, which includes the target image.

5. The method according to any one of claims 2-4, characterized in that, The generation of the target image includes: Based on the second thumbnail, determine the position information of the fourth static image in the video corresponding to the first dynamic image; Based on the location information, a first image is obtained from the video; Increase the resolution of the first image to obtain the second image; Based on the editing effect of the fourth static image, the second image is processed to obtain the target image.

6. The method according to any one of claims 1-5, characterized in that, The second editing interface is displayed, including: The location area of ​​the third static image will be captured to obtain the fourth static image.

7. The method according to any one of claims 1-6, characterized in that, The first editing interface includes a reset control; the method further includes: In response to a user action on the reset control, the first editing interface is displayed. The first editing interface includes a first thumbnail, a second thumbnail, and a second static image, wherein the first thumbnail is selected.

8. The method according to any one of claims 1-7, characterized in that, The first static image is the cover image of the first dynamic image.

9. The method according to any one of claims 2-8, characterized in that, The electronic device stores the target image, including: Obtain the storage path, initial exchangeable image file (Exif), and initial database information corresponding to the first dynamic image; the initial Exif includes parameters of the first dynamic image, including time. The electronic device obtains the storage path corresponding to the target image based on the storage path corresponding to the first dynamic image and the current time. Based on the storage path corresponding to the target image, create the target file corresponding to the target image; Modify the time in the initial Exif to the current time to obtain the target Exif; Write the target Exif file and the target image into the target file; The initial database information is updated with the file information of the target image to obtain the target database information; the file information of the target image includes the storage path corresponding to the target image and the creation time of the target file. Save the target database information to the database.

10. The method according to any one of claims 1-9, characterized in that, The first editing interface is displayed, including: Obtain the video corresponding to the first dynamic image; The video is decoded using an encoding / decoding module to obtain the multiple frames of still images.

11. The method according to any one of claims 1-10, characterized in that, The second control is any one of the following: cropping control, graffiti control, watermark control, filter control, text control, mosaic control, blur control, frame control, and color preservation control.

12. An image processing method, characterized in that, Applied to electronic devices, the method includes: Display a first interface, the first interface including a first static image and a first control, the first static image corresponding to a first dynamic image, the first dynamic image including multiple frames of static images; In response to a user operation applied to the first control, a first editing interface is displayed. The first editing interface includes a first thumbnail, a second thumbnail, and a second static image. The first thumbnail and the second thumbnail are thumbnails corresponding to two static images in the first dynamic image. The first thumbnail is in a selected state. The first thumbnail corresponds to the second static image. The first static image and the second static image correspond to the same static image in the first dynamic image. The first editing interface also includes a second control. In response to a user action applied to the second thumbnail, a third static image corresponding to the second thumbnail is displayed at the location of the second static image, wherein the second thumbnail is selected. In response to a user action performed on the second control, the third static image is saved.

13. The method according to claim 12, characterized in that, The method further includes: In response to a user action on the second control, a first prompt box is displayed on the first editing interface, the first prompt box indicating that an image is being saved; After the third static image is saved, a second prompt box is displayed on the first editing interface. The second prompt box is used to indicate that the image has been successfully saved. Cancel the display of the second prompt box.

14. The method according to claim 12, characterized in that, The method further includes: After the third static image is saved, a second interface is displayed, which includes the third static image.

15. The method according to any one of claims 12-14, characterized in that, Saving the third static image includes: Based on the second thumbnail, determine the position information of the third static image in the video corresponding to the first dynamic image; Based on the location information, a first image is obtained from the video; Increase the resolution of the first image to obtain the second image; Save the second image.

16. The method according to any one of claims 12-15, characterized in that, The first editing interface also includes a third control; the method further includes: In response to a user operation applied to the third control, a second editing interface is displayed. The second editing interface includes a fourth static image and a fourth control. The third static image and the fourth static image correspond to the same frame of static image in the first dynamic image. In response to a user operation applied to the fourth static image, the editing effect of the fourth static image is displayed; In response to a user operation applied to the fourth control, the first editing interface is displayed, whereby the editing effect of the fourth static image is displayed at the position of the third static image, and the editing effect of the fourth static image is also displayed at the position of the second thumbnail.

17. The method according to claim 16, characterized in that, The second editing interface also includes a fifth control, and the method further includes: When a user operation is received that is applied to the fifth control, the target image is generated based on the editing effect of the fourth static image; Save the target image; After the target image is saved, a third interface is displayed, which includes the target image.

18. The method according to claim 16 or 17, characterized in that, The first editing interface includes a reset control; the method further includes: In response to a user action on the reset control, the first editing interface is displayed. The first editing interface includes a first thumbnail, a second thumbnail, and a second static image, wherein the first thumbnail is selected.

19. The method according to any one of claims 12-18, characterized in that, The first static image is the cover image of the first dynamic image.

20. The method according to any one of claims 13-19, characterized in that, The electronic device stores the third still image, including: Obtain the storage path, initial exchangeable image file (Exif), and initial database information corresponding to the first dynamic image; the initial Exif includes parameters of the first dynamic image, including time. The electronic device obtains the storage path corresponding to the third static image based on the storage path corresponding to the first dynamic image and the current time. Based on the storage path corresponding to the third static image, create the target file corresponding to the third static image; Modify the time in the initial Exif to the current time to obtain the target Exif; Write the target Exif file and the third static image into the target file; The file information of the third static image is used to update the initial database information to obtain the target database information; the file information of the third static image includes the storage path corresponding to the third static image and the creation time of the target file. Save the target database information to the database.

21. The method according to any one of claims 12-20, characterized in that, The first editing interface is displayed, including: Obtain the video corresponding to the first dynamic image; The video is decoded using an encoding / decoding module to obtain the multiple frames of still images.

22. The method according to any one of claims 14-21, characterized in that, The second interface is the large image interface corresponding to the third static image in the gallery application of the electronic device. The second interface includes at least one of the following: an edit control, a favorite control, a share control, and a delete control.

23. An electronic device, characterized in that, It includes one or more processors and one or more memories; wherein the one or more memories are coupled to one or more processors, and the one or more memories are used to store computer program code, the computer program code including computer instructions, which, when executed by one or more processors, cause the method of any one of claims 1-22 to be performed.

24. A chip system, applied to an electronic device, the chip system comprising one or more processors, characterized in that, The processor is used to invoke computer instructions to cause the execution of the method as claimed in any one of claims 1-22.

25. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the electronic device, they cause the method of any one of claims 1-22 to be performed.