A screenshot method of GIF moving picture and related device
By receiving screenshot instructions to generate an initial canvas, judging and integrating frame images of dynamic elements, the problem of not being able to capture GIF animations in existing technologies is solved, and the saving of animations is realized.
Patent Information
- Application Number
- CN202210544351.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-05-19
AI Technical Summary
Existing technology cannot capture and save GIF animations; it cannot capture and save GIF images displayed on a monitor in dynamic image format.
By receiving a screenshot command, an initial canvas is generated. It is then determined whether the screenshot area contains dynamic elements. If so, the image information of the dynamic elements is extracted, and their frame images are written into the canvas. The images are then integrated according to the display order and preset duration to generate a dynamic target screenshot.
It enables the capture and saving of GIF animations, generating dynamic screenshots with the same effect as the original animation.
Smart Images

Figure CN114942854B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a GIF moving picture screenshot method and related equipment. BACKGROUND
[0002] With the development of Internet technology, people can communicate conveniently and quickly through the Internet. One of the tools commonly used in communication is a screenshot tool. In many communication software, there is a shortcut key for setting screenshots, and the windows, android and other operating systems have shortcut keys for setting screenshots.
[0003] A screenshot is a display of the current content in the form of a picture, and general pictures are static, so when a user takes a screenshot, only a static image can be obtained. However, the pictures displayed by a display include not only static formats such as jpg format and png format, but also dynamic formats such as gif format. Therefore, when the image displayed by the display is a gif moving picture, the screenshot can only capture the static image at the moment when the screenshot function is started, and cannot capture the gif image. SUMMARY
[0004] The technical problem to be solved by the present application is that gif images cannot be screenshot and saved. In view of the deficiencies of the prior art, the present application provides a GIF moving picture screenshot method and related equipment.
[0005] To solve the above technical problems, the technical solution adopted by the present application is as follows:
[0006] A GIF moving picture screenshot method, the method comprising:
[0007] receiving a screenshot instruction for a display interface, wherein the screenshot instruction comprises a screenshot coordinate;
[0008] generating an initial canvas corresponding to the screenshot instruction according to the screenshot coordinate;
[0009] when a screenshot area corresponding to the screenshot coordinate contains a dynamic element, extracting image information of the dynamic element, wherein the image information comprises a frame image set;
[0010] for each target frame image in the frame image set, writing the target frame image into the initial canvas to obtain a target image corresponding to the target frame image;
[0011] integrating the target images according to a display order corresponding to the target frame image and a preset target time length to obtain a target screenshot corresponding to the screenshot instruction.
[0012] Optionally, the generating an initial canvas corresponding to the screenshot instruction according to the screenshot coordinate comprises:
[0013] generating a blank canvas according to the screenshot coordinates;
[0014] writing static elements in a screenshot region corresponding to the screenshot coordinates into the blank canvas to obtain an initial canvas.
[0015] Optionally, the extracting the image information of the dynamic elements comprises:
[0016] taking each image in the dynamic image as an initial frame image;
[0017] when the screenshot region and a display region of the dynamic element have an intersection, cutting each of the initial frame images according to the intersection and the display region to obtain a frame image set containing multiple target frame images.
[0018] Optionally, the integrating the target images according to the display order corresponding to the target frame images and a preset target time length to obtain a target screenshot corresponding to the screenshot instruction comprises:
[0019] determining a single-frame time length corresponding to each of the target frame images according to a preset target time length and a quantity of the target frame images;
[0020] integrating the target images according to the single-frame time length and the display order corresponding to the target frame images to obtain a target screenshot corresponding to the screenshot instruction.
[0021] Optionally, before the integrating the target images according to the display order corresponding to the target frame images and a preset target time length to obtain a target screenshot corresponding to the screenshot instruction, the method further comprises:
[0022] when the quantity of the dynamic elements is greater than 1, calculating an average value of the time lengths of all the dynamic elements to obtain a target time length.
[0023] Optionally, before the integrating the target images according to the display order corresponding to the target frame images and a preset target time length to obtain a target screenshot corresponding to the screenshot instruction, the method further comprises:
[0024] when the quantity of the dynamic elements is greater than 1, taking a maximum value or a minimum value in all the time lengths as a target time length.
[0025] Optionally, before the integrating the target images according to the display order corresponding to the target frame images and a preset target time length to obtain a target screenshot corresponding to the screenshot instruction, the method further comprises:
[0026] taking the time lengths of the dynamic elements as parameters, calculating a multiple value that minimizes a difference between the parameters.
[0027] Based on the multiplier and the duration, the target duration corresponding to the dynamic element is determined.
[0028] Optionally, the method further includes:
[0029] When the screenshot area does not contain dynamic elements, the initial canvas is used as the target screenshot.
[0030] A computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps in the GIF animation screenshot method described above.
[0031] A terminal device includes: a processor, a memory, and a communication bus; the memory stores a computer-readable program that can be executed by the processor;
[0032] The communication bus enables communication between the processor and the memory;
[0033] When the processor executes the computer-readable program, it implements the steps in the GIF animation screenshot method described above.
[0034] Beneficial Effects: This invention provides a method and related device for capturing GIF animations. First, a capture command is received, which includes capture coordinates. An initial canvas is generated based on the capture coordinates. Simultaneously, it is determined whether an animation exists within the range of the capture coordinates. If an animation exists, each frame of the animation is written into the initial canvas to obtain the target frame image corresponding to that frame. Finally, the target frame images are integrated to generate the GIF animation. Figure One In this way, an animated GIF corresponding to the target frame image is generated, which is the target screenshot corresponding to the screenshot command. This method allows for the capture and saving of GIF format animated images. Attached Figure Description
[0035] Figure 1 The flowchart illustrates the GIF animation screenshot method provided by this invention.
[0036] Figure 2 The overall flowchart of the GIF animation screenshot method provided by the present invention.
[0037] Figure 3 The structural schematic diagram of the terminal device provided by the present invention. Detailed Implementation
[0038] The application provides a GIF animation screenshot method. In order to make the purpose, technical scheme and effect of the application more clear and explicit, the application is further described in detail below with reference to the drawings and examples. It should be understood that the specific examples described herein are only used to explain the application and not to limit the application.
[0039] Those skilled in the art can understand that the singular forms "a", "an" and "the" used herein include plural forms unless specifically stated otherwise. It should be further understood that the use of the term "include" in the specification of the application means that the stated features, integers, steps, operations, elements, and / or components are present, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be intermediate elements. In addition, "connected" or "coupled" used herein can include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any single unit and all combinations of the associated listed items.
[0040] Those skilled in the art can understand that unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as that generally understood by those skilled in the art to which the application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have meanings consistent with those in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as such.
[0041] As Figure 1 shown, the present embodiment provides a GIF animation screenshot method. For convenience of description, a common server is described as the execution subject, and the server herein can be replaced by a tablet, a computer or other device with data processing function. A browser program is installed on these devices, and the GIF animation screenshot method is applied to the related devices with the browser installed. When the method is executed, the following steps are implemented:
[0042] S10, receiving a screenshot instruction for a display interface.
[0043] Specifically, first, the user inputs a screenshot instruction to the server, and the screenshot instruction includes a screenshot coordinate. The screenshot coordinate refers to the coordinate of the display interface, which is used to determine the range of the picture to be captured by the user.
[0044] For example, taking the top left vertex of the display interface as the origin, taking the horizontal right as the horizontal axis, and taking the vertical downward as the vertical axis, the screenshot coordinates are (0, 0), (80, 0), (0, 80), (80, 80).
[0045] S20. Generate an initial canvas corresponding to the screenshot command based on the screenshot coordinates.
[0046] Specifically, the screenshot coordinates represent the size of the image that the user wants to capture. Therefore, after obtaining the screenshot coordinates, an initial canvas corresponding to the screenshot command can be generated first, so that the required content can be written into the canvas later.
[0047] In one method of generating the initial canvas, a blank canvas is generated based on the screenshot coordinates, such as the screenshot coordinates in the previous example, resulting in an 80 x 80 pixel canvas. This blank canvas is then used as the initial canvas. However, this method cannot capture and save text or static image portions within the screenshot area corresponding to the screenshot coordinates. Therefore, in another method of generating the initial canvas in this embodiment, after generating the blank canvas based on the screenshot coordinates, the static elements within the screenshot area corresponding to the screenshot coordinates are written into the blank canvas to obtain the initial canvas.
[0048] Taking the Document Object Model (DOM) as an example, the DOM is a programming interface for HTML and XML documents. It provides a structured representation of a document and defines a way to access this structure from within a program, thereby changing the document's structure, style, and content.
[0049] like Figure 2 As shown, multiple elements in the DOM constitute the displayed content of the interface. In the DOM, each node is an object, and each DOM node has three important properties: the node's name, its value, and its type. The coordinates of each node's position are fixed. Therefore, after obtaining the screenshot coordinates, we can determine whether the DOM node corresponding to the displayed interface is contained within the screenshot area. If it is, the node's content is visualized and written to a blank canvas, thus obtaining the initial canvas corresponding to the screenshot area. Furthermore, mature tools such as html2canvas, dom-to-image, and other screenshot tools can be used to visualize DOM nodes and write them to a blank canvas.
[0050] S30. When the screenshot area corresponding to the screenshot coordinates contains dynamic elements, extract the image information of the dynamic elements.
[0051] Specifically, dynamic elements refer to animated images in GIF format. When a user takes a screenshot, if the screenshot area does not contain dynamic elements, the initial canvas generated by visualizing the node content can be used as the target screenshot.
[0052] If the user area contains dynamic elements, then the image information in the dynamic elements needs to be extracted.
[0053] Still taking DOM as an example, the gif in the dom can be parsed by libgif.js, and the image information of each frame of the gif image can be obtained by the get_frames method on the instance. The following is an exemplary code:
[0054] const frames = [
[0055] {
[0056] data: ImageData,
[0057] delay:10,
[0058] },
[0059] {
[0060] data: ImageData,
[0061] delay:8,
[0062] } ]
[0064] Among them, data indicates a frame image in the dynamic element, and the corresponding delay is the time length corresponding to the frame image. If the subsequent canvas is used for canvas generation and image rendering, the format of the frame image is preferably Uint8ClampedArray format, and the Uint8ClampedArray (8-bit unsigned integer fixed array) typed array represents an array of 8-bit unsigned integers fixed in the range of 0-255. If a value outside the [0, 255] range is specified, it will be replaced by 0 or 255; if a non-integer value is specified, it will be set to the nearest integer. The array content is initialized to 0, and the array can be referenced by the element in the object after the array is created, or the standard array index syntax can be used, so the putImageData method in canvas can be used to render in canvas.
[0065] Since the images in the dynamic element are composed of multiple images, the obtained image information includes a frame image set composed of multiple frame images.
[0066] Subsequently, the frame image needs to be written into the initial canvas to obtain the target image corresponding to each frame image.
[0067] Generally, when the user-selected screenshot area covers the boundary of the dynamic element, it indicates that the user wants to capture the entire dynamic element and the surrounding elements, so the initial frame image in the dynamic element itself can be directly used as the target frame image.
[0068] But there are also user-selected screenshot area does not cover the boundary of the dynamic element, at this time, the initial frame image in the dynamic element cannot be directly written into the blank canvas, at this time, each image in the dynamic image is regarded as an initial frame image, and then it is judged whether there is an intersection between the screenshot area and the display area of the dynamic element. If there is an intersection, it means that the user selects the screenshot to be cropped. Therefore, according to the intersection and the display area, each of the initial frame images is cropped to obtain a frame image set containing multiple target frame images. For example, under the premise of the screenshot coordinates in the above example, the coordinates of the display area of the dynamic element are (0, 0), (120, 0), (0, 10), (120, 10), and therefore there is an intersection (80, 10). According to the intersection and the display area, the region coordinates corresponding to the target frame image can be determined as (0, 0), (80, 0), (0, 10) and (80, 10). According to the region coordinates, the region range of the target frame image can be determined, and the initial frame image is cropped to obtain the target frame image.
[0069] S40, for each target frame image in the frame image set, the target frame image is written into the initial canvas to obtain a target image corresponding to the target frame image.
[0070] Specifically, each target frame image has a corresponding target image, and the target image is similar to the screenshot of the target frame image. In the canvas, an image corresponding to the screenshot area can be drawn first, and then the target frame image is replaced in the position corresponding to the GIF format dynamic element in the image, so as to obtain the target image corresponding to the target frame image.
[0071] S50, according to the display order corresponding to the target frame image and the preset target time length, the target images are integrated to obtain a target screenshot corresponding to the screenshot instruction.
[0072] Specifically, the target frame images are arranged in a certain order in the dynamic element, and when playing, each target frame image is played in turn according to the time length of each target frame image, so as to be dynamically displayed. A target time length can be set in advance, which refers to the time length of the basic playing of all target frame images in the subsequent target screenshot. The preset target time length can be the time length selected by initialization, or can be determined according to the time length of the dynamic element itself, for example, there are 6 initial frame images in the dynamic element, and each initial frame image is 50 ms, and the set target time length is 300 ms.
[0073] The single frame duration of each frame in the preferred embodiment is 50 ms, but the GIF images used are from different sources and cannot guarantee consistency. The more the number of frames, the larger the final generated target screenshot, and the longer the screenshot generation time. To limit the maximum number of frames to 100, the canvas size of each target frame image is reduced, the length is compressed, and part of the target frame image is deleted according to the preset deletion rule to reduce the image size. The deletion rule can include deleting target frame images at intervals of one frame, two frames, or other quantities, deleting target frame images according to the similarity between two consecutive target frame images, etc. For example, a similarity threshold is set, and if the similarity between the next target frame image and the previous target frame image exceeds the threshold, the target frame image is deleted; if the similarity is lower than the threshold, the target frame image is retained.
[0074] After obtaining all the target frame images, the target frame images can be sorted according to their display order, and the single frame duration corresponding to each target frame image can be determined according to the target duration. Therefore, according to the sorted target frame images and the single frame duration, the target screenshot corresponding to the screenshot instruction can be integrated and generated.
[0075] Further, in the process of extracting image information described in the foregoing, the single frame duration (delay) corresponding to each initial frame image can also be extracted. Generally, in a dynamic element, the single frame durations corresponding to all initial frame images are the same. If there are cases where the single frame durations corresponding to the initial frame images are different in length, the single frame duration corresponding to each target frame image can be determined according to the ratio of the target duration and the single frame duration corresponding to the initial frame image. For example, the target duration is 500 ms, the number of initial frame images is 2, and the single frame durations are 200 ms and 300 ms, respectively. Therefore, the time duration ratio between the target frame images is determined to be 2:3, and the single frame durations of the target frame images are determined to be 200 ms and 300 ms, respectively, according to the target duration.
[0076] In the case where the screenshot area contains only one dynamic element, the target duration, single frame duration, etc. can be directly determined. However, when the screenshot area contains multiple dynamic elements and the durations of different dynamic elements are different, the target frame images corresponding to each dynamic element need to be adjusted in duration.
[0077] In the first determination method of the target duration provided in the embodiment, the average value of the durations of all dynamic elements is calculated, and the average value is taken as the target duration. For example, there are three dynamic elements A, B, and C, and their durations are 1000 ms, 600 ms, and 800 ms, respectively. The average value of the three is (1000+600+800) / 3=800 ms, so 800 ms is taken as the target duration.
[0078] In the second way of determining the target time length, the maximum or minimum value of all time lengths is directly selected as the target time length. For example, in the previous example, 600 ms can be selected as the target time length, or 1000 ms can be selected as the target time length.
[0079] In the third way of determining the target time length, the multiple value of the time length of the dynamic element is calculated as a parameter, and the multiple value of the time length of the dynamic element is calculated as a parameter. If the number of dynamic elements is 2, the formula can be expressed as , wherein is the time length of the first dynamic element, is the time length of the second dynamic element, a is the multiple value of the first dynamic element, and b is the multiple value of the second dynamic element. For example, in the above three dynamic elements, , If the multiple value is an integer, a is 1, b is 2, and c is 1. The product of the time length of any one dynamic element and its corresponding multiple value is selected as the target time length. For example, in the case of dynamic element A, the product of the time length of dynamic element A and the multiple value, i.e. 1000 ms, is selected as the target time length. At the same time, for the dynamic element with a multiple value greater than 2, the product of the time length of the initial frame image and the multiple value is calculated to obtain a first time length, and the product of the number of initial frame images of the dynamic element and the multiple value is calculated to obtain a cycle image number. Then, the time length difference between the target time length and the first time length is calculated, and the ratio between the time length difference and the cycle image number is calculated to obtain an adjustment time length. Finally, according to the adjustment time length, the single frame time length corresponding to each target frame image is determined. For example, in the case of dynamic element B in the previous example, the first time length is 600 x 2 = 1200 ms, the time length difference is 1200 - 1000 = 200 ms, the initial frame image is 2, and the cycle image number is 2 x 2 = 4. Therefore, the adjustment time length is 50 ms, and the final single frame time length is 600 / 2 - 50 = 250 ms. Conversely, if the adjustment time length is negative, the final single frame time length is increased by 50 ms from the original single frame time length.
[0080] Further, if the single frame time length in the same dynamic image is not consistent, the adjustment time length can be determined according to the proportion of the single frame time length. The time length ratio of the target time length and the first time length is calculated, and then the single frame time length corresponding to each target frame image is adjusted according to the time length ratio. For example, in the above example, the single frame time lengths are 200 ms and 400 ms, respectively, and the ratio of the target time length to the first time length is 5:6. Therefore, the adjusted single frame time lengths are (200 x 5) / 6 = 166.7 ms and (400 x 5) / 6 = 333.3 ms, respectively.
[0081] The following provides partial pseudo code for calculating the first, second and third ways of determining the target time length:
[0082] / **
[0083] * Calculate GIF data
[0084] * @param { gifsData} The collection of data after parsing all GIF images
[0085] * @return { totalTime, frameLen, delay} Total duration, total number of frames, and delay time per frame.
[0086] /
[0087] / / Default duration of each frame
[0088] const DEFAULT_GIF_DELAY = 50;
[0089] / / Maximum frame rate
[0090] const MAX_GIF_FRAME = 100;
[0091] function computeGifData(gifsData: GifData[]) {
[0092] const times = gifsData.map((gif) => gif.totalTime);
[0093] const minTime = Math.min(...times);
[0094] const maxTime = Math.max(...times);
[0095] const div = maxTime / minTime;
[0096] let totalTime = 0;
[0097] if (div > 2) {
[0098] / / Calculate the maximum duration
[0099] totalTime = computeTotalTime(minTime, maxTime);
[0100] } else {
[0101] / / Take average duration
[0102] totalTime = times.reduce((pre, cur) => pre + cur, 0) / times.length;
[0103] }
[0104] let delay = DEFAULT_GIF_DELAY;
[0105] let frameLen = totalTime / delay; / / Number of frames
[0106] if (frameLen > MAX_GIF_FRAME) {
[0107] delay = delay * (frameLen / MAX_GIF_FRAME);
[0108] frameLen = MAX_GIF_FRAME;
[0109] }
[0110] return { totalTime, frameLen, delay};
[0111] }
[0112] Where totalTime is the target duration, frameLen is the duration of a certain dynamic element in the target screenshot, and delay is the duration of a single frame.
[0113] Based on the above-described GIF animation screenshot method, this invention also provides a terminal device, such as... Figure 3 As shown, it includes at least one processor 20; a display screen 21; and a memory 22, and may also include a communications interface 23 and a bus 24. The processor 20, display screen 21, memory 22, and communications interface 23 can communicate with each other via the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setup mode. The communications interface 23 can transmit information. The processor 20 can invoke logical commands stored in the memory 22 to execute the methods described in the above embodiments.
[0114] Furthermore, the logical commands in the aforementioned memory 22 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0115] The memory 22, as a computer readable storage medium, can be configured to store software programs, computer executable programs, such as program commands or modules corresponding to the method in the embodiments of the present disclosure. The processor 20 executes the functions of the application and data processing by running the software programs, commands or modules stored in the memory 22, that is, implements the method in the above embodiments.
[0116] The memory 22 can include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 22 can include a high-speed random access memory, and can also include a non-volatile memory. For example, a variety of media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. can also be a transitory computer readable storage medium.
[0117] In addition, the specific processes of the above computer readable storage medium and the plurality of command processors in the terminal device load and execute have been described in detail in the above method, and here will not be stated one by one.
[0118] Finally, it should be pointed out that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for capturing screenshots of GIF animations, characterized in that, The method includes: Receive a screenshot command for the display interface, wherein the screenshot command includes screenshot coordinates; Based on the screenshot coordinates, an initial canvas corresponding to the screenshot command is generated; When the screenshot area does not contain dynamic elements, the initial canvas is used as the target screenshot; When the screenshot area corresponding to the screenshot coordinates contains dynamic elements, the image information of the dynamic elements is extracted, wherein the image information includes a set of frame images; For each target frame image in the frame image set, the target frame image is written into the initial canvas to obtain the target image corresponding to the target frame image; Based on the display order of the target frame images and the preset target duration, the target images are integrated to obtain the target screenshot corresponding to the screenshot command; The step of generating the initial canvas corresponding to the screenshot command based on the screenshot coordinates includes: Generate a blank canvas based on the screenshot coordinates; Write the static elements in the screenshot area corresponding to the screenshot coordinates into the blank canvas to obtain the initial canvas; The extraction of image information of the dynamic elements includes: Each image in the dynamic image is used as the initial frame image; When the screenshot area intersects with the display area of the dynamic element, each initial frame image is cropped according to the intersection and the display area to obtain a frame image set containing multiple target frame images; The step of integrating the target images according to the display order and preset target duration to obtain the target screenshot corresponding to the screenshot command includes: Based on the preset target duration and the number of target frame images, the duration of each target frame image is determined. Based on the single frame duration and the display order corresponding to the target frame image, the target images are integrated to obtain the target screenshot corresponding to the screenshot command; During the process of extracting image information, the single frame duration corresponding to each initial frame image is extracted. If there are different single frame durations corresponding to the initial frame images, the single frame duration corresponding to each target frame image is determined according to the ratio of the target duration to the single frame duration corresponding to the initial frame image. If the screenshot area contains only one dynamic element, the single frame duration is determined directly based on the target duration and the single frame duration; if the screenshot area contains multiple dynamic elements, and the durations of different dynamic elements are different, the duration of the target frame image corresponding to each dynamic element is adjusted. In the method for determining the target duration, the duration of dynamic elements is used as a parameter, and the multiplier with the smallest difference between duration parameters is calculated. The product of the duration of any dynamic element and its corresponding multiplier is selected as the target duration. For dynamic elements with a multiplier greater than 2, the product of the duration of the initial frame image and the multiplier is calculated to obtain the first duration. The product of the number of initial frame images of the dynamic element and the multiplier is used to obtain the number of loop images. Then, the duration difference between the target duration and the first duration is calculated, and the ratio between the duration difference and the number of loop images is calculated to obtain the adjustment duration. Finally, based on the adjustment duration, the single frame duration corresponding to each target frame image is determined. If the duration of a single frame in the same dynamic image is inconsistent, the adjustment duration can be determined according to the ratio of the duration of a single frame; calculate the duration ratio of the target duration to the first duration, and then adjust the duration of a single frame corresponding to each target frame image according to the duration ratio.
2. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps in the GIF animation screenshot method as described in claim 1.
3. A terminal device, characterized in that, include: Processor, memory, and communication bus; The memory stores a computer-readable program that can be executed by the processor; The communication bus enables communication between the processor and the memory; When the processor executes the computer-readable program, it implements the steps in the GIF animation screenshot method as described in claim 1.
Citation Information
Patent Citations
Screenshot method and device, and electronic equipment
CN112202958A
Method and device for intercepting image in video playing and computing equipment
CN114173203A