Image processing method and electronic equipment

By providing a dynamic image editing interface on electronic devices, users can directly edit and save static images in dynamic images, solving the problem of poor editing experience in the prior art and achieving a convenient and efficient image processing process.

CN119031236APending Publication Date: 2024-11-26HONOR DEVICE CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202310613144.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

When existing electronic devices edit dynamic images, users need to perform multiple steps, resulting in poor experience and difficulty in editing every frame of the dynamic images in an efficient and efficient manner.

Method used

Provide an image processing method. Through the editing interface of displaying dynamic images, users can directly select and edit any static images in the dynamic images, perform graffiti, crop, etc., and support saving and viewing and editing without leaving the current interface. The image simplifies the user's operation process.

Benefits of technology

Improve user experience, reduce operation steps, and realize convenient editing and saving of multi-frame static images in dynamic images, avoiding the cumbersome operation of manually entering again after jumping out of the current interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031236A_ABST
    Figure CN119031236A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method and electronic equipment, the electronic equipment can display a first editing interface, and the first editing interface comprises a thumbnail corresponding to a static image in a first dynamic image; in response to a user operation of selecting the thumbnail, displaying a static image corresponding to the thumbnail, and displaying the thumbnail in a selected state; and in response to a user operation for editing the static image, editing the static image, and further displaying an effect after the static image is edited. According to the method, any frame of static image of the dynamic image can be edited.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to an image processing method and electronic equipment. Background Art

[0002] At present, many electronic devices have the function of shooting dynamic images. Dynamic images can produce dynamic effects during playback, allowing users to experience wonderful visual effects.

[0003] In some application scenarios, users want to further edit dynamic images to obtain static images that meet their personalized needs. How to conveniently and efficiently edit dynamic images is a problem that the industry urgently needs to solve. Summary of the invention

[0004] The present application provides an image processing method and electronic device, which can conveniently and efficiently edit each static image frame in a dynamic image.

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

[0006] Display a first interface, the first interface includes a first static image and a first control, the first static image corresponds to the first dynamic image, and the first dynamic image includes multiple frames of static images;

[0007] In response to a user operation on 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 image frames 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 frame in the first dynamic image, and the first editing interface also includes a second control;

[0008] In response to a user operation on the second thumbnail, a third static image corresponding to the second thumbnail is displayed at the position of the second static image, and the second thumbnail is in a selected state;

[0009] In response to a user operation on the second control, a second editing interface is displayed, wherein the second editing interface includes a fourth static image and a third control, and the third static image and the fourth static image correspond to the same static image frame in the first dynamic image;

[0010] In response to a user operation acting on the fourth static image, displaying an editing effect of the fourth static image;

[0011] In response to a user operation on the 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 displays the editing effect of the fourth static image at the position of the second thumbnail.

[0012] In the embodiment of the present application, after the user selects any static image in the dynamic image and determines the second control (such as a graffiti control), the electronic device can display the second editing interface for the user to edit, and then display the effect of the static image after editing. In this method, the user does not need to perform additional operations such as setting the selected image as the cover first, and the user operation is reduced, which can improve the user experience.

[0013] The editing effect of the fourth static image may be the display content after the editing effect is superimposed on the fourth static image, for example, the display content after graffiti marks or filters are superimposed on the fourth static image, or the display content after the fourth static image is cropped.

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

[0015] In the embodiment of the present application, the user can save the editing effect of the fourth static image as a static image based on the first saving control in the first editing interface. This method can meet the user's need to save an edited static image.

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

[0017] In an embodiment of the present application, the electronic device can display a prompt box during and after saving the target image; then, the prompt box is canceled and the current interface, i.e., the first editing interface, is still displayed. Then, the electronic device can reset the first editing interface, and then, the static image in the dynamic image can be reselected for editing. This method can meet the needs of users who want to edit multiple static images in a dynamic image, avoid the cumbersome operation of the user having to manually enter the current interface again after jumping out of the current interface, and can effectively improve the user experience.

[0018] In combination with the first aspect, in some embodiments, the second editing interface also includes a second save control, and the method also includes: when a user operation acting on the second save control is received, 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.

[0019] In the embodiment of the present application, the electronic device can jump out of the current interface, that is, the first editing interface, after saving the target image, and then display the second interface including the target image. This method can meet the user's need to view the target image.

[0020] Optionally, the second interface may further include processing controls such as editing controls and sharing controls. Furthermore, the electronic device may process the target image in response to user operations acting on the above processing controls, for example, share the target image in response to user operations acting on the above sharing controls. This method can meet the user's needs for further operations on the target image, can reduce the user's operations of exiting the first editing interface and then entering the second interface from the gallery application, and can effectively improve the user experience.

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

[0022] In the embodiment of the present application, the electronic device can obtain a fourth static image with a high resolution, and perform editing on the fourth static image with a high resolution to achieve the same editing effect as the editing effect of the fourth static image. However, the resolution of the target image can be higher than the resolution of the editing effect of the fourth static image displayed on the screen. This method can save an image with a higher resolution, and when the user subsequently views or processes the image, the user can view an image with a higher resolution, which can improve the user experience.

[0023] In combination with the first aspect, in some embodiments, displaying the second editing interface includes: taking a screenshot of a location area where the third static image is displayed to obtain a fourth static image.

[0024] In the embodiment of the present application, the electronic device can take a screenshot of the location area where the third static image is displayed when the first editing interface jumps to the second editing interface to obtain a fourth static image. Since the screenshot speed is faster than the speed of reacquiring the third static image, the method can display the second editing interface faster, reduce the time the user waits for the interface to be displayed, and improve the user experience.

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

[0026] In an embodiment of the present application, the electronic device can reset the first editing interface, and then reselect the static image in the dynamic image for editing. This method can meet the user's need to edit multiple static images in the dynamic image, avoid the cumbersome operation of the user manually entering the current interface again after jumping out of the current interface, and can effectively improve the user experience. In combination with the first aspect, in some embodiments, the first static image is the cover image of the first dynamic image.

[0027] In combination with the first aspect, in some embodiments, the electronic device saves the target image, including:

[0028] Acquire a storage path, an 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, and the parameters include time;

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

[0030] Based on the storage path corresponding to the target image, create a target file corresponding to the target image;

[0031] Modify the time in the initial Exif to the current time to get the target Exif;

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

[0033] The target image file information is used to update the initial database information to obtain the target database information; the target image file information includes the storage path corresponding to the target image and the creation time of the target file;

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

[0035] In the embodiment of the present application, the electronic device can generate the data of the target image based on the data of the first dynamic image. The method changes the data of the first dynamic image faster than regenerating the data of the target image, and can improve the speed of saving the target image.

[0036] In combination with the first aspect, in some embodiments, displaying the first editing interface includes: acquiring a video corresponding to the first dynamic image; and decoding the video through a codec module to obtain multiple frames of static images.

[0037] In combination with the first aspect, in some embodiments, the second control is any one of a crop control, a graffiti control, a watermark control, a filter control, a text control, a mosaic control, a blur control, a photo frame control, and a retain color control.

[0038] In the embodiment of the present application, the specific function of the second control is not limited. The electronic device can perform any editing operation on any frame image in the first dynamic image. This method can meet the personalized needs of users and effectively improve user experience.

[0039] In a second aspect, the present application provides an electronic device, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.

[0040] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions so that the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.

[0041] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, causes the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0042] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0043] It can be understood that the electronic device provided in the second aspect, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figures 1A to 1D The user interface for opening the "edit" function for any static image in the dynamic image is exemplarily shown;

[0045] Figures 2A to 2K The user interface of an electronic device when graffitiing a static image in a dynamic image is exemplarily shown;

[0046] FIG. 3A to FIG. 3C The user interface of an electronic device when cropping a static image in a dynamic image is exemplarily shown;

[0047] Figure 4 is a flow chart of an image processing method provided by an embodiment of the present application;

[0048] Figure 5 It is a file format structure diagram of a dynamic image provided by an embodiment of the present application;

[0049] Fig. 6A It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

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

[0051] Figure 7 and Figure 8 It is a flowchart of the image processing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.

[0053] Currently, many electronic devices have the function of taking dynamic images, where dynamic images can also be called dynamic photos.

