Image processing method, apparatus, device, and medium
By acquiring and displaying partial frame data of the target dynamic image resource for decoding and rendering, the problem of large memory consumption of dynamic image resources is solved, achieving effective reduction of memory usage and improvement of loading speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2024-11-29
- Publication Date
- 2026-05-29
AI Technical Summary
In existing multimedia editing scenarios, dynamic image resources consume a large amount of memory when displayed, and there is an urgent need for a technology to reduce memory usage.
The target frame data of the target dynamic image resource is acquired, decoded and rendered, and the target frame image is displayed. The number of target frame images is less than the total number of frames. The animation effect is maintained by extracting frame data at intervals and extending the display duration.
It effectively reduces the memory usage required for displaying dynamic image resources, improves loading speed, and significantly saves memory in multimedia editing pages.
Smart Images

Figure CN122120537A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to an image processing method, apparatus, device and medium. Background Technology
[0002] Dynamic image resources such as GIFs (Graphics Interchange Format) and videos can store multiple frames and display them on the screen frame by frame, thus giving users an animated viewing experience. Compared to a single static image, dynamic image resources offer a better visual experience, but they typically require more memory. However, the need to play dynamic image resources is prevalent in current multimedia editing scenarios. Therefore, there is an urgent need for a technology to reduce the memory usage of dynamic image resources when displaying them. Summary of the Invention
[0003] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this disclosure provides an image processing method, apparatus, device and medium.
[0004] This disclosure provides an image processing method, the method comprising: acquiring image data to be processed; wherein the format of the image data to be processed is a graphics interchange format, and the image data to be processed is data corresponding to a target dynamic image resource to be displayed on a target page; acquiring target frame data from the image data to be processed; wherein the target frame data corresponds to a target frame image in the target dynamic image resource, and the number of target frame images is less than the total number of frames of the target dynamic image resource; decoding based on the target frame data, and rendering an image based on the decoding result of the target frame data to obtain the target frame image; and displaying the target frame image.
[0005] Optionally, the target frame data includes the first frame data and the last frame data in the image data to be processed, as well as the frame data extracted from the image data to be processed at preset intervals.
[0006] Optionally, the step of rendering the image based on the decoding result of the target frame data to obtain the target frame image includes: drawing the opaque target frame image completely based on the decoding result of the target frame data.
[0007] Optionally, displaying the target frame image includes: displaying the latest rendered target frame image in sequence based on the rendering order of the target frame images, and the latest rendered target frame image completely covers the previously rendered target frame image.
[0008] Optionally, displaying the target frame image includes: determining the target display duration of the target frame image to be displayed; the target display durations corresponding to different target frame images may be the same or different; and displaying the target frame image based on the target display duration.
[0009] Optionally, determining the target display duration of the current target frame image to be displayed includes: obtaining the number of frames between the current target frame image to be displayed and the next target frame image to be displayed; and determining the target display duration of the current target frame image based on the number of frames between the frames.
[0010] Optionally, determining the target display duration of the target frame image to be displayed based on the interval frame number includes: determining the single-frame image display duration of the target dynamic image resource based on the image data to be processed; obtaining the delayed display duration based on the product of the single-frame image display duration and the interval frame number; and obtaining the target display duration of the target frame image to be displayed based on the sum of the delayed display duration and the single-frame image display duration.
[0011] Optionally, the target page displays resource information for multiple dynamic image resources, and at least one of the multiple dynamic image resources is the target dynamic image resource to be displayed.
[0012] Optionally, the target page is a page presented by a multimedia editor, and the dynamic image resource is material used to import into the editing draft corresponding to the target page; wherein, the editing draft includes target material for generating video and editing information of the target material.
[0013] This disclosure also provides an image processing apparatus, comprising: a first data acquisition module for acquiring image data to be processed; wherein the image data to be processed is data corresponding to a target dynamic image resource to be displayed on a target page; a second data acquisition module for acquiring target frame data from the image data to be processed; wherein the target frame data corresponds to a target frame image in the target dynamic image resource, and the number of target frame images is less than the total number of frames in the target dynamic image resource; an image rendering module for decoding based on the target frame data and rendering an image based on the decoding result of the target frame data to obtain the target frame image; and an image display module for displaying the target frame image.
[0014] This disclosure also provides an electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the image processing method provided in this disclosure.
[0015] This disclosure also provides a computer-readable storage medium storing a computer program for performing the image processing method provided in this disclosure.
[0016] This disclosure also provides a computer program product, including a computer program that is executed by a processor as an image processing method provided in this disclosure.
[0017] The technical solution provided in this disclosure can acquire the image data to be processed corresponding to the target dynamic image resource to be displayed on the target page, and then acquire the target frame data corresponding to the target frame image in the target dynamic image resource only from the image data to be processed; thereby, decoding is performed based on the target frame data, and image rendering is performed based on the decoding result of the target frame data to obtain and display the target frame image. Since the number of target frame images corresponding to the acquired target frame data is less than the total number of frames of the target dynamic image resource, that is, only a portion of the frame data of the target dynamic image resource needs to be decoded, rendered, and displayed, the memory occupied by displaying the dynamic image resource can be effectively reduced.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0020] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic flowchart of an image processing method provided in an embodiment of the present disclosure;
[0022] Figure 2 A schematic diagram illustrating a target dynamic image resource provided in an embodiment of this disclosure;
[0023] Figure 3 This is a schematic flowchart of an image processing method provided in an embodiment of the present disclosure;
[0024] Figure 4 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of the present disclosure;
[0025] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0026] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0027] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0028] Figure 1 This is a flowchart illustrating an image processing method provided in an embodiment of the present disclosure. The method can be executed by an image processing device, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, the method mainly includes the following steps S102 to S108:
[0029] Step S102: Obtain image data to be processed; wherein, the image data to be processed is the data corresponding to the target dynamic image resource to be displayed on the target page. For example, the target dynamic image resource may include any form of image sequence such as a target video or a target GIF. If it is a target GIF, the format of the image data to be processed is Graphics Interchange Format (GUID), which can also be simply referred to as GIF format. That is, in some specific implementation examples, the image data to be processed is the data of the GIF animation to be displayed on the target page. In this case, the image data to be processed can also be called a GIF file. The target page may be a multimedia editing page, a multimedia information display page, a network chat page, or any page that can display dynamic image resources such as GIF animations; there are no restrictions here.
[0030] In some implementations, the target page displays resource information for multiple dynamic image resources, at least one of which is the target dynamic image resource to be displayed. This disclosure does not limit the target page; for example, the target page may display a video frame to be edited by the user, and simultaneously present multiple dynamic image resources for the user to select. The user can select the desired target dynamic image resource according to their needs, and then edit based on the target dynamic image resource. In some specific examples, the target page is a page presented by a multimedia editor, and the dynamic image resources are materials used to import into the corresponding editing draft on the target page; wherein, the editing draft includes target materials for generating the video and editing information for the target materials. By importing the target dynamic image resource selected by the user as material into the editing draft, multimedia editing can be performed based on the target dynamic image resource, such as adding the target dynamic image resource to a specified position in the target video to be edited.
[0031] Step S104: Obtain target frame data from the image data to be processed; wherein, the target frame data corresponds to the target frame image in the target dynamic image resource, and the number of target frame images is less than the total number of frames in the target dynamic image resource.
[0032] For example, target frame data can be read directly from the image data to be processed. That is, a portion of the frame data can be extracted and read from the image data to be processed, instead of reading all the frame data. To ensure that even when processing extracted frame data, a good visual experience can still be presented to the user, and the animation effect of the original dynamic image resource can still be presented to the user, in some embodiments, the target frame data includes the first and last frame data in the image data to be processed, as well as frame data extracted from the image data to be processed at preset intervals. For example, if the target dynamic image resource has multiple frames, it can be read at intervals of 1 frame, that is, read the 1st frame, 3rd frame, 5th frame, 7th frame, etc., or it can be read at intervals of 2 frames, that is, read the data of the 1st frame, 4th frame, 7th frame, etc. The above are just examples. In actual applications, the preset interval can be flexibly set according to the actual situation, and there is no limitation here.
[0033] Although the above method reduces the number of frames of the target dynamic image resource displayed to the user, the first frame, the last frame, and image frames at specified intervals are all displayed to the user. Therefore, the content of the target dynamic image resource can still be presented to the user relatively completely. Furthermore, the method of retaining the last frame can effectively avoid the phenomenon of jumps when playing the target dynamic image resource.
[0034] Step S106: Decode the target frame data and render the image based on the decoding result of the target frame data to obtain the target frame image.
[0035] In some specific implementation examples, the data of dynamic image resources such as GIF animations (i.e., the image data to be processed) is encoded data obtained by processing the LZW (Lempel-Ziv-Welch) lossless data compression algorithm. To reduce memory usage, this embodiment does not decode all the image data to be processed; it only needs to decode and render the data of the read portion (target frame data). In practical applications, the target frame data can be data of a portion of the target dynamic image resource (i.e., the target frame image). In practical applications, all read target frame data can be decoded uniformly, or they can be decoded sequentially according to the order in which the target frame data is read; no limitation is imposed here. However, when rendering the image based on the decoding result of the target frame data, it is necessary to render the image sequentially based on the corresponding decoding result according to the order in which multiple target frame data are read.
[0036] Step S108: Display the target frame image. It should be noted that there are usually multiple target frame images. They can be rendered and displayed in the order in which the target frame data is acquired. Each time, the latest rendered target frame image is displayed, thereby displaying multiple target frame images in sequence to form an animated effect.
[0037] Each target dynamic image resource to be displayed on the target page can be executed by referring to steps S102 to S108 provided in the embodiments of this disclosure. For multimedia editing pages or information display pages that need to play and display multiple target dynamic image resources at the same time, the above method can more significantly save the amount of memory required to display multiple target dynamic image resources at the same time.
[0038] In the above method, since the number of target frame images corresponding to the target frame data read is less than the total number of frames of the target dynamic image resource, it is only necessary to decode, render and display a portion of the frame data of the target dynamic image resource. Therefore, the memory required to display the target dynamic image resource can be effectively reduced.
[0039] In some implementations, the step of rendering the image based on the decoding result of the target frame data to obtain the target frame image can, in practice, completely draw the opaque target frame image based on the decoding result of the target frame data. It should be noted that the above image decoding and rendering method differs significantly from the decoding and rendering methods for dynamic image resources such as GIFs in related technologies. Taking GIFs as an example, the following is a detailed explanation:
[0040] In related technologies, the data corresponding to a GIF animation (also known as a GIF file) stores multiple fields for each frame of the image. These fields include information such as the size and data volume of the frame, and a field associated with the next frame called GCE (Graphic Control Extension). The GCE field's position in each frame is relatively fixed; it's a special field in the GIF file format that carries information about the next frame. Specifically, this field contains a processing method, indicating how to handle the previous frame when rendering the current frame. For example, for the first, second, and third frames, the GCE field in the data corresponding to the second frame carries information about the third frame. When processing the third frame, the GCE field in the second frame can be used to accurately determine how to process it. Specifically, there are three processing methods:
[0041] Method 1: Draw a full-size, opaque image of the current frame and replace / overwrite the previous frame image with it. Even if two consecutive frames have only minor differences in local areas, each frame still needs to be drawn completely and independently.
[0042] Method 2: The current frame image is locally rendered based on the differences between the previous and current frames. Pixels from the previous frame not covered by the current frame will continue to be displayed. This method optimizes GIF animations, as the current frame only needs to be partially refreshed based on the previous frame. Pixels from the previous frame not covered by the current frame will continue to be displayed, thus saving memory and improving decoding speed.
[0043] Method 3: Before drawing the current frame image, restore the drawing area of the previous frame image to the background color. The background color of the previous frame image can be displayed through the transparent area of the current frame, which can optimize GIF animations with multiple frames having the same background.
[0044] As mentioned earlier, in related technologies, when drawing GIF frame images, it is necessary to refer to the GCE field in the previous frame image in order to reasonably process the current frame image and the previous frame image. However, in order to save memory as much as possible, this embodiment of the disclosure does not draw every frame image in the GIF animation, but only processes a portion of the frame images in the GIF animation. Therefore, it is necessary to consider how to reliably process the current frame image if the previous frame image of the current frame image to be processed is skipped (i.e., the previous frame data is not read). In this embodiment of the disclosure, a fixed method is used to process the current frame, that is, the above method is used to process the current frame one by one. Specifically, the opaque target frame image is completely drawn based directly on the decoding result of the current frame data (target frame data). In this way, it is possible to conveniently and effectively ensure that the rendering results of some frames in target dynamic image resources such as GIFs do not depend on the previous frame. Even if the data of the previous frame is not read or the GCE field of the previous frame is not obtained, the target frame data in target dynamic image resources such as GIFs can still be reliably and properly processed, and the corresponding target frame images can be drawn and displayed. This better ensures the reliability of frame skipping processing for target dynamic image resources such as GIFs.
[0045] Furthermore, when displaying target frame images, the latest rendered target frame image can be displayed sequentially based on the rendering order, with the latest rendered target frame image completely covering the previously rendered target frame image. Assuming the target dynamic image resource includes 10 frames, then the images are read and processed frame by frame, requiring the first and last frames to be read. That is, frames 1, 3, 5, 7, 9, and 10 are read, decoded, rendered, and displayed sequentially. After displaying frame 1, the data for frame 3 is read and decoded, and the opaque frame 3 image is fully drawn and displayed. The frame 3 image completely covers the previously rendered frame 1 data. This process continues, and after displaying frame 10, frame 1 is rendered and displayed, with frame 1 completely covering frame 10, thus achieving a dynamic effect of looping through the target frame images in the target dynamic image resource.
[0046] Considering that displaying only a portion of the target animated image resource would reduce the overall playback time—meaning the number of frames displayed is less than the original number—the playback time would also be shorter. To better ensure a better user experience, in some implementation examples, the steps for displaying the target frame image can be performed as follows: Steps A to B.
[0047] Step A: Determine the target display duration of the target frame image to be displayed. The target display duration may be the same or different for different target frame images. For example, the target display duration of a target frame image may depend on the number of frames that were previously skipped and unprocessed. In other words, extending the display duration of the target frame image can alleviate the problem of reduced playback time caused by frame skipping in the target dynamic image resource. In some specific implementation examples, Step A can be performed as follows: Steps A1 to A2
[0048] Step A1: Obtain the number of frames between the current target frame image to be displayed and the next target frame image to be displayed.
[0049] Step A2: Based on the interval frame number, determine the target display duration of the target frame image to be displayed. The interval frame number is positively correlated with the target display duration. For example, step A2 can be performed with reference to steps A2.1 to A2.3 below:
[0050] Step A2.1: Based on the image data to be processed, determine the display duration of a single frame of the target dynamic image resource. Typically, the display duration of a single frame is indicated in the image data to be processed, which can be obtained through data parsing.
[0051] Step A2.2: Based on the product of the single-frame image display duration and the number of interval frames, the delayed display duration is obtained. This delayed display duration is also the duration that the interval frames should have been displayed. Since the interval frames have been skipped, in order to ensure that the overall playback duration of the target dynamic image resource is not affected, this duration should be compensated by the target frame image. Therefore, this duration can be used as the delayed display duration of the target frame image.
[0052] Step A2.3: Based on the sum of the delayed display duration and the single-frame image display duration, obtain the target display duration of the target frame image to be displayed.
[0053] Step B: Display the target frame image based on the target display duration.
[0054] By using the above methods, the display duration of the target frame image to be displayed can be reasonably determined, thereby ensuring that the playback duration of the final target dynamic image resource is not affected.
[0055] To facilitate understanding of the image processing method provided in the embodiments of this disclosure, please refer to... Figure 2 The illustration shows a target dynamic image resource consisting of 24 frames. Starting from the first frame, images with a gray background are processed one by one at intervals of two frames. These gray background images are the aforementioned target frame images. Figure 2The process reads, decodes, renders, and displays frames 1, 4, 7, 10... up to 24. Assuming the frame data of the target dynamic image resource indicates a single frame display duration of 1 second, and the above interval frame number is 2, it means the delayed display duration is 2 seconds. At this time, the target display duration corresponding to the first frame image is 3 seconds. Similarly, the target display duration of the fourth, seventh, tenth, thirteenth, sixteenth, and eleventh frames is 3 seconds. Since the interval frame number between the 22nd and 24th frames is 1, the target display duration of the 22nd frame is 2 seconds. After the 24th frame is displayed, the first frame is displayed, which is considered to be the interval frame number between the last frame and the first frame as 0. Therefore, the target display duration of the 24th frame is 1 second. Using the above method, for a target dynamic image resource with 24 frames, only 9 frames of data need to be read, decoded, rendered, and displayed. This can greatly save memory usage. Moreover, since it is displayed at intervals and the first and last frames are retained, the content of the target dynamic image resource can still be presented relatively comprehensively, giving users a better visual experience.
[0056] Further, see also Figure 3 The flowchart shown illustrates an image processing method, using a target animated image resource as an example. The method mainly includes the following steps S302 to S314:
[0057] Step S302: Obtain the image data to be processed; wherein the format of the image data to be processed is Graphics Interchange Format, and the image data to be processed is the data corresponding to the target animation to be displayed on the target page.
[0058] Step S304: Read target frame data from the image data to be processed; wherein, the target frame data corresponds to the target frame image in the target animation, and the number of target frame images is less than the total number of frames in the target animation; the target frame data includes the first frame data and the last frame data in the image data to be processed, as well as the frame data extracted from the image data to be processed according to a preset interval.
[0059] Step S306: Decode based on the target frame data.
[0060] Step S308: Based on the decoding result of the target frame data, draw the complete opaque target frame image.
[0061] Step S310: Obtain the number of frames between the current target frame image to be displayed and the next target frame image to be displayed.
[0062] Step S312: Determine the target display duration of the target frame image to be displayed based on the interval frame number.
[0063] Step S314: Based on the target display duration, display the target frame image. This target frame image completely covers the previously rendered frame image. Each target frame image is processed sequentially in the above manner to achieve the GIF animation frame skipping display effect.
[0064] The specific execution method of the above steps can be referred to the aforementioned related content, and will not be repeated here. For multimedia editing pages or information display pages that need to play and display multiple GIF animations simultaneously, the image processing method provided by the embodiments of this disclosure can significantly save the amount of memory required to display multiple GIF animations simultaneously.
[0065] To demonstrate the above effect, the applicant conducted tests on a multimedia editing page used to display multiple GIFs. If the GIFs are displayed in the conventional way, that is, displaying each frame of the GIF, the initial screen of the page requires 73.73MB of memory, while scrolling down to the bottom to display all the GIFs requires 102.66MB of memory. However, if the method provided in this disclosure is adopted, that is, processing only a portion of the frames in the GIF animation, the memory usage is as follows: For processing at 1-frame intervals (sampling 1 frame and skipping 1 frame), 39.05MB of memory is required to access the first screen of the page (a 47% reduction compared to the conventional method), and 60.95MB of memory is required to scroll down the page to display all GIF animations (a 40.62% reduction compared to the conventional method); for processing at 2-frame intervals (sampling 1 frame and skipping 2 frames), 27.64MB of memory is required to access the first screen of the page (a 62.5% reduction compared to the conventional method), and 46.23MB of memory is required to scroll down the page to display all GIF animations (a 54.9% reduction compared to the conventional method). These figures clearly demonstrate that the method provided in this disclosure can significantly reduce the memory usage required to display GIF animations, especially in scenarios where multiple GIF animations need to be displayed simultaneously, resulting in a significant reduction in memory consumption and a substantial improvement in loading speed. Furthermore, the inventors have verified that the Image IO interface of existing devices supports the above-mentioned method for displaying GIF animations with frame skipping. Also, if a GIF animation contains multiple dynamic scenes with significantly different content—that is, if the GIF animation may have scene transitions, such as the first to 34 frames corresponding to a rabbit running scene, and the 35th to the last frame corresponding to a bear singing scene—and there is a scene transition between frames 34 and 35, even if the 34th and / or 35th frames are skipped without processing, because the GIF animation is processed with frame skipping at preset intervals, it can still ensure that each scene can be displayed to the user, thus guaranteeing the overall display effect of the GIF animation.
[0066] In summary, the above methods are simple and reliable, and can be widely used in scenarios that require displaying GIF animations.
[0067] Corresponding to the aforementioned image processing method, this disclosure further provides an image processing apparatus. Figure 4 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of the present disclosure. The apparatus can be implemented by software and / or hardware, and is generally integrated into an electronic device, such as... Figure 4 As shown, the image processing apparatus includes:
[0068] The first data acquisition module 402 is used to acquire image data to be processed; wherein the format of the image data to be processed is a graphics exchange format, and the image data to be processed is the data corresponding to the target dynamic image resource to be displayed on the target page;
[0069] The second data acquisition module 404 is used to acquire target frame data from the image data to be processed; wherein the target frame data corresponds to the target frame image in the target dynamic image resource, and the number of target frame images is less than the total number of frames in the target dynamic image resource.
[0070] The image rendering module 406 is used to decode the target frame data and render the image based on the decoding result of the target frame data to obtain the target frame image.
[0071] Image display module 408 is used to display the target frame image.
[0072] Since the number of target frame images corresponding to the target frame data read is less than the total number of frames of the target dynamic image resource, it is only necessary to decode, render and display a portion of the frame data of the target dynamic image resource. Therefore, the memory required to display the target dynamic image resource can be effectively reduced.
[0073] In some implementations, the target frame data includes the first frame data and the last frame data in the image data to be processed, as well as frame data extracted from the image data to be processed at preset intervals.
[0074] In some implementations, the image rendering module 406 is specifically used to: draw an opaque target frame image completely based on the decoding result of the target frame data.
[0075] In some implementations, the image display module 408 is specifically used to: display the latest rendered target frame image in sequence based on the rendering order of the target frame images, and the latest rendered target frame image completely covers the previously rendered target frame image.
[0076] In some implementations, the image display module 408 is specifically used to: determine the target display duration of the target frame image to be displayed; determine whether the target display durations corresponding to different target frame images are the same or different; and display the target frame image based on the target display duration.
[0077] In some implementations, the image display module 408 is specifically used to: obtain the number of frames between the current target frame image to be displayed and the next target frame image to be displayed; and determine the target display duration of the current target frame image based on the number of frames between the frames.
[0078] In some implementations, the image display module 408 is specifically used to: determine the single-frame image display duration of the target dynamic image resource based on the image data to be processed; obtain the delayed display duration based on the product of the single-frame image display duration and the number of interval frames; and obtain the target display duration of the target frame image to be displayed based on the sum of the delayed display duration and the single-frame image display duration.
[0079] In some implementations, the target page displays resource information for multiple dynamic image resources, and at least one of the multiple dynamic image resources is the target dynamic image resource to be displayed.
[0080] In some implementations, the target page is a page presented by a multimedia editor, and the dynamic image resource is material used to import into the editing draft corresponding to the target page; wherein, the editing draft includes target material for generating video and editing information of the target material.
[0081] The image processing apparatus provided in this disclosure can execute the image processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method.
[0082] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device embodiments can be referred to the corresponding process in the method embodiments, and will not be repeated here.
[0083] This disclosure provides an electronic device, which includes: a storage device storing a computer program thereon; and a processing device for executing the computer program in the storage device to implement the steps of any method of this disclosure.
[0084] The following is for reference. Figure 5The diagram illustrates a structural schematic of an electronic device 500 suitable for implementing embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0085] like Figure 5 As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0086] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0087] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0088] In addition to the methods and devices described above, embodiments of this disclosure can also be computer program products, comprising computer program instructions that, when executed by a processor, cause the processor to perform the methods provided in the embodiments of this disclosure. The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user computing device, partially on a user device, as a standalone software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0089] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the image processing method provided in embodiments of this disclosure.
[0090] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0091] This disclosure also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the image processing method of this disclosure.
[0092] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0093] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0094] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0095] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0096] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0097] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An image processing method, characterized in that, include: Acquire image data to be processed; wherein, the image data to be processed is the data corresponding to the target dynamic image resource to be displayed on the target page; Target frame data is obtained from the image data to be processed; wherein the target frame data corresponds to the target frame image in the target dynamic image resource, and the number of target frame images is less than the total number of frames in the target dynamic image resource; The target frame image is obtained by decoding the target frame data and rendering the image based on the decoding result. The target frame image is displayed.
2. The method according to claim 1, characterized in that, The target frame data includes the first frame data and the last frame data in the image data to be processed, as well as the frame data extracted from the image data to be processed at preset intervals.
3. The method according to claim 1, characterized in that, The process of rendering the image based on the decoding result of the target frame data to obtain the target frame image includes: Based on the decoding results of the target frame data, a complete opaque target frame image is drawn.
4. The method according to claim 3, characterized in that, The process of displaying the target frame image includes: Based on the rendering order of the target frame images, the latest rendered target frame images are displayed sequentially, and the latest rendered target frame images completely cover the previously rendered target frame images.
5. The method according to claim 1, characterized in that, The process of displaying the target frame image includes: Determine the target display duration for the target frame image to be displayed; the target display durations for different target frame images may be the same or different. Based on the target display duration, the target frame image is displayed.
6. The method according to claim 5, characterized in that, Determining the target display duration of the target frame image to be displayed includes: Get the number of frames between the current target frame image to be displayed and the next target frame image to be displayed; Based on the interval frame number, the target display duration of the target frame image to be displayed is determined.
7. The method according to claim 6, characterized in that, Determining the target display duration of the target frame image to be displayed based on the interval frame number includes: Based on the image data to be processed, determine the display duration of a single frame of the target dynamic image resource; The delayed display duration is obtained by multiplying the single-frame image display duration by the number of interval frames. The target display duration of the target frame image to be displayed is obtained by summing the delayed display duration and the single-frame image display duration.
8. The method according to any one of claims 1 to 7, characterized in that, The target page displays resource information for multiple dynamic image resources, and at least one of the multiple dynamic image resources is the target dynamic image resource to be displayed.
9. The method according to claim 8, characterized in that, The target page is a page presented by a multimedia editor, and the dynamic image resources are materials used to import into the editing draft corresponding to the target page; wherein, the editing draft includes target materials for generating a video and editing information of the target materials.
10. An image processing apparatus, characterized in that, include: The first data acquisition module is used to acquire image data to be processed; wherein, the image data to be processed is the data corresponding to the target dynamic image resource to be displayed on the target page; The second data acquisition module is used to acquire target frame data from the image data to be processed; wherein the target frame data corresponds to the target frame image in the target dynamic image resource, and the number of the target frame images is less than the total number of frames in the target dynamic image resource; An image rendering module is used to decode the target frame data and render the image based on the decoding result of the target frame data to obtain the target frame image. The image display module is used to display the target frame image.
11. An electronic device, characterized in that, The electronic device includes: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the image processing method according to any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the image processing method according to any one of claims 1-9.
13. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the image processing method according to any one of claims 1-9.