Method, device and equipment for dynamic display of static pictures
By obtaining static pictures and dynamic display parameters, determining the dynamic picture set and playing it in a loop, the problem of slow loading speed of dynamic picture display in web pages is solved and the user experience is improved.
Patent Information
- Application Number
- CN201910202923.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-18
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2039-03-18
AI Technical Summary
The loading speed of dynamic image display in existing web pages is slow, resulting in poor user experience.
By obtaining the static pictures and dynamic display parameters, the dynamic atlas is determined, including the static pictures and transition pictures to be displayed, and is played in a loop according to the preset cycle to achieve the dynamic display effect.
It improves webpage loading speed and user experience. Compared with using GIF format data, it reduces the loading volume and achieves the same dynamic display effect.
Smart Images

Figure CN111724460B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of picture display technology, and in particular to a method, device and equipment for dynamically displaying static pictures. Background Art
[0002] With the continuous development of multimedia technology and the increasing popularity of the Internet, multimedia information exchange has reached an unprecedented depth and breadth, and the forms of multimedia data release have become more diverse. Dynamic image display, as a typical multimedia data display method, has better display effects than static image display, can improve the user's sense of immersion, and has attracted much attention.
[0003] Graphics Interchange Format (GIF) is usually used in web pages to display dynamic images. GIF format is one of the most widely used dynamic image display methods. However, due to the large size of GIF image data, it leads to slow loading speed and reduces user experience. Summary of the invention
[0004] The embodiments of the present invention provide a method, device and equipment for dynamically displaying static images, so as to solve the problems of slow loading speed and poor user experience in displaying dynamic images in existing web pages.
[0005] In a first aspect, an embodiment of the present invention provides a method for dynamically displaying a static image, comprising:
[0006] Get the static image to be displayed;
[0007] Get dynamic display parameters, where the dynamic display parameters are used to represent the dynamic transformation of the static image to be displayed;
[0008] Determine a dynamic atlas according to the static image to be displayed and the dynamic display parameters, wherein the dynamic atlas includes the static image to be displayed and at least one transition state image, and the at least one transition state image is determined according to the static image to be displayed and the dynamic display parameters;
[0009] Play the pictures in the dynamic picture collection in a loop at a preset period.
[0010] In one possible implementation, obtaining a static image to be displayed includes:
[0011] According to the link of the static image to be displayed, the static image to be displayed is obtained.
[0012] In one possible implementation, the dynamic display parameters include a motion trajectory, a motion direction, and a transition state number, where the transition state number is used to indicate the number of transition state images in the dynamic picture set.
[0013] In a possible implementation, determining the dynamic picture set according to the static picture to be displayed and the dynamic display parameter includes:
[0014] According to the direction of motion, the static image to be displayed is segmented;
[0015] According to the motion trajectory, determine the total offset;
[0016] Determine the offset of each transition state image according to the number of transition states and the total offset;
[0017] According to the offset of each transition state image, the segmented static image to be displayed is subjected to offset processing;
[0018] A dynamic atlas is determined based on the static image to be displayed and the image after the offset processing.
[0019] In one possible implementation, the movement direction includes lateral movement and longitudinal movement;
[0020] According to the direction of motion, the static image to be displayed is segmented, including:
[0021] If the motion direction is horizontal motion, the static image to be displayed is divided into rows;
[0022] or,
[0023] If the motion direction is vertical motion, the static image to be displayed is divided into columns.
[0024] In one possible implementation, the motion trajectory is determined according to a Bezier curve.
[0025] In one possible implementation, the method further includes:
[0026] Update dynamic display parameters based on user input;
[0027] According to the updated dynamic display parameters, the static image to be displayed is dynamically displayed.
[0028] In a second aspect, an embodiment of the present invention provides a dynamic display device for static images, including:
[0029] A first acquisition module is used to acquire a static image to be displayed;
[0030] A second acquisition module is used to acquire dynamic display parameters, where the dynamic display parameters are used to represent the dynamic transformation of the static image to be displayed;
[0031] A processing module, used to determine a dynamic atlas according to the static picture to be displayed and the dynamic display parameters, the dynamic atlas including the static picture to be displayed and at least one transition state picture, the at least one transition state picture being determined according to the static picture to be displayed and the dynamic display parameters;
[0032] The playback module is used to loop and play the pictures in the dynamic picture collection at a preset period.
[0033] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0034] Memory;
[0035] Processor; and
[0036] Computer programs;
[0037] The computer program is stored in the memory and is configured to be executed by the processor to implement the method for dynamic display of static pictures as described in any one of the first aspects.
[0038] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method for dynamic display of a static image as described in any one of the first aspects.
[0039] The method, device and equipment for dynamic display of static images provided by the embodiments of the present invention obtain a static image to be displayed, obtain dynamic display parameters, the dynamic display parameters are used to indicate the dynamic transformation of the static image to be displayed, and determine a dynamic atlas according to the static image to be displayed and the dynamic display parameters, the dynamic atlas includes the static image to be displayed and at least one transition state image, the at least one transition state image is determined according to the static image to be displayed and the dynamic display parameters, and then the images in the dynamic atlas are played in a loop at a preset period. The effect of dynamic display is achieved only by using a static image to be displayed and a set of dynamic display parameters. Compared with the existing web pages, in order to achieve the same dynamic display effect, it is necessary to load a larger volume of GIF format data, which improves the loading speed of the web page and further improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0041] Figure 1 A flowchart of an embodiment of a method for dynamically displaying static pictures provided by the present invention;
[0042] FIG. 2A to FIG. 2D A schematic diagram of a dynamic atlas provided by an embodiment of the present invention;
[0043] Figure 3 A flowchart of another embodiment of the method for dynamically displaying static pictures provided by the present invention;
[0044] FIG. 4A to FIG. 4E A schematic diagram of a dynamic atlas provided in yet another embodiment of the present invention;
[0045] Figure 5 A schematic structural diagram of an embodiment of a dynamic display device for static pictures provided by the present invention;
[0046] Figure 6 A schematic structural diagram of an electronic device according to an embodiment of the present invention.
[0047] The above drawings have shown clear embodiments of the present invention, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present invention in any way, but to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0049] The terms "including" and "having" and any variations thereof in the specification and claims of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0050] The "first" and "second" in the present invention only serve as identifications and cannot be understood as indicating or implying a sequential relationship, relative importance, or implicitly indicating the number of technical features indicated. "Multiple" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.
[0051] The "one embodiment" or "an embodiment" mentioned throughout the specification of the present invention means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0052] It should be noted that the method for dynamically displaying static images provided in the embodiment of the present invention can be used across platforms and can support various operating systems, including but not limited to: Windows, Mac, Linux, Android, IOS, etc.
[0053] Figure 1 This is a flow chart of an embodiment of a method for dynamically displaying static images provided by the present invention. As shown in FIG1 , the method provided by this embodiment may include:
[0054] S101: Obtain a static image to be displayed.
[0055] In this embodiment, a static image to be displayed can be obtained according to the dynamic effect to be achieved. For example, if the same dynamic effect as an image file in GIF format is to be achieved, the static image to be displayed obtained in this embodiment can be any one of the multiple images included in the GIF file. This embodiment does not limit the format of the static image, for example, it can be Portable Network Graphics (PNG), Joint Photographic Expert Group (JPEG), Tag Image File Format (TIFF), etc.
[0056] Optionally, in order to further improve the webpage loading speed, during the webpage loading process, one implementation method of obtaining the static image to be displayed may be: obtaining the static image to be displayed according to a link of the static image to be displayed.
[0057] S102: Acquire dynamic display parameters, where the dynamic display parameters are used to indicate dynamic transformation of the static image to be displayed.
[0058] The dynamic display parameters in this embodiment can be used to indicate dynamic changes made to the static image to be displayed, for example, it can be rotated 90° clockwise, shifted 10 pixels to the right, flipped upside down, etc.
[0059] Optionally, the dynamic display parameters in this embodiment can also be determined according to the static image to be displayed. For example, if the static image is a pedestrian, in order to obtain the dynamic effect of pedestrians walking, the dynamic display parameters can be used to transform the static image horizontally; if the static image is snowflakes, in order to obtain the dynamic effect of snowflakes falling, the dynamic display parameters can be used to transform the static image vertically.
[0060] In this embodiment, in addition to the above description, the execution order of S101 and S102 may be adjusted as needed, and the execution order of S101 and S102 is not limited here.
[0061] S103. Determine a dynamic atlas according to the static image to be displayed and the dynamic display parameters, wherein the dynamic atlas includes the static image to be displayed and at least one transition state image, and the at least one transition state image is determined according to the static image to be displayed and the dynamic display parameters.
[0062] In this embodiment, after the static picture to be displayed and the dynamic display parameters are determined, the static picture to be displayed can be dynamically changed according to the dynamic display parameters to determine the transition state picture. The static picture to be displayed and all the transition state pictures can form a dynamic picture set.
[0063] The following is a specific example to illustrate how to obtain a dynamic atlas. FIG. 2A to FIG. 2D A schematic diagram of a dynamic atlas provided by an embodiment of the present invention. Figure 2A is the static image to be displayed. If the dynamic display parameter is to rotate 90°, 180°, or 270° clockwise, Figure 2A Rotate 90° clockwise to get Figure 2B The transition state picture shown; Figure 2A Rotate 180° clockwise to get Figure 2C The transition state picture shown; Figure 2A Rotate 270° clockwise to get Figure 2D The transition state picture shown. Figure 2A The static images to be displayed and Figure 2B-2D The transition state pictures shown can form a dynamic picture set. It should be noted that the pictures in the dynamic picture set need to be arranged in a play order, or a play sequence number needs to be set for each picture in the dynamic picture set.
[0064] Still taking Figure 2 as an example, to obtain the same dynamic display effect, for a GIF format file, it is necessary to include Figure 2A-2D A total of 4 pictures will slow down the loading speed of the web page. However, the method provided in this embodiment only needs to load Figure 2AA picture and obtaining the corresponding dynamic display parameters can significantly improve the loading speed of the web page.
[0065] S104, playing the pictures in the dynamic picture set in a loop at a preset period.
[0066] In this embodiment, after the dynamic atlas is determined, the pictures in the dynamic atlas are played in a loop according to a preset period, so that the effect of dynamic display can be achieved. The preset period in this embodiment can be set according to specific needs, for example, it can be set to 1 second.
[0067] If the pictures in the dynamic picture collection have been arranged, they will be played in a loop according to the order in which they are arranged; if the pictures in the dynamic picture collection have been set with play sequences, they will be played in a loop according to the play sequence numbers of each picture.
[0068] The method for dynamic display of static images provided in this embodiment obtains the static image to be displayed, obtains dynamic display parameters, the dynamic display parameters are used to indicate the dynamic transformation of the static image to be displayed, and determines a dynamic atlas according to the static image to be displayed and the dynamic display parameters, the dynamic atlas includes the static image to be displayed and at least one transition state image, at least one transition state image is determined according to the static image to be displayed and the dynamic display parameters, and then plays the images in the dynamic atlas in a loop at a preset period. The effect of dynamic display is achieved by only using a static image to be displayed and a set of dynamic display parameters. Compared with the existing web pages, in order to achieve the same dynamic display effect, it is necessary to load larger GIF format data, which improves the loading speed of the web page and further improves the user experience.
[0069] In some embodiments, the dynamic display parameters may include a motion track, a motion direction, and a transition state number, where the transition state number is used to represent the number of transition state pictures in the dynamic picture set. It is understandable that the greater the transition state number, the richer the dynamic display effect obtained.
[0070] In some embodiments, one implementation method for determining a dynamic atlas based on static pictures to be displayed and dynamic display parameters may be: segmenting the static pictures to be displayed according to the direction of movement; determining the total offset according to the motion trajectory; determining the offset of each transition state picture according to the number of transition states and the total offset; performing offset processing on the segmented static pictures to be displayed according to the offset of each transition state picture; and determining a dynamic atlas based on the static pictures to be displayed and the pictures after the offset processing.
[0071] The direction of movement in this embodiment indicates the direction of the static image when it is dynamically displayed. For example, the direction of movement includes horizontal movement and vertical movement, wherein the horizontal movement is movement along the horizontal direction, and the vertical movement is movement along the vertical direction. If the direction of movement is horizontal movement, the static image to be displayed can be divided into rows; if the direction of movement is vertical movement, the static image to be displayed can be divided into columns. For example, if the static image to be displayed is represented by a two-dimensional matrix, when the direction of movement is horizontal movement, each row in the matrix can be divided into a group; when the direction of movement is vertical movement, each column in the matrix can be divided into a group.
[0072] The motion trajectory in this embodiment can be determined according to a Bezier curve, for example, a quadratic Bezier curve, a cubic Bezier curve, etc. The total offset can be determined according to the motion trajectory. It should be noted that the total offset at different positions in the image can be different, for example, the total offset of the first row can be 10 pixels, while the total offset of the 10th row can be 20 pixels.
[0073] In this embodiment, after the total offset is determined, the offset of each transition state picture can be determined according to the number of transition state pictures required. For example, the total offset can be evenly divided according to the number of transition states.
[0074] In this embodiment, after determining the offset of each transition state image, the segmented static image to be displayed can be offset. For example, if the first row of the segmented static image to be displayed can be represented as [a 11 a 12 a 13 ……a 1(n-4) a 1(n-3) a 1(n-2) a 1(n-1) a 1n ], the offset is +3, then after the offset processing it can be [0 0 0a 11 a 12 a 13 ……a 1(n-4) a 1(n-3) ] or [a 1(n-2) a 1(n-1) a 1n a 11 a 12 a 13 ……a 1(n-4) a 1(n-3) ].
[0075] Based on the above embodiments, this embodiment combines the above embodiments. Figure 3This is a flow chart of another embodiment of the method for dynamically displaying static pictures provided by the present invention. Figure 3 As shown, the method provided in this embodiment may include:
[0076] S301: Obtain a static image to be displayed.
[0077] S302: Acquire dynamic display parameters, where the dynamic display parameters include a motion trajectory, a motion direction, and a number of transition states.
[0078] S303, determine whether the moving direction is lateral movement. If yes, execute S304; if no, go straight S305.
[0079] S304: Divide the static image to be displayed into rows.
[0080] S305: Divide the static image to be displayed into columns.
[0081] S306: Determine the total offset according to the motion trajectory.
[0082] S307: Determine the offset of each transition state picture according to the number of transition states and the total offset.
[0083] S308 . Performing an offset process on the segmented static pictures to be displayed according to the offset of each transition state picture.
[0084] S309: Determine a dynamic atlas according to the static image to be displayed and the image after the offset processing.
[0085] S310, playing the pictures in the dynamic picture set in a loop at a preset period.
[0086] The implementation process of each step in this embodiment can refer to the above embodiment, and will not be repeated here. In this embodiment, in addition to the above description, the execution order of S301-S310 can also be adjusted as needed, and the execution order of S301-S310 is not limited here.
[0087] The following will be combined Figures 4A-4E , the dynamic display method of static pictures provided by an embodiment of the present invention is described in detail through a specific example. FIG. 4A to FIG. 4E A schematic diagram of a dynamic atlas provided by another embodiment of the present invention. Figure 4A The movement direction in this embodiment is specified as follows: the horizontal direction is the lateral direction, and the horizontal rightward direction is the positive direction; the vertical direction is the longitudinal direction, and the vertical upward direction is the positive direction. Figure 4B is a schematic diagram of the motion trajectory in this embodiment, wherein the dotted line represents the baseline, the value above the baseline is positive, and the value below the baseline is negative. Figure 4B It can be seen that the total offset of point P2 is greater than the total offset of point P1. Figure 4C It is a static picture to be displayed in this embodiment. Figure 4D and Figure 4E for Figure 4C Transition state picture.
[0088] This embodiment is described by taking the Canvas API in the fifth generation Hypertext Markup Language (HTML5) as an example to dynamically display a static image in real time when a web page is loaded.
[0089] When the page is rendered, the link of the static image to be displayed and the corresponding dynamic display parameters can be written into the properties of the corresponding tag in Canvas.
[0090] When the page is loaded, the static image to be displayed can be obtained through the link of the static image to be displayed. In this embodiment, the static image to be displayed obtained is as follows: Figure 4C The dynamic display parameters in this embodiment may include a motion trajectory, a motion direction, and a number of transition states. The motion trajectory in this embodiment may be determined based on a Bezier curve, for example, Figure 4B As shown, the movement direction is longitudinal movement and the number of transition states is 2.
[0091] like Figure 4B As shown, the rectangular box in the figure can represent a canvas, and the size of the canvas can be the same as the size of the static image to be displayed. The line connecting the center of the left line of the canvas to the center of the right line is the baseline, as shown by the dotted line in FIG4B. The curve in the figure represents the motion trajectory of this embodiment, and the total offset at each position can be determined based on the curve. Based on the baseline, the horizontal coordinate of each point on the curve represents the position, and the vertical coordinate represents the total offset of the point. Figure 4B As shown, the total offset of point P1 is 10 pixels, and the total offset of point P2 is 20 pixels. It can be understood that the total offset can be positive or negative, positive above the baseline and negative below the baseline, the maximum value can be half of the image height, and the minimum value can be the negative value of half of the image height.
[0092] In this embodiment, according to the link of the static image to be displayed, the pixel value of the static image to be displayed can be a one-dimensional array. The one-dimensional array consists of numbers from 0 to 255. Each pixel in the image consists of four values of RGBA. Therefore, every four numbers in the one-dimensional array represent one pixel. For example, for a picture with a width of 200 pixels and a height of 200 pixels, 200*200*4=160000 numbers are required to represent it, that is, the length of the one-dimensional array storing the picture is 160000.
[0093] In this embodiment, the cutting strategy for the one-dimensional array storing the static picture to be displayed can be determined by the direction of movement. If the direction of movement is horizontal movement, the one-dimensional array needs to be cut according to the width of the static picture. For example, for a picture with a width of 200 pixels and a height of 100 pixels, the one-dimensional array starts from 0, and is cut once every 200 values, and the cut values are stored in a new array. 100 one-dimensional arrays can be cut out, and the 100 one-dimensional arrays are stored in a new array, and finally a two-dimensional array with a length of 100 can be constructed. If the direction of movement is vertical movement, the one-dimensional array needs to be cut according to the height of the static picture. For example, for a picture with a width of 200 pixels and a height of 100 pixels, starting from 0, a value is taken every 200 values, and a total of 100 values are taken and stored in a new array, 200 one-dimensional arrays can be cut out, and the 200 one-dimensional arrays are stored in a new array, and finally a two-dimensional array with a length of 200 is constructed.
[0094] The movement direction in this embodiment is longitudinal movement, so for Figure 4C The static image to be displayed is cut according to the image height, that is, cut by columns.
[0095] The number of transition states in this embodiment is 2, so the total offset can be evenly divided into 2 parts, and only half of the total offset is offset each time. Figure 4C The static picture shown, offset by half of the total offset, can be obtained Figure 4D The first transition state picture shown; Figure 4C The static picture shown, offset by the total offset, can be obtained Figure 4E The second transition state picture is shown.
[0096] Figure 4C , Figure 4D and Figure 4E The dynamic atlas in this embodiment is formed. By playing it in a loop at a preset period, for example, every 100 milliseconds, a dynamic display effect of a bow jumping upward can be achieved.
[0097] In this embodiment, the motion trajectory is determined by using a Bezier curve so that the offset of each position can be different, so that the bow is deformed during the dynamic display process, and the dynamic display effect is more realistic.
[0098] On the basis of any of the above embodiments, in order to further enrich the dynamic display effect, the method provided in this embodiment may further include: updating the dynamic display parameters according to user input; and dynamically displaying the static image to be displayed according to the updated dynamic display parameters.
[0099] In this embodiment, for example, multiple groups of dynamic display parameters may be pre-set, and then the dynamic display parameters may be changed according to a switching instruction input by the user; or new dynamic display parameters input by the user may be directly received.
[0100] In this embodiment, after the dynamic display parameters are updated, the acquired static pictures to be displayed are dynamically transformed according to the updated dynamic display parameters to form a new dynamic picture set. Then, the pictures in the new dynamic picture set are played cyclically at a preset period to realize dynamic display.
[0101] by Figure 2A Take the static picture to be displayed as an example, if the updated dynamic display parameters are rotated 90°, 180°, and 270° counterclockwise, then Figure 2A Rotate 90° counterclockwise to get Figure 2D The transition state picture shown will Figure 2A Rotate 180° counterclockwise to get Figure 2C The transition state picture shown will Figure 2A Rotate 270° counterclockwise to get Figure 2B That is, the dynamic picture set determined according to the updated dynamic display parameters includes: Figure 2A , Figure 2D , Figure 2C and Figure 2B By looping the video, you can achieve a dynamic effect of the black fan rotating counterclockwise.
[0102] Similarly, for Figure 4C The static picture to be displayed is shown, if the motion trajectory in the updated dynamic display parameters is Figure 4B The motion trajectory shown is along Figure 4B If you mirror the baseline shown by the dotted line in the middle, you will get the dynamic effect of the bow bending and jumping towards the bottom of the picture.
[0103] The dynamic display method of a static image provided in this embodiment is based on the above-mentioned embodiment and realizes a variety of dynamic display effects for the same static image by updating dynamic display parameters.
[0104] The present invention also provides a dynamic display device for static images. Figure 5 As shown, the embodiment of the present invention is only Figure 5 This is just an example for explanation, and it does not mean that the present invention is limited to this. Figure 5 This is a schematic diagram of the structure of an embodiment of a dynamic display device for static images provided by the present invention. Figure 5 As shown, the dynamic display device 50 for static pictures provided in this embodiment may include: a first acquisition module 501 , a second acquisition module 502 , a processing module 503 and a playing module 504 .
[0105] A first acquisition module 501 is used to acquire a static image to be displayed;
[0106] A second acquisition module 502 is used to acquire dynamic display parameters, where the dynamic display parameters are used to represent the dynamic transformation of the static picture to be displayed;
[0107] The processing module 503 is used to determine a dynamic atlas according to the static picture to be displayed and the dynamic display parameters, where the dynamic atlas includes the static picture to be displayed and at least one transition state picture, and the at least one transition state picture is determined according to the static picture to be displayed and the dynamic display parameters;
[0108] The playing module 504 is used to play the pictures in the dynamic picture set in a loop at a preset period.
[0109] The device of this embodiment can be used to perform Figure 1 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0110] Optionally, the first acquisition module 501 may be specifically configured to: acquire the static image to be displayed according to a link of the static image to be displayed.
[0111] Optionally, the dynamic display parameters may include a motion trajectory, a motion direction, and a number of transition states, where the number of transition states is used to indicate the number of transition state images in the dynamic picture set.
[0112] Optionally, the processing module 503 is configured to determine the dynamic picture set according to the static picture to be displayed and the dynamic display parameter, which may specifically include:
[0113] According to the direction of motion, the static image to be displayed is segmented;
[0114] According to the motion trajectory, determine the total offset;
[0115] Determine the offset of each transition state image according to the number of transition states and the total offset;
[0116] According to the offset of each transition state image, the segmented static image to be displayed is subjected to offset processing;
[0117] A dynamic atlas is determined based on the static image to be displayed and the image after the offset processing.
[0118] Optionally, the motion direction may include horizontal motion and vertical motion; the processing module 503 is used to segment the static image to be displayed according to the motion direction, which may specifically include:
[0119] If the motion direction is horizontal motion, the static image to be displayed is divided into rows;
[0120] or,
[0121] If the motion direction is vertical motion, the static image to be displayed is divided into columns.
[0122] Optionally, the motion trajectory may be determined according to a Bezier curve.
[0123] Optionally, the static picture dynamic display device 50 may further include an update module (not shown in the figure), which may be used to: update dynamic display parameters according to user input; and dynamically display the static picture to be displayed according to the updated dynamic display parameters.
[0124] The present invention also provides an electronic device, see Figure 6 As shown, the embodiment of the present invention is only Figure 6 This is just an example for explanation, and it does not mean that the present invention is limited to this. Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Figure 6 As shown, the electronic device 60 provided in this embodiment may include: a memory 601, a processor 602 and a bus 603. The bus 603 is used to realize the connection between various components.
[0125] The memory 601 stores a computer program, and when the computer program is executed by the processor 602, the technical solution of any of the above method embodiments can be implemented.
[0126] The memory 601 and the processor 602 are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines, such as through bus 603. The memory 601 stores a computer program for implementing a dynamic display method of a static picture, including at least one software function module that can be stored in the memory 601 in the form of software or firmware. The processor 602 executes various functional applications and data processing by running the software program and module stored in the memory 601.
[0127] The memory 601 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The memory 601 is used to store programs, and the processor 602 executes the programs after receiving the execution instruction. Furthermore, the software programs and modules in the above-mentioned memory 601 may also include an operating system, which may include various software components and / or drivers for managing system tasks (such as memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.
[0128] The processor 602 may be an integrated circuit chip with signal processing capability. The processor 602 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. The methods, steps, and logic diagrams disclosed in the embodiments of the present invention may be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor. It is understood that Figure 6 The structure is only for illustration and may also include Figure 6 More or fewer components as shown, or with Figure 6 Different configurations shown. Figure 6 Each component shown in the figure may be implemented by hardware and / or software.
[0129] It should be noted that the electronic device provided in this embodiment includes but is not limited to at least one of the following: user-side device and network-side device. User-side devices include but are not limited to computers, smart phones, tablet computers, digital broadcast terminals, message transceiver devices, game consoles, personal digital assistants, etc. Network-side devices include but are not limited to a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of computers or network servers, wherein cloud computing is a type of distributed computing, a super virtual computer consisting of a group of loosely coupled computers.
[0130] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the dynamic display method of a static picture provided by any of the above method embodiments can be implemented. The computer-readable storage medium in this embodiment can be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, an SSD), etc.
[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for dynamically displaying static images. It is characterized in that include: Get the static image to be displayed; Acquire dynamic display parameters, where the dynamic display parameters are used to represent the dynamic transformation of the static picture to be displayed, and the dynamic display parameters include a motion trajectory, a motion direction, and a number of transition states, where the number of transition states is used to represent the number of transition state pictures in the dynamic picture set; Segmenting the static picture to be displayed according to the motion direction; According to the motion trajectory, determining a total offset; Determine the offset of each transition state picture according to the number of transition states and the total offset; According to the offset of each transition state image, the segmented static image to be displayed is subjected to offset processing; Determine the dynamic atlas according to the static picture to be displayed and the picture after the offset processing, wherein the dynamic atlas includes the static picture to be displayed and at least one transition state picture, and the at least one transition state picture is determined according to the static picture to be displayed and the dynamic display parameter; The pictures in the dynamic picture set are played in a loop at a preset period.
2. The method according to claim 1, It is characterized in that The step of obtaining a static image to be displayed includes: According to the link of the static picture to be displayed, the static picture to be displayed is obtained.
3. The method according to claim 1, It is characterized in that The movement direction includes lateral movement and longitudinal movement; The segmenting of the static picture to be displayed according to the motion direction includes: If the movement direction is horizontal movement, the static picture to be displayed is divided into rows; or, If the movement direction is vertical movement, the static picture to be displayed is divided into columns.
4. The method according to claim 1, It is characterized in that The motion trajectory is determined according to a Bezier curve.
5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: According to user input, update the dynamic display parameters; The static image to be displayed is dynamically displayed according to the updated dynamic display parameters.
6. A dynamic display device for static pictures, It is characterized in that include: A first acquisition module is used to acquire a static image to be displayed; A second acquisition module is used to acquire dynamic display parameters, where the dynamic display parameters are used to represent the dynamic transformation of the static picture to be displayed, and the dynamic display parameters include a motion trajectory, a motion direction, and a transition state number, where the transition state number is used to represent the number of transition state pictures in the dynamic picture set; A processing module, configured to segment the static image to be displayed according to the motion direction; and determine a total offset according to the motion trajectory; Determine the offset of each transition state picture according to the number of transition states and the total offset; According to the offset of each transition state image, the segmented static image to be displayed is subjected to offset processing; Determine the dynamic atlas according to the static picture to be displayed and the picture after the offset processing; the dynamic atlas includes the static picture to be displayed and at least one transition state picture, and the at least one transition state picture is determined according to the static picture to be displayed and the dynamic display parameter; The playing module is used to play the pictures in the dynamic picture collection in a loop at a preset period.
7. An electronic device, It is characterized in that include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method for dynamically displaying a static picture as described in any one of claims 1 to 5.
8. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and the computer program is executed by a processor to implement the method for dynamically displaying a static picture as described in any one of claims 1-5.
Citation Information
Patent Citations
Animation display method and device for images
CN108364337A
Dynamic cartoon generation method and electronic equipment
CN108805962A