[0054] Exemplarily, the shooting interface of the camera application of the electronic device includes a control for turning on dynamic images. Then, the electronic device can turn on the function of shooting dynamic images in response to the user operation of clicking the control; further, when the electronic device detects the user operation of instructing shooting, it can shoot dynamic images in response to the user operation. In the embodiment of the present application, the number of frames and duration of the dynamic image are not limited. For example, the duration of the dynamic image can include 3 seconds, which are 1.5 seconds before and 1.5 seconds after the moment when the electronic device detects the user operation of instructing shooting. The dynamic image is composed of static images shot by the electronic device within these 3 seconds, which can be 90 frames.

[0055] In some application scenarios, users want to obtain a static image frame in a dynamic image and edit it due to personalized needs. For example, when shooting a dynamic image of a close-up of a person, the user is satisfied with a certain frame of the person image in the dynamic image and wants to save the person image separately; for another example, in a dynamic image recording the movement of an object, the user wants to perform text editing and other operations on a certain frame of the object image in the dynamic image.

[0056] Currently, the electronic device needs to set the static image selected by the user from the dynamic image as the cover image before the image can be saved, edited, etc. This method causes the user to perform many operations and poor user experience.

[0057] In view of this, an embodiment of the present application provides an image processing method, which can improve the efficiency of processing static images in dynamic images.

[0058] In an embodiment of the present application, the electronic device can display a first editing interface corresponding to a dynamic image; the user can select a target frame from the first editing interface and trigger the first editing of the target frame. Accordingly, in response to the user operation of selecting a target frame from the dynamic image for the first editing, the electronic device displays a second editing interface for the first editing of the target frame; in response to the user operation acting 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 image of the dynamic image for editing, and the user operation is less, which can improve the user experience.

[0059] The electronic device is an electronic device with display services, such as a smart phone, a tablet computer, a large-screen device, etc. The image processing method provided in the embodiment of the present application can be embodied as an "editing" function on the electronic device.

[0060] First, the embodiment of the present application is described in conjunction with a user interface (UI) provided on an electronic device to provide an "editing" function for any static image in a dynamic image.

[0061] Figures 1A to 1D The following example shows the UI for opening the "Edit" function for any static image in the dynamic image.

[0062] Figure 1A The user interface 11 involved in the embodiment of the present application is exemplarily shown. The user interface 11 is an application interface of the gallery application exemplarily provided in the embodiment of the present application, and the user interface 11 includes a thumbnail 110 of the first dynamic image. Optionally, the user interface 11 may also include static images and videos, etc., which are not limited here.

[0063] Among them, a dynamic image refers to an image with dynamic effects, which can be reflected as a dynamic effect produced by switching between multiple static images for display or video playback according to preset rules; a static image is an image with a static picture. In an embodiment of the present application, a dynamic image may include a static image (such as a cover image) and a video (such as an MP4 file). Exemplarily, 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 video corresponding to the dynamic image when a user operation (such as a long press operation) is received.

[0064] It should be noted that the dynamic image includes a video, that is, the dynamic image may include multiple frames of static images obtained based on the video.

[0065] The cover image may also be referred to as a cover frame. For example, the cover image has the same content as a frame of an image in the video, but has a different resolution.

[0066] like Figure 1A As shown, the electronic device can detect a user operation indicating display of the thumbnail 110, and in response to the operation, the electronic device can display the following Figure 1B The user interface 12 is shown.

[0067] Figure 1B The following is an exemplary illustration of the preview interface corresponding to the first dynamic image provided in the embodiment of the present application. Figure 1B As shown, the preview interface may include an identifier 120A, a parameter 120B, a preview window 121 and an edit control 122. It should be noted that the preview interface corresponding to the first dynamic image may also be referred to as a first interface, and the edit control 122 may also be referred to as a first control.

[0068] Among them, the mark 120A is used to indicate that the image displayed on the current interface is a dynamic image; the parameter 120B is used to display the shooting parameters and other information of the image displayed on the current interface; the preview window 121 is used to display the first dynamic image, for example, the preview window 121 plays the dynamic image in a loop, that is, the image displayed in the preview window 121 may not be static; the editing control 122 is used to edit the first dynamic image. Optionally, the preview interface may also include a sharing control and a collection control, etc., which are not limited in the embodiment of the present application.

[0069] like Figure 1B As shown, when the electronic device detects a user operation on the editing control 122, in response to the user operation, the electronic device opens the editing function for the first dynamic image and displays the editing interface corresponding to the first dynamic image. For example, when the electronic device detects the user operation, the electronic device may display the following Figure 1CThe user interface 13 shown, that is, the user interface 13 is an editing interface corresponding to the first dynamic image. It should be noted that the editing interface corresponding to the first dynamic image (that is, the user interface 13) can also be called a first editing interface.

[0070] The user interface 13 includes a preview window 131, a set as cover control 132, a save as control 133 (also referred to as a first save control), a slider 134, an option bar 135, and a return control 136. The image displayed in the preview window 131 may be a cover image of the first dynamic image, and the thumbnail 134a selected in the slider 134 is a thumbnail corresponding to the cover image. The cover image may be any frame in the first dynamic image, which is not limited in the embodiment of the present application.

[0071] The slide bar 134 is used to display thumbnails of static images that constitute the dynamic image (ie, the first dynamic image) in the preview window 131, such as Figure 1C The thumbnail 134a corresponding to the cover image and the thumbnail 134b of the first static image are shown; Figure 1C In the example, six frames of static images are shown in the user interface 13. The embodiment of the present application does not limit the number of images displayed by the sliding bar, and it can also be 10 frames, etc.

[0072] Optionally, the image in the slide bar 134 can be displayed in response to a user operation. For example, the slide bar 134 in the user interface 13 can only display a thumbnail of a portion of the static image of the first dynamic image. When the electronic device detects a left slide operation on the slide bar 134, the slide bar 134 can display Figure 1B Thumbnails of still images that are not displayed.

[0073] In the embodiment of the present application, a bold border is used to represent the image currently selected in the slider. For example, a user can select a thumbnail from the slider, and the thumbnail can be displayed with a bold border to indicate the selected state.

[0074] Optionally, when the user does not perform a selection operation on the slider, such as when the interface entered after clicking the editing control 122 and receiving the user's selection operation, the selected thumbnail may be a thumbnail corresponding to a preset static image, such as a thumbnail corresponding to a cover image. Figure 1C As shown, the border of the thumbnail 134a corresponding to the cover image in the slider 134 is in a bold state, that is, the image selected in the slider 134 is the thumbnail 134a corresponding to the cover image. In other embodiments of the present application, a color image may represent a selected image, and other grayscale static images may represent unselected images, which is not limited in the present embodiment.

[0075] The preview window 131 is used to display the static image selected from the dynamic image. Figure 1C As shown, the image selected in the slide bar 134 is the thumbnail 134a corresponding to the cover image, and the image displayed in the preview window 131 is the cover image.

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

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

[0078] The option bar 135 may include a dynamic image home page option 135a and various editing options, and the various editing options may include a cropping option 135b and a graffiti option 135c, etc. The present application embodiment does not limit the specific content and number of the editing options. Among them, the editing option can also be called a second control; the dynamic image home page option 135a can be called a third control.

[0079] In the embodiment of the present application, the option interface selected in the option bar 135 is exemplarily represented by bold characters, and the option interface is the current interface. Figure 1C As shown, 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 a selected state, and the current user interface 13 is an editing interface corresponding to the dynamic image.

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

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

[0082] like Figure 1C As shown, when the electronic device detects a user operation of sliding to the thumbnail 134b of the first static image, in response to the user operation, the electronic device may display an editing interface corresponding to the first static image, such as Figure 1D It should be noted that the above sliding operation is only an exemplary implementation, and 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 detecting a user operation of clicking the thumbnail 134b of the first static image.

[0083] It should be noted that in the embodiments of the present application, any one of the user operations may be a touch operation of the user (such as a click operation, a long press operation, an up slide operation, a down slide operation or a side slide operation), or a non-contact operation (such as an air gesture), or a voice command of the user. The embodiments of the present application do not impose any specific restrictions on this.

[0084] The user interface 14 includes a preview window 141, a slider 134, a set as cover control 132, a save as control 133, an option bar 135, and a return control 136, wherein 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 in an unselected state. The difference between the user interface 14 and the user interface 13 may be that the selected image in the slider 134 is different, and the display content of the preview window 131 and the preview window 141 is different.

[0085] Not limited to Figure 1A-Figure 1D The method shown is to turn on the "editing" function of the electronic device for the static image in the dynamic image. The user can also turn on the "editing" function in other ways, such as long pressing the dynamic image to turn on the "editing" function, and long pressing any frame in the dynamic image to turn on the "editing" function for the frame.

[0086] In some embodiments, after the electronic device turns on the editing function for a static image frame in a dynamic image, the static image can be edited by graffiti, cropping, filtering, watermarking, and other editing operations.

[0087] The following is an illustrative description using the graffiti function as an example.

[0088] See also Figures 2A to 2K , Figures 2A to 2K The UI diagram involved when an electronic device doodles on a static image in a dynamic image is exemplified.

[0089] Figure 2A The user interface 14 for editing the first static image 1410 in the first dynamic image is exemplarily shown in the embodiment of the present application. The user interface 14 includes a slide bar 134 and a preview window 141, wherein the image selected in the slide bar 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.

[0090] like Figure 2A As shown, when the electronic device detects a user operation acting on the graffiti option 135c, in response to the operation, the electronic device may display Figure 2BThe user interface 21 shown. It should be understood that, here, the second control is graffiti option 135c as an example for explanation, and the user interface 21 is the second editing interface corresponding to the second control.

[0091] The user interface 21 includes an editing window 211, a graffiti function area 212, an option bar 213, a save control 214 (also referred to as a second save control) and a return control 215. Among them:

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

[0093] The graffiti function area 212 includes a plurality of graffiti function controls, such as a straight line control, a pencil setting, and an eraser, etc., which are not limited in the embodiment of the present application.

[0094] The option bar 213 includes selected options (ie, the graffiti option 213c) and unselected options (eg, the dynamic image homepage option 213a, the cropping option, and the filter option, etc.). Figure 2B In the example, the graffiti option 213c is in bold, indicating that the graffiti option 213c is the selected option, that is, indicating that the current interface (i.e., the user interface 22) is an interface for graffiti on a static image. It can be understood that the interface when the graffiti option is in bold is a graffiti interface for the image in the preview window, and the interface is used to perform graffiti operations on the image in the preview window. For example, the user interface 21 is a graffiti interface for the first static image 1410.

[0095] The return control 215 is used to return to the preview interface corresponding to the first dynamic image. When the electronic device detects a user operation on the return control 215, it can display the following Figure 1B User interface 12.

[0096] In some embodiments, the user can doodle on the first static image 1410 in the editing window 211 through the doodle function of the doodle function area 212. Figure 2B As shown, when the electronic device detects a graffiti operation (such as a line with an arrow) acting on the editing window 211, in response to the above operation, the electronic device displays Figure 2C The user interface 22 is shown.

[0097] It should be noted that, in the embodiment of the present application, the first static image 1410 may also be referred to as a fourth static image, and the above-mentioned graffiti operation is a user operation acting on the fourth static image. The number of user operations acting on the fourth static image is not limited here, and it may be one user operation or multiple user operations. Exemplarily, the above-mentioned graffiti operation may include a user operation of selecting a graffiti function control in the graffiti function area 212 and graffiti operations in the editing window 211.

[0098] The user interface 22 includes an editing window 221, a graffiti function area 212, an option bar 213, a save control 214 and a return control 215. Among them, the editing window 221 is used to display a static image after graffiti. The difference between the user interface 22 and the user interface 21 may be that the images displayed in the editing window are different. It should be noted that in the embodiment of the present application, the first static image 1410 can also be called the fourth static image, then, the content displayed in the editing window 221 is the editing effect of the fourth static image, specifically the first static image 1410 with graffiti traces.

[0099] In some embodiments, after the user doodles on the static image in the dynamic image, the user can instruct the electronic device to save the static image after graffiti through user operation. The specific process of the electronic device saving the static image after graffiti can refer to the relevant content of the following embodiment.

[0100] In one implementation, after graffitiing a static image in a dynamic image, the electronic device can respond to a user operation of returning to an editing interface corresponding to the dynamic image by displaying the graffitied static image in the editing interface corresponding to the dynamic image; further, upon receiving a user operation of saving the graffitied static image as a picture, the static image after graffiti is saved.

[0101] like Figure 2C As shown, when the electronic device detects a user operation on the dynamic image home page option 213a in the user interface 22, the electronic device displays the following Figure 2D The user interface 23 shown in the figure includes a preview window 231 and a slide bar 232, wherein the preview window 231 displays the static image after the graffiti, and the image selected in the slide bar 232 is also a thumbnail 232b of the static image after the graffiti. Optionally, the unselected image in the slide bar 232 can be in a closed state, for example, it is not touchable.

[0102] It should be noted that Figure 2D In the example, the selected state is indicated by a bold border. In other embodiments of the present application, the thumbnail of the selected state can also be displayed in grayscale, or the thumbnail of the selected state can be displayed in color while the thumbnails of other unselected states are displayed in gray. The embodiments of the present application are not limited to this.

[0103] Furthermore, when the electronic device detects a user operation on the save as control 133, it can save the graffiti static image in response to the user operation, and display the following information during the saving process: Figure 2E The user interface 24 shown in the figure includes a prompt box 240, which is used to prompt that the static image after the graffiti is currently being saved. For example, the content of the prompt box 240 can be "saving"; after the saving is successful, it is displayed as follows Figure 2F The user interface 25 shown in the figure may include a prompt box 250, which is used to prompt that the static image after graffiti has been successfully saved. For example, the content of the prompt box 250 may be "saved to the gallery". Except for the prompt box, the other display contents of the user interface 24 and the user interface 25 may be the same as the user interface 23, which will not be repeated here. The prompt box 240 may also be called the first prompt box; the prompt box 250 may also be called the second prompt box.

[0104] Furthermore, the electronic device may not display the prompt box 250 after displaying the prompt box 250 for a preset time, and display the user interface 23. That is to say, after the electronic device saves a frame of static image in the dynamic image as a picture through the save control in the editing interface corresponding to the dynamic image, the electronic device does not exit the display of the current interface. Furthermore, the user can continue to edit the static image in the dynamic image in the current interface (i.e., the editing interface corresponding to the dynamic image). It can be understood that this method can meet the user's need to edit multiple frames of static images in the dynamic image, and can improve the user experience.

[0105] Optionally, when the electronic device detects a user operation on the save as control 133, in response to the user operation, the static image after the graffiti is saved, and the image is not displayed. Figure 2E The user interface 24 shown and Figure 2F The user interface 25 shown still displays the current interface (such as the user interface 23).

[0106] In another implementation, after graffitiing a static image in a dynamic image, the electronic device may save the graffitied static image in response to a save operation on a graffiti interface for the static image.

[0107] like Figure 2G As shown, when the electronic device detects a user operation on the save control 214 in the user interface 22, it saves the graffiti image (hereinafter referred to as the graffiti image for convenience of description), that is, the image in the editing window 221, and then displays the preview interface corresponding to the graffiti image, such as Figure 2HThe user interface 26 shown. The user interface 26 includes a preview window 261 and other controls, wherein the preview window is used to display the graffiti image.

[0108] In the embodiment of the present application, the electronic device jumps to the large image interface of the image after saving the edited image, and then the user can edit or share the image, etc. This method can meet the user's needs for processing the saved image and improve the user experience. Among them, the electronic device jumps to the large image interface of the image (such as user interface 26) after saving the edited image, which can also be called the second interface.

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

[0110] For example, Figure 2G The image displayed in the editing window 221 in the user interface 22 shown in FIG. Figure 2H The resolutions of the images displayed in the preview window 261 in the user interface 26 are different, and the resolution of the image displayed in the user interface 26 is higher. How the electronic device obtains the graffiti image with improved resolution can be seen in the relevant embodiments below, which will not be expanded here.

[0111] In other embodiments of the present application, after the user doodles on the static image in the dynamic image, the user can abandon the doodle operation and return to the preview interface. Fig.2I As shown, when the electronic device detects a user operation on the return control 215 in the user interface 22, in response to the user operation, the electronic device may display a Figure 2J The user interface 27 shown in FIG. 1 includes an editing window 221, a graffiti 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 confirmation control 270A and a cancel control 270B. If the electronic device detects a user operation on the confirmation control 270A, the electronic device may display the following Figure 1B If the electronic device detects a user operation for canceling the control 270B, the electronic device may display a Fig.2I The user interface 22 is shown.

[0112] In some embodiments, after the electronic device saves the graffiti image, when the user opens the gallery application, the electronic device displays a thumbnail of the graffiti image. Figure 2CThe user operation of clicking the Save As control 133 as shown or Figure 2G When the user clicks the save control 214 as shown, the graffiti image is saved; after the electronic device saves the graffiti image, if the user receives the user's operation of opening the gallery, it can display the following Figure 2K The user interface 28 shown. The user interface 28 includes a thumbnail 280 corresponding to the graffiti image and a thumbnail 110 corresponding to the first dynamic image. The difference between the user interface 28 and the user interface 11 is that the thumbnail 280 is added to the user interface 28, and the positions of the thumbnails 110 in the two interfaces are different.

[0113] The following is an illustrative description using the cropping function as an example.

[0114] See also FIG. 3A to FIG. 3C , FIG. 3A to FIG. 3C The following is an exemplary diagram of a UI involved when an electronic device crops a static image in a dynamic image.

[0115] Figure 3A The user interface 14 for editing the first static image in the first dynamic image is exemplarily shown in the embodiment of the present application. The user interface 14 includes a slide bar 134 and a preview window 141, wherein the image selected in the slide bar 134 is a thumbnail 134b of the first static image, and the image displayed in the preview window 141 is the first static image.

[0116] like Figure 3A As shown, when the electronic device detects a user operation acting on the crop option 135b, in response to the operation, the electronic device may display Figure 3B The user interface 31 shown is a cropping interface for the first static image.

[0117] The user interface 31 may include a save control 311, a cropping window 312, a cropping function area 313, an option bar 314 and a return control 315. Among them:

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

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

[0120] The cropping function area 313 includes multiple cropping function controls, such as free adjustment controls, original scale scaling controls, and rotation controls, which are not limited in the embodiments of the present application.

[0121] The option bar 314 includes selected options (ie, the crop option 314b) and unselected options (eg, the dynamic image homepage option 314a, the graffiti option 314c, and the filter option 314d, etc.). Figure 3BIn the example, the selected cropping option 314b is used to indicate that the current interface (ie, the user interface 32) is an interface for cropping a static image.

[0122] The return control 215 is used to return to the preview interface corresponding to the first dynamic image. When the electronic device detects a user operation on the return control 215, it can display the following Figure 1A User interface 12.

[0123] In some embodiments, the user can crop the static image in the cropping window 312 by setting the cropping function area 313. Figure 2B As shown, the electronic device can detect the user operation acting on the cropping window 312, and in response to the above operation, the electronic device can display Figure 3C The user interface 32 is shown.

[0124] It should be noted that, in the embodiment of the present application, the image displayed in the cropping window 312 may also be referred to as a fourth static image, and the user operation acting on the cropping window 312 is the user operation acting on the fourth static image. The number of user operations acting on the fourth static image is not limited here, and may be one user operation or multiple user operations. Exemplarily, the user operation acting on the cropping window 312 may include a user operation of selecting a cropping function control in the cropping function area 313 and operations such as cropping in the cropping window 312.

[0125] 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 is used to display the cropped image. The difference between the user interface 23 and the user interface 22 may be that the images displayed in the cropping window are different. It should be noted that in the embodiment of the present application, the image displayed in the cropping window 312 may also be referred to as the fourth static image, then, the content displayed in the editing window 221 is the editing effect of the fourth static image, specifically, the partial image after the image displayed in the cropping window 312 is cropped.

[0126] In some embodiments, after cropping the static image, the user can instruct the electronic device to save the cropped static image through user operation. The user interface in the process of the electronic device saving the cropped static image can refer to the user interface in the process of saving the static image after graffiti, which will not be repeated here. In the embodiment of the present application, the saved static image after cropping and graffiti can be referred to as the target image.

[0127] Based on the user interface displayed on the above-mentioned electronic device, the image processing method provided in the embodiment of the present application is introduced below.

[0128] Figure 4An image processing method provided by an embodiment of the present application is shown. The method includes some or all of the following steps:

[0129] Step S401: In response to a first user operation instructing to display a first dynamic image, the electronic device displays a preview interface corresponding to the first dynamic image, the preview interface including a preview area and an editing control, the preview area is used to display the first dynamic image, and the editing control is used to edit the first dynamic image.

[0130] In some embodiments, the electronic device may display an application interface of the gallery application (eg, Figure 1A The application interface includes a thumbnail of the first dynamic image (such as the thumbnail 110 in the user interface 11); when the electronic device detects a user operation on the thumbnail, in response to the user operation, the preview interface corresponding to the first dynamic image (such as Figure 1B The user interface 12 shown in the figure) includes a preview area (such as a preview window 121 in the user interface 12) and an editing control (such as an editing control 122 in the user interface 12), the preview area is used to display the first dynamic image, and the editing control is used to edit the first dynamic image.

[0131] The first dynamic image may be a static image, a dynamic image or a video.

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

[0133] Among them, the file length of the video data is used to determine the position information of the video in the file, and the position information may include the starting position and the ending position; the video offset is the sum of the length of the second field (i.e., the file length of the video data) and the length of the third field, and the starting position of the video in the file can be determined based on the video offset; the ending position of the video in the file can be determined based on the video offset and the length of the video byte stream.

[0134] 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 including a sliding bar and a preview window, the sliding bar 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.

[0135] The first editing interface is used to process the first dynamic image, wherein the processing includes updating the cover image of the first dynamic image, editing any static image frame in the first dynamic image, etc.

[0136] In some embodiments, when the electronic device detects the second user operation, it displays the first editing interface in the initial state. The image to be edited in the first editing interface in the initial state may be a frame in the first dynamic image, a cover image, or a preset frame. For example, the preview window in the first editing interface in the initial state displays the cover image of the first dynamic image, and the slide bar in the first editing interface in the initial state also displays the cover image.

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

[0138] For example, the editing interface corresponding to the first dynamic image can refer to the above Figure 1C The user interface 13 and Figure 1D The user interface 14 shown, wherein 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 refer to the relevant introduction of the preview window 131, the sliding bar can refer to the relevant introduction of the sliding bar 134, and the at least one editing option can refer to the relevant introduction of the option bar 135.

[0139] In some embodiments, when the electronic device detects a second user operation acting on the editing control, in response to the user operation, it determines whether the image of the current interface is a dynamic image, and when it is determined that the image is a dynamic image, it initializes the editing interface corresponding to the dynamic image. It is understandable that the editing interfaces corresponding to the dynamic image and the static image may be different.

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

[0141] Exemplarily, the initialization interface animation of the electronic device may include: (1) executing a cover image moving animation, wherein the cover image moving animation refers to an interface change in which the preview area of ​​the preview interface switches to the preview window of the editing interface, the initial position is the preview area of ​​the preview interface, and the end position is the preview window of the editing interface. For example, the animation is Figure 1B The cover image of the preview window 121 shown moves to Figure 1C In the preview window 131 shown; (2) after the animation is executed, a callback is performed to load the video resource 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 (surfaceview), and the surfaceview is used to display the video resource of the first dynamic image. In the embodiment of the present application, the image selected in the slider may be different from the cover image, such as different resolutions, so here the cover image of the first dynamic image is covered on the upper layer to achieve visual consistency.

[0142] Among them, the specific process of the electronic device obtaining the video resource may include: the electronic device may obtain the address of the first dynamic image in the file system; then, based on the address, obtain the file of the first dynamic image; obtain the position of the video in the file from the tag (TAG) at the end of the file; then, based on the position of the video in the file, obtain the video; associate the video with the encoder, and the association setting is used to subsequently obtain the static image from the first dynamic image. For example, the encoder can be a media metadata retriever (MediaMetadataRetriever), and the electronic device sets the video to the retriever, which provides a unified interface for retrieving frames and metadata from the input media file; associate the video with the media player (MediaPlayer), that is, set the video to MediaPlayer, and combine MediaPlayer with surfaceview to play the video; the electronic device can call the positioning (seekTo) method of MediaPlayer to locate the position of the selected static image based on the percentage of the selected static image number and the total number of video frames; bind surfaceview to MediaPlayer; and then, the image displayed in surfaceview can be controlled by calling MediaPlayer seekTo.

[0143] Exemplarily, initializing a slider of an electronic device may include: initializing a basic view of the slider, which may be a custom view, that is, the custom view means that the size of the slider, the number of images in the slider, etc. may be preset; then, drawing the cover image as the background image of each frame of the image in the slider; drawing a check box of the slider, and drawing the cover image in the box, or other effects, such as the size of the check box being larger than the size of the image position at other positions; after acquiring the video, parsing multiple static images from the video, for example, the electronic device may parse specified frames in the video through a media data extractor (MediaExtractor) and a decoder (MediaCodec), and the number of frames is not limited, such as taking a frame from the video at preset intervals to obtain 10 frames of static images; then, updating the above multiple static images to the slider background image, for example, after obtaining Figure 1B After the video of the first dynamic image in the preview frame 121 is displayed, multiple static images of the first dynamic image are obtained, and then the multiple static images are updated to Figure 1C In the slider 134.

[0144] Step S403: the electronic device updates the first editing interface in response to the user operation instructing to select the target frame in the first dynamic image as the image to be edited, and the preview window in the updated first editing interface is used to display the target frame.

[0145] In one implementation, when an electronic device detects a user sliding operation on a slider, the electronic device may set the dynamic image cover image of the preview window to be invisible, and display the underlying surfaceview; display the sliding position through a check box on the slider; when a user operation of sliding to a target frame is detected, the check box is displayed on the target frame; the percentage of the check box in the slider is calculated; based on the percentage, the time point of the target frame in the video is calculated; and then, the seekTo method of MediaPlayer is called to adjust the display content of MediaPlayer to the position corresponding to the time point in the video, so that the surfaceview is updated to the target frame corresponding to the time point, and the surfaceview is used to carry the display content of MediaPlayer.

[0146] For example, the target frame is Figure 1C When the electronic device detects a user operation of sliding to the thumbnail 134b of the first static image, the electronic device displays the first static image in response to the user operation. Figure 1D In the user interface 14 shown, the image of the surface view in the preview window 141 in the user interface 14 is the target frame, that is, the first static image.

[0147] Furthermore, based on the updated first edited image, in some embodiments, the electronic device may update the cover image of the first dynamic image to the target frame in response to a user operation indicating that the target frame is set as the cover image of the first dynamic image, thereby obtaining a second dynamic image. Figure 1D When the user operates the cover control 132 in the user interface 14 shown, the image to be edited displayed in the preview window 141 in the interface is set as the cover image of the first dynamic image to obtain the second dynamic image.

[0148] In one implementation, when the electronic device detects a user operation of setting the target frame as the cover image, a loading box may pop up on the user interface, and the loading box is used to indicate that the image is currently being set as the cover image. Optionally, the electronic device may be set not to respond to any user operation during the display of the loading box, that is, the user cannot perform other operations. In the process of displaying the loading box, the electronic device may execute the operation of setting the target frame as the cover image of the first dynamic image.

[0149] Exemplarily, the execution process may specifically include: (1) first, obtaining the position percentage 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 according to the above position percentage; using the search method (.getScaledFrameAtTime) of MediaMetadataRetriever to obtain the bitmap corresponding to the progress from the video, scaling the bitmap to the same resolution as the cover image of the first dynamic image, and obtaining the target cover image corresponding to the second dynamic image; (2) obtaining the file corresponding to the first dynamic image according to the path of the first dynamic image, specifically obtaining the video data in the first dynamic image and the TAG data at the end of the file; (3) obtaining the original exchangeable image file (exchangeable image file) of the first dynamic image. file, Exif); 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, which may specifically include deleting the data related to the first dynamic image in the media library (MediaLibrary) data, deleting the data related to the first dynamic image in the database (MediaProvider), and deleting the file corresponding to the first dynamic image; (6) create a new file for the second dynamic image, which may specifically include creating a new file according to the absolute path of the first dynamic image; open the file; write the target Exif into the file (that is, write into 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 picture file is updated; ContentValues ​​is updated, and ContentValues ​​may include attributes such as time and date, whether it is a collection, etc.; the relevant data of the second dynamic image is inserted into the database, for example, it may include inserting the basic information such as the storage path, creation time, update time and file size of the second dynamic image into the MediaProvider database and inserting the above basic information and the special file type of the second dynamic image into the MediaLibrary database, where the special file types include dynamic images and high dynamic range imaging (High Dynamic Range Imaging, HDR), etc.; (7) triggering the display of the preview interface corresponding to the second dynamic image and the grid interface in the gallery (such as Figure 1AThe data of the user interface 11) shown is refreshed; (8) because the file of the first dynamic image is deleted, MediaMetadataRetriever, MediaPlayer and surfaceview are reinitialized.

[0150] Among them, the Exif of the image may include information such as camera brand, mobile phone model, flash, shutter speed, aperture size, sensitivity and GPS coordinates, which is not limited in the embodiment of the present application; the database information of the image may include information such as the image's school path, creation time, update time, special file type and file size.

[0151] In other embodiments, after the user selects the target frame as the image to be edited through the slide bar, the target frame can be saved as a static image. Accordingly, the electronic device can save the target frame as a static image in response to the operation of saving the target frame.

[0152] For example, assuming that Figure 1C The first static image corresponding to the thumbnail 134b shown in the figure is the target frame. When the electronic device detects a user operation of sliding to the thumbnail 134b of the first static image, in response to the user operation, the electronic device determines the first static image as the image to be edited and displays the editing interface corresponding to the first static image, such as Figure 1D The user interface 14 shown; further, the electronic device can save the first static image in response to the user operation on the save as control 133 in the user interface 14.

[0153] In one implementation, the electronic device may pop up a loading box on the updated first editing interface, the loading box being used to indicate that the target frame is being saved. Optionally, the electronic device may be set not to respond to any user operation during the display of the loading box, that is, the user cannot perform other operations. In the process of displaying the loading box, the electronic device may execute the saving of the target frame.

[0154] Exemplarily, the process of saving the target frame by the electronic device may specifically include: (1) first, obtaining the position percentage of the thumbnail of the target frame 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 according to the above position percentage; 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 an image with 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 (exchangeable image file, Exif); change the image update time in the original Exif to the current time, and obtain the target Exif corresponding to the target frame; (3) determine the absolute path of the target frame, for example, the parent path of the first dynamic image can be set to the parent path of the saved image, and the current time can be set to 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, and write the compressed image to the file; close the file; (5) obtain the database information (ContentValues) of the first dynamic data, and set ContentVa lues is updated to the current time, and the file path in ContentValues ​​is updated to the absolute path to obtain the ContentValues ​​of the high-resolution target frame; (6) the ContentValues ​​of the high-resolution target frame is inserted into the database, which may include inserting the basic information such as 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; (7) triggering the display of the preview interface corresponding to the high-resolution target frame and the grid interface in the gallery (such as Figure 1A The data of the user interface 11) shown is refreshed.

[0155] Step S404: in response to a third user operation instructing to perform a first edit on the target frame, the electronic device displays a second editing interface for performing a first edit on the target frame, the second editing interface comprising an editing window, and the editing window comprises the target frame.

[0156] Among them, the first editing can be editing operations such as graffiti, cropping, filters and watermarks, and the second editing interface includes function controls corresponding to the first editing, such as function controls corresponding to graffiti and function controls corresponding to filters; the editing window is used to display the editing process when the user performs the first edit on the target frame.

[0157] In some embodiments, the updated first editing interface includes an editing option corresponding to the first editing, and the electronic device displays the second editing interface when detecting a user operation on the editing option.

[0158] For example, assuming the target frame is Figure 2A The first static image corresponding to the thumbnail 134b in the user interface 14 shown in the figure includes a preview window 141 and a plurality of editing options, such as a graffiti option 135c; assuming that the editing option corresponding to the first editing is the graffiti option 135c, then when the electronic device detects a user operation on the graffiti option 135c, the electronic device can display an editing interface for graffiti on the first static image, such as Figure 2B The user interface 21 shown, wherein the first static image is displayed in the editing window 211 in the user interface 21.

[0159] Optionally, the target frame displayed in the preview window of the second editing interface can be obtained by taking a screenshot of the updated first editing interface. In the embodiment of the present application, the display speed of the second editing interface can be increased by taking a screenshot.

[0160] For example, when the electronic device detects the above-mentioned third user operation acting on the updated first editing interface, it obtains the position percentage of the selected static image in the updated first editing interface in the sliding bar; based on the position percentage, a screenshot of the surfaceview area is obtained through a screenshot tool (such as pixelCopy), wherein the speed of pixelCopy to obtain screenshots based on surfaceview can reach ms level, which greatly improves the display speed of the second editing interface; then, the obtained screenshot is updated to the editing window of the second editing interface.

[0161] Step S405: the electronic device displays the editing effect of the target frame in response to the editing operation on the target frame.

[0162] Among them, the editing operation acting on the target frame can be one or more editing operations, which is not limited in the embodiments of the present application; the editing effect of the target frame refers to the display content at the location of the target frame, for example, when graffiti editing, the editing effect of the target frame is a target frame with graffiti traces, and for example, when cropping editing, the editing effect of the target frame is a target frame whose size and content are changed after cropping.

[0163] It should be noted that, in the embodiment of the present application, the target frame that can also be displayed in the editing window is called the fourth static image, the above-mentioned editing operation acting on the target frame is the user operation acting on the fourth static image, and displaying the editing effect of the target frame is the editing effect of displaying the fourth static image.

[0164] For example, assuming that the editing operation is to add graffiti, the electronic device can respond to the editing operation by adding graffiti to the target frame, and adding a proportionally reduced graffiti to the thumbnail corresponding to the target frame. Figure 2B and Figure 2C .

[0165] Step S406: the electronic device saves the edited target frame in response to the fourth user operation instructing to save the edited target frame.

[0166] In one implementation, when the electronic device detects the fourth user operation, in response to the user operation, it can obtain a high-resolution target frame; superimpose the editing effect on the target frame to obtain an edited target frame; and save the edited target frame. In the embodiment of the present application, the edited target frame saved by the electronic device can also be referred to as a target image.

[0167] For example, the electronic device may first obtain the position percentage of the thumbnail of the target frame in the slider; then, according to the position percentage, use the search method (.getScaledFrameAtTime) of MediaMetadataRetriever to obtain the bitmap of the current video progress; the bitmap is scaled to the same resolution as the cover image (or other resolutions) to obtain the original target frame without superimposed editing effects, and the editing effects of the second editing interface are superimposed on the original target frame to obtain the edited target frame; the original Exif of the dynamic image (i.e., the first dynamic image) corresponding to the target frame is obtained, and the original Exif includes but is not limited to the following information: Information: time information (such as shooting time or update time), shooting parameters, etc.; update the time information in the original Exif according to the current time to obtain the target Exif, and the time information in the target Exif includes the time information whose update time is the current time; 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 target frame, and the current time can be set as the name of the target frame to obtain the absolute path of the target frame; create a new file according to the absolute path and open the corresponding read-write file of the file, write the target Exif into the file, compress the edited target frame in jpeg format, write the compressed image into the file, and close the file.

[0168] In some other embodiments of the present application, the user can trigger a return to the first editing interface after editing the target frame in the second editing interface (eg Figure 2CThe trigger operation shown in the user interface 22 shown in the figure), wherein the first editing interface returned (such as Figure 2D The preview window (such as preview window 231) in the user interface 23) shown in the figure displays the edited target frame, and the selected box of the slider (such as slider 232) is a thumbnail of the edited target frame. The area of ​​the slider except the selected box area is grayed out, where the grayed-out state can be displayed in gray and cannot be triggered.

[0169] Furthermore, assuming that the user triggers the first editing interface to start resetting, the electronic device can respond to the reset operation (such as clicking on the first editing interface) Figure 2D The reset control 132 in the user interface shown in the figure deletes the editing effect superimposed on the target frame and displays the first editing interface in the initial state (such as Figure 1C User interface 13 shown). Specifically, the electronic device may first delete the editing effect 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 the MediaPlayer and the surfaceview; seekTo the MediaPlayer to the position of the cover image; update the preview window of the first editing interface to the cover image; ungray the slider, and set the slider progress to the position of the thumbnail of the cover image.

[0170] Next, the form and software and hardware architecture of the electronic device provided in the embodiments of the present application are introduced.

[0171] Electronic equipment can be equipped Or portable terminal devices with other operating systems, such as mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPC), netbooks, as well as cellular phones, personal digital assistants (PDA), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, vehicle-mounted devices, smart home devices and / or smart city devices, etc.

[0172] Fig. 6A The hardware structure of the electronic device of the embodiment of the present application is exemplified. Fig. 6AAs shown, 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, an earphone interface 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, and the like.

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

[0174] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

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

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

[0177] In the embodiment of the present application, the processor 110 can be used to run the gallery application, and the processor 110 is used to control each module in the gallery application to execute the above Figure 1A-Figure 1D , Figure 2A-2K , Figure 3A-3C The editing function of the embodiment is used to implement the image processing method provided by this application.

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

[0179] The internal memory 126 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0180] Random access memory may 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, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.

[0181] Non-volatile memory may include disk storage devices and flash memory.

[0182] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.

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

[0184] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0185] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.

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

[0187] The display screen 140 is used to display images, videos, etc. The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD). The display screen panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), miniLED, microLed, micro-oled, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 140, where N is a positive integer greater than 1.

[0188] The electronic device can realize the shooting function through the ISP, the camera 130, the video codec, the GPU, the display screen 140 and the application processor.

[0189] The ISP is used to process the data fed back by the camera 130. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 130.

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

[0191] In the embodiment of the present application, the camera 130 may be a telephoto camera, a main camera, a wide-angle camera, or the like.

[0192] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.

[0193] Video codecs are used to compress or decompress digital videos. Electronic devices can support one or more video codecs. In this way, electronic devices can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0194] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and continuously self-learn. NPU can realize applications such as intelligent cognition of electronic devices, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0195] The electronic device can implement audio functions such as music playing and recording through the audio module 150, the speaker 150A, the receiver 150B, the microphone 150C, the headphone jack 150D, and the application processor.

[0196] The audio module 150 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 150 can also be used to encode and decode audio signals. In some embodiments, the audio module 150 can be arranged in the processor 110, or some functional modules of the audio module 150 can be arranged in the processor 110.

[0197] The speaker 150A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device can listen to music or listen to a hands-free call through the speaker 150A.

[0198] The receiver 150B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or voice message, the voice can be received by placing the receiver 150B close to the human ear.

[0199] Microphone 150C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting his mouth close to microphone 150C to input the sound signal into microphone 150C. The electronic device can be provided with at least one microphone 150C. In other embodiments, the electronic device can be provided with two microphones 150C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 150C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0200] The earphone interface 150D is used to connect a wired earphone and can be a USB interface, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0201] The structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components can be implemented in hardware, software, or a combination of software and hardware. For example, the electronic device may also include buttons, motors, indicators, and subscriber identification module (SIM) card interfaces, etc. For another example, the sensor module may also include: a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a fingerprint sensor, a temperature sensor, a bone conduction sensor, and the like.

[0202] Figure 6B The software architecture of the electronic device according to the embodiment of the present application is exemplified.

[0203] like Figure 6BAs shown, the layered architecture divides the system into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer (framework), the system layer, and the kernel layer. Among them:

[0204] The application layer (application) can include a series of application packages. For example, an application package can include applications such as a gallery application and a camera application.

[0205] The gallery application may include but is not limited to: an image preview module, a dynamic image editing module, a codec module, other editing modules, an image saving module and an image caching module (not shown), etc.

[0206] The image preview module is mainly responsible for the human-computer interaction of the gallery application, such as controlling the gallery display interface (such as the preview interface mentioned below) and the display of the preview screen therein, and monitoring and responding to user operations occurring in the preview interface.

[0207] The dynamic image editing module is used to display the editing interface corresponding to the dynamic image (such as the first editing interface below), and to process the display content on the editing interface (for example, to capture the display content on the preview window). The dynamic image editing module may specifically include a video track management module, which is used to edit the slider in the editing interface corresponding to the dynamic image.

[0208] The codec module is used to parse the static image from the corresponding video of the dynamic image.

[0209] The other editing modules are used to edit the static images in the dynamic images, wherein the other editing modules may specifically include a plurality of editing modules, such as a graffiti editing module, a watermark editing module, and a cropping editing module.

[0210] The image saving module is used to save the static image in the dynamic image as a single static image. It should be noted that the static image in the dynamic image saved by the image saving module may be unedited or may be a static image edited by other editing modules.

[0211] The image cache module is a functional module shared by other modules outside the gallery, and is used to manage the image cache, as well as the storage of editing effects and editing effects (graffiti, cropping, etc.).

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

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

[0214] The kernel layer is a layer between hardware and software. The kernel layer includes drivers for various hardware, such as display drivers, camera drivers, audio drivers, and sensor drivers. The kernel layer may also include a digital signal processor driver (not shown) and an image processor driver (not shown). Among them, the camera driver is used to drive the image sensor of one or more cameras in the camera module to collect images and drive the image signal processor to pre-process the image. The digital signal processor driver is used to drive the digital signal processor to process images. The image processor driver is used to drive the graphics processor to process images.

[0215] Based on the hardware and software architecture of the above electronic equipment, the following Figure 7 and Figure 8 The description goes into depth with the architecture to explain the image processing methods provided by each embodiment of the present application.

[0216] Figure 7 An image processing method for editing a static image in a dynamic image by an electronic device in an embodiment of the present application is shown. The method includes some or all of the following steps:

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

[0218] In some embodiments, the user may trigger the electronic device to start the gallery application, and then trigger the electronic device to display images of the gallery application, wherein the images of the gallery application may include dynamic images, static images, and videos. Assume that the user triggers the display of the first dynamic image, such as Figure 1A As shown, the user may click on the thumbnail 110 of the first dynamic image displayed in the user interface 11, and accordingly, the image preview module of the electronic device may receive a request to display the first dynamic image.

[0219] It is understandable that the user can also trigger the display of the first dynamic image through voice, gesture, etc., and the present application does not limit the specific method in which the user triggers the electronic device to display the first dynamic image.

[0220] S12: The image preview module obtains a first dynamic image.

[0221] In some embodiments, after receiving the request to display the first dynamic image, the image preview module obtains the display data of the first dynamic image from the media library. Exemplarily, the file format of the first dynamic image obtained by the image preview module can be as follows: Figure 5 As shown, further, the image preview module machine is based on the third field of the first dynamic image, from the first field (i.e., the cover image corresponding to the first dynamic image) and the second field (i.e., the video corresponding to the first dynamic image) in or around the first dynamic image, and the display data of the first dynamic image can be the first field and the second field in the first dynamic image.

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

[0223] In some embodiments, after obtaining the display data of the first dynamic image, the gallery preview module displays a preview interface corresponding to the first dynamic image based on the display data. The preview interface includes a preview area, and the preview area is used to display the first dynamic image. The preview interface corresponding to the first dynamic image may also include other controls. The specific content of the preview interface can refer to the relevant description above. Figure 1A As shown, the user can click on the thumbnail 110 of the first dynamic image displayed in the user interface 11. Accordingly, after acquiring the first dynamic image, the image preview module of the electronic device can display the following image: Figure 1B The user interface 12 shown, wherein the preview window 121 in the user interface 12 can display the cover image of the first dynamic image, and when the user long presses the preview window 121, the video of the first dynamic image is played.

[0224] S14: The image preview module receives a request for editing the first dynamic image.

[0225] Exemplarily, the preview interface corresponding to the first dynamic image includes an editing control, and the editing control is used to edit the first dynamic image. When the user clicks the editing control, the preview module of the electronic device can receive a request to edit the first dynamic image.

[0226] For example, the preview interface corresponding to the first dynamic image is as follows Figure 1B As shown, users can click Figure 1B The editing control 122 is displayed in the user interface 12 shown, and accordingly, the image preview module of the electronic device receives a request to edit the first dynamic image.

[0227] S15: The image preview module may send a display request to the dynamic image editing module, where the display request is used to request display of a first editing interface corresponding to the first dynamic image, and the request includes the first dynamic image.

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

[0229] In some embodiments, when the image preview module receives a user operation instructing to display a certain 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.

[0230] S16: The dynamic image editing module analyzes the first dynamic image to obtain a video.

[0231] In one implementation, the file format of the first dynamic image can be as follows: Figure 5 As shown, the dynamic image editing module reads the first dynamic image from the tail end, that is, the dynamic image editing module can first parse the tail mark 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 starting position of the video in the first dynamic image based on the video offset, and determine the ending position of the video in the first dynamic image based on the length of the third field; based on the starting position and the ending position, parse the video from the first dynamic image.

[0232] S17: The dynamic image editing module sends a request for parsing the video to the encoding and decoding module.

[0233] S18: The encoding and decoding module parses the video to obtain multiple static images.

[0234] For example, the encoding and decoding module extracts multiple static images from the video at preset intervals, and the number of extracted images is not limited here.

[0235] S19: The encoding and decoding module sends a plurality of static images to the dynamic image editing module.

[0236] S20: The dynamic image editing module displays a first editing interface corresponding to the first dynamic image based on the multiple static images, where the first editing interface includes a slide bar and a preview window.

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

[0238] 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 the initial state. The slider is used to display the thumbnail of the static image corresponding to the first dynamic image (the thumbnail in the currently selected state may be the thumbnail corresponding to the cover image of the first dynamic image); the preview window is used to display the static image corresponding to the thumbnail in the slider 134 that is in the selected state (the current preview window may display the cover image of the first dynamic image). The specific process of initialization can be referred to the relevant description in S402, which will not be repeated here.

[0239] Exemplarily, the first editing interface may be Figure 1C The user interface 13 shown includes a sliding bar 134 and a preview window 131, wherein the sliding bar 134 is used to display a thumbnail of a static image corresponding to the first dynamic image, and the thumbnail in the selected state in the sliding bar 134 is a 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.

[0240] S21: The dynamic image editing module displays a target frame in a preview window in response to a user operation on the sliding bar, where the target frame is a frame in the static image of the first dynamic image.

[0241] In one implementation, the dynamic image editing module responds to the user operation on the slider, displays the target frame in the preview window, and updates the image in the selected state in the slider from the cover image to the target frame.

[0242] For example, Figure 1C As shown, the user can select the thumbnail 134b of the first static image from the slide bar 134 of the user interface 13, and the first static image is the target frame. Accordingly, the electronic device can display the following Figure 1D In the user interface 14 shown, the thumbnail of the target frame (ie, the thumbnail 134 b of the first static image) in the slide bar 134 in the user interface 14 is in a selected state, and the target frame is displayed in the preview window 141 .

[0243] S22: When receiving the request to graffiti the target frame, the dynamic image editing module requests the graffiti editing module to display a second editing interface for graffitiing the target frame.

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

[0245] It should be understood that the operation here is taken as an example. In other embodiments of the present application, the user can also perform editing operations such as cropping, filtering and watermarking on the target frame, that is, the second editing interface includes function controls corresponding to the first editing, such as function controls corresponding to graffiti and function controls corresponding to filters; the editing window is used to display the editing process when the user performs the first edit on the target frame.

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

[0247] S24: The dynamic image editing module copies pixels 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 obtain a screenshot of the surfaceview area in the preview window through a screenshot tool (such as pixelCopy) to obtain a screenshot corresponding to the target frame.

[0248] In the embodiment of the present application, the display speed of the interface can be improved by taking screenshots. Among them, the speed of pixelCopy obtaining screenshots based on surfaceview can reach ms level, which greatly improves the speed of displaying images in the interface.

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

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

[0251] Exemplarily, the second editing interface can be as follows Figure 2B As shown in the user interface 21 shown in the figure, the electronic device displays the dynamic image editing module on the editing window 211 of the user interface 21 from Figure 2A The preview window 141 screenshot is obtained by taking a screenshot.

[0252] S27: The graffiti editing module displays graffiti traces on the screenshot in response to the graffiti operation.

[0253] In some embodiments, the electronic device can detect a user operation on the editing window of the second editing interface and display the graffiti traces corresponding to the graffiti operation in the screenshot. Figure 2B As shown in the user interface 21, Figure 2BAs shown, the user can doodle on the screenshot displayed in the editing window 211, and the doodle editing module of the electronic device responds to the doodle operation and displays the screenshot as shown in FIG. Figure 2C Graffiti traces shown (arrows).

[0254] In some other embodiments of the present application, the user can trigger the return to the first editing interface after the electronic device displays the graffiti trace on the screenshot. Accordingly, the electronic device updates the first editing interface in response to the user operation. The preview window in the updated first editing interface adds the graffiti trace, and the thumbnail in the selected state in the slider also adds the graffiti trace in the same proportion. Exemplarily, the user operation can be as follows: Figure 2C The user operation shown in FIG. 21 shows a click on the dynamic image home page option 213a. The updated first editing interface may be as follows: Figure 2D The user interface 23 is shown.

[0255] Furthermore, after editing the static image in the dynamic image, the electronic device can save the edited image. Figure 8 , Figure 8 The image processing method for saving an edited static image by an electronic device in an embodiment of the present application is shown. The method includes some or all of the following steps:

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

[0257] In one implementation, the electronic device may detect that the second editing interface (such as Figure 2B The target frame is edited by the user operating the editing window of the user interface 21 shown in the figure; and then the edited target frame (such as Figure 2C The image in the edit window 221 shown) and the save control (such as Figure 2C The save control 214 shown); the user can click the save control, and accordingly, the dynamic image editing module of the electronic device can receive a request to save the edited target frame.

[0258] In another implementation, the user can trigger a return to the first editing interface after the electronic device displays the edited target frame. Accordingly, the electronic device updates the first editing interface in response to the user operation. The updated first editing interface (such as Figure 2D The user interface 23 shown in FIG. 2 includes the edited target frame and a save control (eg, Figure 2D The save control 133 shown); further, the user can click the save control, and accordingly, the dynamic image editing module of the electronic device can receive a request to save the edited target frame.

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

[0260] S30: The dynamic image editing module obtains the current percentage of the slider, wherein the current percentage of the slider refers to the percentage of the thumbnail of the target frame in the slider.

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

[0262] In the embodiment of the present application, the electronic device can save high-resolution images, so that when the user views the saved images, the electronic device can display the high-resolution images, which can improve the user experience.

[0263] S32: The video decoding module obtains a high-resolution target frame according to the percentage of the sliding bar to obtain a first image.

[0264] Exemplarily, the video decoding module calculates the timestamp of the target frame according to the percentage of the sliding bar; then, according to the timestamp, a bitmap corresponding to the timestamp is extracted from the video of the first dynamic image to obtain the first image.

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

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

[0267] Exemplarily, 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.

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

[0269] S36: The image saving module creates a first file according to the target absolute path.

[0270] Exemplarily, the image saving module may create a new first file according to the target absolute path.

[0271] S37: The image saving module writes the target Exif into the first file.

[0272] Exemplarily, the image saving module opens the first file and writes the target Exif into the first file.

[0273] S38: The image saving module superimposes the effect of the editing operation of the first editing on the first image to obtain a second image.

[0274] S39: The image saving module writes the second image into the first file.

[0275] Exemplarily, the image saving module may compress the second image in jpeg format, and then write the compressed second image into the first file; after writing, the file is closed.

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

[0277] In one implementation, the image saving module may update some fields in the database information of the first dynamic image, and use the updated database information as the database information of the second image. The updated some fields may include time, hash value, file size, special file type, and whether it is collected, etc. For example, the image saving module may 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 collection to not collected, etc.

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

[0279] S42: the image saving module requests the image preview module to refresh the browsing interface of the gallery, and the refreshed browsing interface includes the second image.

[0280] For example, it is assumed that before the electronic device saves the edited target frame, the browsing interface of the electronic device's gallery is as follows: Figure 1A As shown in the user interface 11, 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 gallery of the electronic device can be as follows Figure 2K As shown in the user interface 28, compared with the user interface 11, the user interface 28 adds a thumbnail 280 of the edited target frame.

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

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

[0283] Exemplarily, the dynamic image editing module may display a prompt box on the current interface, where the prompt box is used to indicate that the edited target frame has been successfully saved.

[0284] For example, the electronic device displays Figure 2D In the user interface 23 shown in FIG. 1 , the electronic device can detect a user operation on the save as control 133 and save the graffiti static image in response to the user operation. Figure 2E The user interface 24 shown in the figure includes a prompt box 240, which is used to prompt that the static image after the graffiti is currently being saved. For example, the content of the prompt box 240 can be "saving"; after the saving is successful, it is displayed as follows Figure 2F The user interface 25 shown may include a prompt box 250, and the prompt box 250 is used to prompt that the static image after graffiti has been saved successfully. For example, the content of the prompt box 250 may be "saved in the gallery".

[0285] S45: When receiving the reset request, the dynamic image editing module displays the first editing interface.

[0286] Exemplarily, the displayed first editing interface is the first editing interface in an initial state.

[0287] For example, assuming that the user triggers the first editing interface to start resetting, the electronic device may respond to the reset operation (such as clicking on the first editing interface) on the first editing interface. Figure 2D The reset control 132 in the user interface shown in the figure deletes the editing effect superimposed on the target frame and displays the first editing interface in the initial state (such as Figure 1C User interface 13) is shown.

[0288] S46: When receiving the request to exit the first editing interface, the dynamic image editing module destroys the editing resources.

[0289] The editing resource includes cached data of the editing effect superimposed on the target frame.

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

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

[0292] Exemplarily, after the user resets the first editing interface, he clicks the return control, and the image preview module displays the preview interface of the first dynamic image. Figure 1C As shown in the user interface 13 of FIG. 13 , upon receiving a user operation for returning to the control 136, the electronic device may display the following Figure 1B The user interface 12 shown is a preview interface corresponding to the first dynamic image.

[0293] The term "user interface (UI)" in the specification, claims and drawings of this application refers to the medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on the terminal device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as . A node corresponds to a control or attribute in the interface. After parsing and rendering, the node is presented as user-visible content. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code. For example, HTML is defined by 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

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

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

[0296] The present application also provides an electronic device, which may include: a memory and a processor, wherein the memory may be used to store a computer program; and the processor may be used to call the computer program in the memory so that the electronic device executes the method in any one of the above embodiments.

[0297] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method performed by the electronic device in any of the above embodiments. In one possible design, the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor. The chip system can be composed of chips, or it can include chips and other discrete devices.

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

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

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

[0301] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which enables a computer to execute the method executed by the electronic device in any of the above embodiments when the computer program is executed.

[0302] The present application also provides a computer-readable storage medium, which stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the electronic device in any of the above embodiments.

[0303] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.

[0304] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. 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 a data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.

[0305] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0306] In short, the above are only embodiments of the technical solution of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. An image processing method, characterized in that: Applied to electronic equipment, the method comprises: Display a first interface, the first interface 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; In response to a user operation on 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 image frames 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 frame in the first dynamic image, and the first editing interface also includes a second control; In response to a user operation on the second thumbnail, displaying a third static image corresponding to the second thumbnail at the position of the second static image, with the second thumbnail being in a selected state; In response to a user operation on the second control, a second editing interface is displayed, wherein the second editing interface includes a fourth static image and a third control, and the third static image and the fourth static image correspond to the same static image frame in the first dynamic image; In response to a user operation acting on the fourth static image, displaying an editing effect of the fourth static image; In response to a user operation acting on the third control, the first editing interface is displayed, and the first editing interface displays the editing effect of the fourth static image at the position of the third static image, and displays the editing effect of the fourth static image at the position of the second thumbnail.

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

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

4. The method according to any one of claims 1 to 3, characterized in that: The second editing interface further includes a second saving control, and the method further includes: When a user operation acting on the second saving control is received, generating the target image based on the editing effect of the fourth static image; Saving the target image; After the target image is saved, a second interface is displayed, where the second interface includes the target image.

5. The method according to any one of claims 2 to 4, characterized in that: The generating of the target image comprises: Based on the second thumbnail, determining position information of the fourth static image in the video corresponding to the first dynamic image; Based on the position information, acquiring a first image from the video; Improving the resolution of the first image to obtain a 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 to 5, characterized in that: The displaying of the second editing interface includes: A screenshot is taken of the location area where the third static image is displayed to obtain the fourth static image.

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

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

9. The method according to any one of claims 2 to 8, characterized in that: The electronic device storing the target image includes: Acquire a storage path, an 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, and the parameters include 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 a target file corresponding to the target image; Modify the time in the initial Exif to the current time to obtain the target Exif; Writing the target Exif and the target image into the target file; The target image file information is used to update the initial database information to obtain the target database information; the target image file information includes the storage path corresponding to the target image and the creation time of the target file; The target database information is saved in a database.

10. The method according to any one of claims 1 to 9, characterized in that: The displaying of the first editing interface includes: Acquire a video corresponding to the first dynamic image; The video is decoded by a coding and decoding module to obtain the multiple frames of static images.

11. The method according to any one of claims 1 to 10, characterized in that: The second control is any one of a crop control, a graffiti control, a watermark control, a filter control, a text control, a mosaic control, a blur control, a photo frame control, and a retain color control.

12. An electronic device, characterized in that: The method comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the method as claimed in any one of claims 1 to 11 is executed.

13. A chip system, the chip system is applied to electronic equipment, the chip system includes one or more processors, characterized in that: The processor is configured to call computer instructions so as to execute the method according to any one of claims 1 to 11.

14. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the method according to any one of claims 1 to 11 is executed.

Citation Information

Cited By

  • Image processing method and electronic device

    EP4607938A1

  • Image processing method and electronic device

    WO2024244639A1

  • Media content editing method, apparatus, electronic device, storage medium, and program product

    WO2026199945A1

  • Media content editing method and apparatus, electronic device, storage medium, and program product

    WO2026199946A1