WO2018045769A1 - Method and device for implementing tone variation animation on basis of attribute animation - Google Patents

Method and device for implementing tone variation animation on basis of attribute animation Download PDF

Info

Publication number
WO2018045769A1
WO2018045769A1 PCT/CN2017/083033 CN2017083033W WO2018045769A1 WO 2018045769 A1 WO2018045769 A1 WO 2018045769A1 CN 2017083033 W CN2017083033 W CN 2017083033W WO 2018045769 A1 WO2018045769 A1 WO 2018045769A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
value
color matrix
animation
attribute
Prior art date
Application number
PCT/CN2017/083033
Other languages
French (fr)
Chinese (zh)
Inventor
尤洋
Original Assignee
广州阿里巴巴文学信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州阿里巴巴文学信息技术有限公司 filed Critical 广州阿里巴巴文学信息技术有限公司
Publication of WO2018045769A1 publication Critical patent/WO2018045769A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/802D [Two Dimensional] animation, e.g. using sprites

Definitions

  • the present invention relates to the field of animation technology, and in particular, to a method and an apparatus for implementing a tone change animation based on attribute animation.
  • An animation is a sequence of static pictures that are continuously gradual, and the display is sequentially changed along the time axis, and a media form of motion visual perception is generated based on the principle of visual persistence of the human eye.
  • Tone change is a common animation effect, which means that the overall color of the picture changes gradually. For example, the sky blue gradually turns blue to indicate darkness, or the color becomes brighter or darker to indicate changes in light.
  • OpenGL Open Graphics Library
  • the implementation of tone change animation based on OpenGL requires the technician to write a program to read the pixel values of the image. Then, according to a certain time rule, the color values of the picture pixels are modified one by one. The method is complicated, the code writing is difficult, the implementation is difficult, and the execution efficiency is low.
  • the present application provides a method and a device for implementing the color change animation based on the attribute animation, which can be easily and conveniently implemented by the static picture. Change animation.
  • a method for implementing a tone change animation based on an attribute animation including:
  • the attribute animation-based tone change animation implementation method after converting the original still image into a bitmap, according to a preset time Before the segment rule generates n time nodes, it also includes:
  • the bitmap is scaled according to the size of the display area.
  • the preset time segmentation rule is that the interval between the time nodes is the same and less than 0.1 second.
  • the color matrix comprises a red R component, a green G component, a blue B component, a transparency Alpha component, and a placeholder component.
  • the color matrix of the i-th time node is calculated according to the preset color matrix initial value F, the color matrix end value L, and the color matrix calculation rule Values, including:
  • the color matrix initial value F is the color matrix value M 1 of the first time node
  • the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
  • h j (L) ⁇ h j ( F)
  • h j (Mi) h j (F) + [h j (L) -h j (F)] ⁇ i / n;
  • h j (L) ⁇ h j (F)
  • h j (Mi) h j (L) - [h j (F) - h j (L)] ⁇ i / n.
  • the attribute animation-based tone change animation implementation method after converting the original still image into a bitmap, according to a preset time Before the segment rule generates n time nodes, it also includes:
  • a preset color matrix initial value F and a color matrix end value L are determined according to the primary color.
  • the acquiring the primary color of the original still picture includes:
  • Pixels whose color values are within the preset deviation range are classified into pixels of the same color, and count the pixels within each preset deviation range;
  • the average value of the color values in the range of the main color deviation is calculated, and the color corresponding to the average value is the main color.
  • the determining, by the primary color, a preset color matrix initial value F and a color matrix end value L including:
  • the color matrix value of the original color value of the main color is maintained as the initial value F of the color matrix
  • the primary color variation range is set according to a preset primary color change value by using one of F as a boundary value;
  • Another boundary value of the range of the primary color variation is the color matrix end value L.
  • the method for implementing a tone animation based on an attribute animation includes:
  • the value of the color filter attribute is set by the color matrix value, and the bitmap is drawn according to the color filter attribute, including: setting a value of a color filter attribute of the brush to the color matrix value, and using the The brush draws the bitmap.
  • the preset color matrix initial value F the color matrix end value L, the number of time nodes n And a color matrix calculation rule for calculating a color matrix value of the i-th time node;
  • the color matrix value of the i-th time node is used as a color filter attribute value, and the bitmap is drawn according to the color filter attribute to obtain a new picture and displayed;
  • an apparatus for implementing a tone change animation based on an attribute animation includes:
  • An original still picture obtaining unit configured to acquire an original still picture
  • a picture conversion unit configured to convert the original still picture into a bitmap
  • An interpolation unit configured to generate n time nodes according to a preset time segmentation rule
  • a first color matrix calculation unit configured to calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node;
  • a drawing unit configured to filter a value of the attribute by the color matrix value at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display;
  • the attribute animation-based tone change animation implementing apparatus further includes a scaling unit, configured to: convert the original still image After the bitmap is generated, the bitmap is scaled according to the size of the display area before the n time nodes are generated according to the preset time segmentation rule.
  • the preset time segmentation rule is that the interval between the time nodes is the same and less than 0.1 second.
  • the color matrix includes a red R component, a green G component, a blue B component, a transparency Alpha component, and a placeholder component.
  • the color matrix calculation unit is specifically configured to: when calculating a color matrix value of the i-th time node:
  • the color matrix initial value F is the color matrix value M 1 of the first time node
  • the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
  • h j (L) ⁇ h j ( F)
  • h j (Mi) h j (F) + [h j (L) -h j (F)] ⁇ i / n;
  • h j (L) ⁇ h j (F)
  • h j (Mi) h j (L) - [h j (F) - h j (L)] ⁇ i / n.
  • a main color acquiring unit configured to acquire a main color of the original still picture before generating the n time nodes according to the preset time segmentation rule after converting the original still picture into a bitmap,
  • the main color is the color of the pixel in the original still picture
  • a preset color matrix determining unit configured to determine a preset color matrix initial value F and a color matrix end value L according to the primary color.
  • the primary color acquiring unit includes:
  • a pixel point counting module configured to classify pixel points whose color values are within a preset deviation range into pixels of the same color, and count pixel points within each preset deviation range;
  • the main color deviation range determining module is configured to compare the number of pixel points within each preset deviation range, and the preset deviation range with the largest pixel point is the main color deviation range;
  • the main color determining module is configured to calculate an average value of the color values within the main color deviation range, and the color corresponding to the average value is the main color.
  • the preset color matrix determining unit includes:
  • a color matrix initial value determining module configured to maintain a color matrix value of a primary color value of the primary color value as a color matrix initial value F;
  • a main color change range setting module configured to set a main color change range according to a preset main color change value by using one of F as a boundary value
  • the color matrix end value determining module takes another boundary value of the main color variation range as a color matrix end value L.
  • the interpolating unit Generating n time nodes according to preset time segmentation rules using an interpolator
  • the first color matrix calculation unit is configured to calculate an i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node.
  • Color matrix value a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node.
  • the drawing unit is configured to set a value of a color filter attribute of the brush to the color matrix value at the i-th time node, and use the brush to draw the bitmap to obtain a new picture and display.
  • another apparatus for implementing a tone change animation based on an attribute animation including:
  • An original still picture obtaining unit configured to acquire an original still picture
  • a picture conversion unit configured to convert the original still picture into a bitmap
  • a second color matrix calculation unit calculates a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, a number of time nodes n, and a color matrix calculation rule;
  • An interpolation unit configured to generate n time nodes according to a preset time segmentation rule
  • a drawing unit configured to filter a value of the attribute by the color matrix value of the i-th time node at the i-th time node, and draw the bitmap according to the color filtering attribute to obtain a new image and display ;
  • the technical solution provided by the embodiment of the present application generates a time series, and calculates different color matrix values at each time node of the time series, sets a color filter attribute value of the brush to a color matrix value of the current time node, and uses the brush at the same time.
  • the picture is drawn, and the overall color (hue) of the picture is dynamically changed at each time node to obtain a new picture, and the new picture sequence generated along with the time series is an animated picture sequence.
  • the animated picture sequence is displayed along a time series to visually form a picture tonal variation animation.
  • the implementation method of the color-changing animation based on the attribute animation provided by the embodiment of the present application is simple and easy, requires less resources, has high execution efficiency, and is more conducive to real-time online implementation of the image. Animated effects of tonal changes.
  • FIG. 1 is a schematic flow chart of a method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application
  • FIG. 2 is a schematic flowchart diagram of another method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application
  • FIG. 3 is a schematic flowchart diagram of still another method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application
  • FIG. 4 is a schematic flowchart diagram of still another method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application
  • FIG. 5 is a block diagram of an attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application
  • FIG. 6 is a block diagram of another attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application.
  • FIG. 7 is a block diagram of still another apparatus for implementing tone change animation based on attribute animation according to an exemplary embodiment of the present application.
  • FIG. 8 is a block diagram of still another attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application.
  • FIG. 9 is a block diagram showing a hardware structure of an attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application.
  • Attribute animation is a mechanism for manipulating values in animation. Animating effects by assigning values to specified properties of the object, where the object can be any object, and the property can be any property of the object.
  • the time interpolator (for convenience of description, hereinafter referred to as the interpolator) and the estimator are two important tools in the property animation.
  • the interpolator is essentially a function of time, which defines the variation of the animation over time; the estimator defines The attribute value is calculated by the types of int, float, and color. The attribute values of each time point are calculated based on the start value, end value, and interpolation of the attribute.
  • the interpolator and the estimator are usually used together.
  • the interpolator generates a time series, and the estimator calculates the value of each time attribute according to the time series order.
  • Both the interpolator and the estimator can be customized by the user for richer animations.
  • Bitmap (BMP file format) is a widely used image file format. Since bitmaps can save data of image pixel fields without any change, they are an important source for obtaining RAW data (raw data).
  • a brush is a drawing tool in a property animation that draws a picture based on its properties.
  • Color filtering refers to the overall change of the color of the picture, as if the color of the picture has been filtered, so it is called color filtering.
  • FIG. 1 is a schematic flowchart of a method for implementing a tone change animation based on an attribute animation according to an exemplary embodiment of the present application. As shown in FIG. 1 , the method includes:
  • Step S101 Acquire an original still picture.
  • the original static image can be pre-stored in a file or database, and can be read using the system's image reading function.
  • the original static image can also be obtained by using a frame grab function for a certain frame of an animation or video.
  • the original still image can be a separate image or a background image in a composite animation.
  • Step S102 converting the original still picture into a bitmap.
  • the original static image After obtaining the original static image, the original static image is format converted to obtain a bitmap, and then the bitmap can be used as a Bitmap object, and the pixel data of the image is read from the Bitmap object to perform related calculation.
  • Step S103 generating n time nodes according to a preset time segmentation rule, where n is a positive integer.
  • the interpolators can be used to generate n time nodes, and all the time nodes form a time series. Therefore, the step S103 can also specifically generate a time series including n time nodes by using an interpolator.
  • the time series determines the display frequency of the generated picture sequence, and the pictures generated by each time node are sequentially displayed along the time series to form an animation effect, so the time interval between the time nodes needs to meet the requirements of the visual persistence effect.
  • the time interval can be set below 0.4s.
  • the time interval can be further set below 0.1 s for a smoother animation.
  • the preset time segmentation rule may be linear or non-linear, linear means that time intervals between time nodes are equal, non-linear means that time intervals between time nodes may be unequal, and non-linearity may be in multiple forms. For example, the parabola increases or decreases.
  • the time series displayed by the linear time segmentation rule shows an animation that is smooth and gradual, and is more in line with human visual habits.
  • the animations displayed in time series obtained by nonlinear time segmentation rules can produce visual effects such as flicker.
  • Step S104 at the i-th time node, calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule.
  • Step S105 At the i-th time node, filter the value of the attribute with the color matrix value, and draw the bitmap according to the color filter attribute to obtain a new picture and display it.
  • the color matrix value corresponding to the time node is calculated.
  • the evaluator may be used to calculate the color matrix value corresponding to the time node.
  • the color of the picture pixel contains four components: the red R component, the green G component, the blue B component, and the transparency Alpha component.
  • the color matrix uses each component as a row of the matrix, and presses R, G, B, and A (Alpha). , abbreviated as A) in order, each line is divided into 5 columns by default, also The color matrix is represented by a 4 ⁇ 5 matrix, and the color matrix specification is:
  • F is the color matrix.
  • the pixel color calculation formula is:
  • uppercase R, G, B, and A are original color component values before being calculated by the color matrix
  • lowercase r, g, b, and a are calculated color component values.
  • the elements in the color matrix usually take values between 0 and 1, 0 means none, that is, the color is not visible, 1 means to keep the original value, and the user can customize the value range of the element according to the situation of the picture and the needs of the calculation. That is, it is not limited to taking a value between 0 and 1.
  • the color matrix value and the original color component value of the pixel By calculating the color matrix value and the original color component value of the pixel, the color of the pixel can be changed, and the color matrix value and the original color component value of all the pixels in the image are calculated, and the colors of all the pixels in the image can be uniformly changed. Thereby, the hue of the picture can be changed as a whole.
  • the more commonly used color matrix is a 4 ⁇ 5 matrix.
  • a placeholder component is introduced into the color matrix, and the placeholder component is the fifth row, which constitutes a 5 ⁇ 5 symmetric matrix, and the symmetric matrix is more Convenient for calculation, and the placeholder component facilitates the introduction of additional offsets, making the color matrix more flexible for pixel color control.
  • the purpose of the present application is to progressively modify the color of the picture following the time series generated by the interpolator. Color, so each time node calculates a new color matrix to change the color value of the picture pixel, that is, to obtain a sequence of color matrices corresponding to the time series.
  • an interpolation method can be used to preset a color matrix initial value F and a color matrix end value L, and then interpolate to obtain a series of intermediate values.
  • F and L are set by the user according to the original hue of the picture and the desired final hue, which is set by the user according to the intermediate effect of the desired hue change animation, and the color matrix calculation rule can be linear as well.
  • the linear change of the color matrix means that the value of each component in the color matrix changes according to a linear law, for example, according to the law of equal variation
  • the nonlinear change of the color matrix means that the value of each component in the color matrix changes according to a nonlinear law, for example, The law of proportional changes.
  • linearly calculating a sequence of color matrices may include:
  • the color matrix initial value F is the color matrix value M 1 of the first time node
  • the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
  • h j (L) ⁇ h j ( F)
  • h j (Mi) h j (F) + [h j (L) -h j (F)] ⁇ i / n;
  • h j (L) ⁇ h j (F)
  • h j (Mi) h j (L) - [h j (F) - h j (L)] ⁇ i / n.
  • F is the first color matrix
  • L is the nth color matrix
  • the i-th color matrix is calculated step by step according to a linear rule. Specifically, each component of the i-th color matrix M 1 is linearly incremented or linearly decremented, for the jth color matrix. component, when h j (L) ⁇ h j ( F), i.e.
  • the component has no change, and the respective intermediate values of the component remain unchanged; when h j (L) ⁇ h j (F), that is, the value of the jth component in L is smaller than the value of the jth component in F,
  • the jth component h j (Mi) h j (L) - [h j (F) - h j (L)] ⁇ i / n of the i-th color matrix is successively decremented.
  • the components of the color matrix in the color matrix sequence are linearly incremented
  • the color matrix calculation rule may also be non-linear, for example, changing the components of the color matrix, or designing other calculation rules such as sine variation rules according to special effects requirements, or randomly within a set range according to mathematical rules.
  • the component values in the color matrix are set by the initial value of the color matrix and the end value of the color matrix. For example, if you want to make the green of the green plant map darker, you can increase the G component in the color matrix from the initial value. Each time you increase it, you can specify it randomly, and do not exceed the final value. For example, the following color matrix F is increasing G.
  • the component becomes the following color matrix M 1 .
  • the brush is a picture drawing tool.
  • the brush draws the picture, that is, the brush calculates the color matrix and the color matrix of the picture pixel, changes the color value of the picture pixel, thereby changing the color of the picture, and the color matrix value is used as a brush.
  • the value of the color filter property is called by the brush when it is drawn.
  • the brush can call a drawing function such as an Ondraw function in the Android system to complete the drawing of the new picture and update the original picture pixel.
  • the attribute animation-based tone change animation implementation method provided by the present application is different from the method commonly used in OpenGL for complex programming, and only needs to generate different color matrices in each time node of the time series, and use the color matrix to change the color filter attribute.
  • the color filter attribute the picture is drawn, so that the overall color (hue) of the picture is dynamically changed at each time node, and the picture color change animation is obtained.
  • the method provided by the present application is simple and easy, takes less resources, and has high execution efficiency. It is more conducive to realizing the animation effect of the picture color change in real time online.
  • the picture tonal variation animation generated according to the method provided by the present application can be displayed not only separately, but also superimposed with other animations such as picture element position change animations to form a richer animation effect.
  • the attribute animation-based tone change animation implementation method provided by the present application can be applied to a system with attribute animation, including but not limited to Android (Android) and iOS (Apple Mobile System).
  • FIG. 2 is a schematic flowchart diagram of another method for implementing a tone animation based on attribute animation according to an exemplary embodiment of the present application. As shown in FIG. 2, the method includes:
  • Step S201 Acquire an original still picture.
  • Step S201 converting the original still picture into a bitmap.
  • Step S203 the bitmap is scaled according to the size of the display area.
  • the steps S201 to S202 are the same as the steps S101 to S102.
  • the bitmap is scaled to match the size of the bitmap to the display area.
  • an image is an object in a View. To make it easier to scale the image, you can make the View of the image inherit from the parent view containing the zoom function, such as ImageView in Android. The View containing the bitmap is inherited from the ImageView. You can easily call the zoom function in the parent view to scale the bitmap so that the bitmap and the display area are consistent.
  • Step S204 Acquire a main color of the original still picture, where the main color is a color with the most pixels in the original still picture.
  • Step S205 determining a preset color matrix initial value F and a color matrix end value L according to the primary color.
  • the hue of a picture is usually determined by the main color of the picture.
  • the change of the main color of the picture will also form a hue change effect visually.
  • the picture there are a plurality of color blocks having different colors, such as a red block, a blue block, and a green block. Since the color difference of the color blocks is large, it is difficult to directly determine the initial color value and the end color value of the overall color tone change. Underneath, you can get the main picture first. Color, change the hue of the picture from the main color.
  • the main color is the color with the most pixels in the picture.
  • the pixel data of the bitmap is read, and the pixel points of the same color value are counted according to the pixel data, and which color value has the most pixel points, then The color corresponding to the color value is the main color. Since there may be an error between the color value of the pixel and the standard color value, it is also possible to classify the pixel points whose color values are within the preset deviation range into the same color, and then count the pixel points within the respective deviation ranges, and compare the deviations. The number of pixels in the range, the deviation range of the pixel point is the main color deviation range, and then the average value of the color values in the main color deviation range is taken, and the color corresponding to the average value is the main color.
  • the deviation range may be determined according to the color distribution of the picture. If the color difference of the picture color block is large, the deviation range may be preset to be smaller, so that the color classification is more accurate. If there are many color blocks, the color difference of the color block is small. Or if there are large or small, you can preset the deviation range to be larger to facilitate the main color.
  • the color matrix value of the original color value of the main color may be the initial value F of the color matrix. Specifically, if the main color obtained is the same as the color value of the largest color patch in the image, then F It can be a unit matrix. If the obtained main color is obtained according to the average value of the color values within the main color deviation range, the color value of the main color may be mathematically calculated with the actual color value of the picture color block. The deviation, in this case, takes the color value of a certain pixel of the largest color patch, so that the color matrix capable of changing the color value to the primary color value is F.
  • the main color change range is set according to the preset main color change value by one of F as the boundary value, and the other boundary value of the main color change range is the color matrix end value L, wherein the main color change value can be The absolute value of the difference between the two boundary values of the main color change range, which is set by the user according to the desired degree of change in hue, is set in the program.
  • the system displays the main color information through the user interface, and sets an input box for inputting F and L on the user interface, and the user selects the main color information of the image according to the desired effect. Customize F and L, and input through the input boxes of F and L. The system obtains F and L through the input box to complete the determination of F and L.
  • Step S206 generating n time nodes according to a preset time segmentation rule.
  • Step S207 at the i-th time node, calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule.
  • Step S208 filtering the value of the attribute with the color matrix value, and drawing the bitmap according to the color filter attribute to obtain a new picture and displaying it;
  • steps S206 to S208 are the same as steps S103 to S105.
  • the method for realizing the tone change animation based on the attribute animation provided by the embodiment after obtaining the bitmap, scaling the bitmap according to the size of the display area, to prevent the pixel from being missing and eliminating the influence of the frame, thereby obtaining the picture more accurately.
  • Pixel data, and the method provided by the embodiment first acquires the main color of the picture, and determines the color matrix initial value and the color matrix end value based on the main color, so that the hue change animation effect of the multi-color block picture can be more conveniently realized.
  • FIG. 3 is a schematic flowchart diagram of still another method for implementing a tone change animation based on an attribute animation according to an exemplary embodiment of the present application. As shown in FIG. 3, the method includes:
  • Step S301 acquiring an original still picture.
  • Step S302 converting the original still picture into a bitmap.
  • Step S303 calculating a color matrix value of the i-th time node according to the preset color matrix initial value F, the color matrix end value L, the number of time nodes n, and the color matrix calculation rule.
  • Step S304 generating n time nodes according to a preset time segmentation rule.
  • Step S305 in the i-th time node, filter the value of the attribute with the color matrix value of the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display.
  • the main difference between the embodiment shown in FIG. 3 and the embodiment shown in FIG. 1 is that the embodiment shown in FIG. 1 calculates the color matrix value in real time at each time node, and the embodiment shown in FIG. 3 is before the time node is generated. Calculate the color matrix values of each time node, and then use the interpolator to generate the time node. After generating each time node, it is no longer necessary to calculate the color matrix value, just according to the generated color matrix value corresponding to the current time node. To set the value of the color filter attribute, specifically, at the i-th time node, set the color filter property of the brush to the generated i-th color matrix value, and then use the brush to draw the bitmap.
  • the time series generation process and the animation picture sequence generation process do not need to calculate the calculation time and resources.
  • the interval between the time nodes in the time series may be more Small, the program execution efficiency is higher, but the color matrix values in the method shown in Figure 3 need to be saved in order after the calculation, and the color matrix value calculated in real time in Figure 1 can only be temporarily stored, memory consumption. Can be less.
  • FIG. 4 is a schematic flowchart diagram of still another method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application. As shown in FIG. 4, the method includes:
  • Step S401 obtaining an original still picture.
  • Step S402 converting the original still picture into a bitmap.
  • Step S403 the bitmap is scaled according to the size of the display area.
  • Step S404 Acquire a main color of the original still picture, where the main color is a color with the most pixels in the original still picture.
  • Step S405 determining a preset color matrix initial value F and a color matrix end value L according to the primary color.
  • Step S406 calculating a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, a number of time nodes n, and a color matrix calculation rule;
  • Step S407 generating n time nodes according to a preset time segmentation rule.
  • Step S408 In the i-th time node, filter the value of the attribute by the color matrix value of the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display it.
  • steps S401 to S402 are the same as steps S301 to S302, and steps S403 to S405 are the same as steps S203 to S205, and steps S406 to S408 are the same as steps S303 to S305.
  • step S403 and steps S404 to S405 may be simultaneously added to the attribute animation-based tone change animation implementation method shown in FIGS. 1 and 3, or only step S403 may be added, or only steps S404 and S405 may be added.
  • the present application can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is better.
  • Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product and stored in a storage medium, including a plurality of instructions for making a smart device. All or part of the steps of the method described in the various embodiments of the present application are performed.
  • the foregoing storage medium includes: a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
  • ROM read only memory
  • RAM random access memory
  • magnetic disk or an optical disk.
  • FIG. 5 is a block diagram of an attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application.
  • the apparatus includes an original still picture acquiring unit U501, a picture converting unit U502, and an interpolation unit.
  • the original still picture obtaining unit U501 is configured to acquire an original still picture.
  • the picture conversion unit U502 is configured to convert the original still picture into a bitmap.
  • the interpolation unit U503 is configured to generate n time nodes according to a preset time segmentation rule.
  • the first color matrix calculation unit U504 is configured to calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node.
  • the drawing unit U505 is configured to filter the value of the attribute with the color matrix value at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display the same;
  • the original still picture obtaining unit U501 can use the system's picture reading function to obtain the original still picture. If the original still picture is a certain frame of an animation or video, then The original still picture obtaining unit U501 can use the frame grabbing function to acquire the original still picture. After the U501 obtains the original still picture, the picture converting unit U502 formats the picture to obtain a bitmap, and the subsequent drawing unit U505 can use the bitmap as a Bitmap object to read the pixel data of the picture from the Bitmap object. Calculate and draw.
  • the interpolation unit U503 can use the interpolator to generate n time nodes, all of which form a time series, and the pictures generated by each time node are sequentially displayed along the time series to form an animation effect.
  • the time interval of the time node can be set below 0.4s.
  • the time interval can be further set below 0.1 s for a smoother animation effect.
  • the preset time segmentation rule used by the interpolation unit U503 may be linear or non-linear, linear means that the time intervals between time nodes are equal, and non-linear refers to between time nodes. The time intervals can be unequal.
  • the time series displayed by the linear time segmentation rule shows an animation that is smooth and gradual, and is more in line with human visual habits.
  • the animation displayed in time series according to the nonlinear time segmentation rule can produce visual effects such as flicker.
  • the first color matrix calculation unit U504 calculates a color matrix value corresponding to the time node, and the first color matrix calculation unit U504 can calculate the color matrix value using the estimator of the attribute animation.
  • the color matrix specification is:
  • uppercase R, G, B, and A are original color component values before being calculated by the color matrix
  • lowercase r, g, b, and a are calculated color component values.
  • the more commonly used color matrix is a 4 ⁇ 5 matrix.
  • a placeholder component is introduced into the color matrix, and the placeholder component is the fifth row, which constitutes a 5 ⁇ 5 symmetric matrix, and the symmetric matrix is more Convenient for calculation, and the placeholder component facilitates the introduction of additional offsets, making the color matrix more flexible for pixel color control.
  • the rendering unit U505 progressively uses the time series generated by the interpolator to progressively use the color matrix of the color matrix modification unit calculated by the first color matrix calculation unit U504, and the first color matrix calculation unit U504 calculates a new color matrix for each time node, thereby obtaining A sequence of color matrices corresponding to a time series.
  • the first color matrix calculation unit U504 can perform calculation using interpolation, preset the color matrix initial value F and the color matrix end value L, and then interpolate to obtain a series of color matrix values in the middle.
  • F and L are set by the user according to the original hue of the picture and the desired final hue, which is set by the user according to the intermediate effect of the desired hue change animation, and the color matrix calculation rule can be linear as well.
  • the matrix calculation rule makes the color matrix linearly change, and the nonlinear color matrix calculation rule makes the color matrix nonlinearly change.
  • the picture is evenly transformed, and the animation effect is gradual and gradual.
  • the picture tonal transformation is not uniform, and the animation effect is abrupt.
  • the first color matrix calculation unit U504 linearly calculates the color matrix sequence, it is specifically used to:
  • the color matrix initial value F is the color matrix value M 1 of the first time node
  • the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
  • h j (L) ⁇ h j ( F)
  • h j (Mi) h j (F) + [h j (L) -h j (F)] ⁇ i / n;
  • h j (L) ⁇ h j (F)
  • h j (Mi) h j (L) - [h j (F) - h j (L)] ⁇ i / n.
  • F is the first color matrix
  • L is the nth color matrix
  • the i-th color matrix is gradually calculated according to a linear rule. Specifically, each component of the i-th color matrix M 1 is linearly incremented or linearly decremented, for the jth of the color matrix. of component, when h j (L) ⁇ H j (F), i.e.
  • the components of the color matrix in the color matrix sequence are linearly incremented or decremented, the calculation method
  • the first color matrix calculation unit U504 takes F as the first color matrix
  • the first color matrix calculation unit U504 L is the nth color matrix.
  • the first color matrix calculation unit U504 calculates the i-th color matrix according to the linear rule based on the first color matrix (ie, F). Ground, each component of the i-th color matrix Mi is linearly incremented or linearly decremented.
  • the color matrix calculation rule used by the first color matrix calculation unit U504 may also be non-linear, for example, the components of the color matrix may be changed in proportion, or other color matrix calculation rules such as sine change rules may be designed according to special effect requirements, or may not be based on
  • the mathematical rules randomly assign values to the components in the color matrix within the set range, and the set range is determined by the initial value of the color matrix and the end value of the color matrix.
  • the drawing unit U505 sets the color filter attribute of the brush to the i-th color matrix value, and uses the brush to perform the bitmap on the bitmap. Draw the hue of the changed picture to get the i-th new picture. All the new images generated form a sequence of animated images, and the hue change animation is implemented along the time series display.
  • the attribute animation-based tone change animation implementing device provided by the present application generates different color matrices at each time node of the time series, and dynamically changes the overall color of the image at each time node by using a color matrix through a brush, thereby obtaining a picture color tone.
  • the animation of the change the device takes up less resources when executing, and has high execution efficiency, which is more conducive to realizing the animation effect of changing the tone of the picture in real time online.
  • the picture color change animation generated by the device provided by the present application can be displayed not only separately but also with other animations to form a richer animation effect.
  • the attribute animation-based tone change animation implementing device provided by the present application can be applied to a system with attribute animation, including but not limited to Android (Android) and iOS (Apple Mobile System).
  • FIG. 6 is a block diagram of another attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application.
  • the apparatus includes an original still picture acquiring unit U601, a picture converting unit U602, and zooming.
  • the original still picture obtaining unit U601 is configured to acquire an original still picture.
  • the picture conversion unit U602 is configured to convert the original still picture into a bitmap.
  • the scaling unit U603 is configured to scale the bitmap according to the size of the display area.
  • the main color obtaining unit U604 is configured to acquire a main color of the original still picture, where the main color is a color with the most pixel points in the original still picture.
  • the preset color matrix determining unit U605 is configured to determine a preset color matrix initial value F and a color matrix end value L according to the primary color.
  • the interpolation unit U606 is configured to generate n time nodes according to a preset time segmentation rule.
  • the first color matrix calculation unit U607 is configured to calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node.
  • the drawing unit U608 is configured to filter the value of the attribute with the color matrix value at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display it.
  • the scaling unit U603 scales the bitmap to make the bitmap conform to the size of the display area, thereby more accurately acquiring the bitmap pixel, preventing the pixel from being missing, and Eliminate the effects of the border.
  • the image conversion unit U602 converts the original static image into a bitmap, so that the View of the bitmap object can inherit the parent view containing the zoom function, so that the zoom unit U603 can be conveniently called.
  • the zoom function in the parent view scales the bitmap.
  • the above primary color acquiring unit U604 may further include a pixel point counting module, a primary color deviation range determining module, and a primary color determining module (not shown).
  • the pixel point counting module is configured to classify pixel points whose color values are within a preset deviation range into pixel points of the same color, and count pixel points within each preset deviation range.
  • the main color deviation range determining module is configured to compare the number of pixel points within each preset deviation range, and the preset deviation range with the largest pixel point is the main color deviation range.
  • the main color determining module is configured to calculate an average value of the color values within the main color deviation range, and the color corresponding to the average value is the main color.
  • the main color is the color with the most pixels in the picture, and the bitmap is scaled in the scaling unit U603.
  • the main color acquiring unit U604 reads the pixel data of the bitmap, and counts the pixel points of the same color value according to the pixel data, and which color value has the largest number of pixels, the color corresponding to the color value is the main color. Since there may be an error between the color value of the pixel and the standard color value, the pixel point of the color value within the preset deviation range may be classified into the same color by the pixel point counting module, and then the pixel within each deviation range is counted.
  • the main color deviation range determining module compares the number of pixels in each deviation range, and the deviation range with the largest pixel point is the main color deviation range, and the main color determination mode takes the average of the color values within the main color deviation range.
  • the value is the main color corresponding to the average value.
  • the deviation range may be determined according to the color distribution of the picture. If the color difference of the picture color block is large, the deviation range may be preset to be smaller, so that the color classification is more accurate. If there are many color blocks, the color difference of the color block is small. Or if there are large or small, you can preset the deviation range to be larger to facilitate the main color.
  • the above preset color matrix determining unit U605 may further include a color matrix initial value determining module, a primary color variation range setting module, and a color matrix end value determining module (not shown).
  • the color matrix initial value determining module is configured to maintain the color matrix initial value F of the color matrix value of the original color value of the primary color.
  • the primary color variation range setting module is configured to set a primary color variation range according to a preset primary color change value by using one of F as a boundary value.
  • the color matrix end value determining module is configured to use the other boundary value of the main color variation range as the color matrix end value L.
  • the color matrix initial value determining module in the preset color matrix determining unit U605 maintains the color matrix value of the original color value of the main color as the color matrix initial value F, if obtained
  • the main color of the main color is the same as the color value of the largest color block in the picture, then F is the unit matrix. If the main color is obtained by the main color determining module according to the average value, the color value of the main color may be the same as the picture color block.
  • the actual color value has a mathematical deviation.
  • the color matrix initial value determining module can take the color value of a certain pixel of the largest color block to change the color value to the color of the primary color value.
  • the matrix is F.
  • the main color change range setting module sets the main color change range according to the preset main color change value by using one of F as the boundary value, and the color matrix end value determination module takes another boundary value of the main color change range.
  • Color matrix The end value L in which the main color change value can be preset in the program by the user according to the degree of hue change desired to be achieved.
  • the preset color matrix determining unit U605 displays the main color information through the user interface after the main color acquiring unit U604 acquires the main color of the bitmap, and sets an input box for inputting F and L on the user interface, and the user views the picture.
  • F and L are customized according to the desired effect, and input is made through the input boxes of F and L, and the preset color matrix determining unit U605 acquires F and L through the input box to complete the determination of F and L. .
  • FIG. 7 is a block diagram of still another apparatus for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application.
  • the apparatus includes an original still picture acquiring unit U701, a picture converting unit U702, and A two-color matrix calculation unit U703, an interpolation unit U704, and a rendering unit U705.
  • the original still picture obtaining unit U701 is configured to acquire an original still picture.
  • the picture conversion unit U702 is configured to convert the original still picture into a bitmap.
  • the second color matrix calculation unit U703 calculates the color matrix value of the i-th time node according to the preset color matrix initial value F, the color matrix end value L, the number of time nodes n, and the color matrix calculation rule.
  • the interpolation unit U704 is configured to generate n time nodes according to a preset time segmentation rule.
  • the drawing unit U705 is configured to filter the value of the attribute by the color matrix value of the i-th time node at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture. .
  • the main difference between the apparatus shown in FIG. 7 and the apparatus shown in FIG. 5 is that the second color matrix calculation unit U703 performs color matrix calculation by the second color matrix calculation unit U703 before the search unit U704, and then generates each by the interpolation unit U704.
  • the time node, the device shown in FIG. 5, the interpolation unit is first, and the color matrix value is calculated in real time at each time node by the first color matrix calculation unit following the generation of the interpolation unit time node.
  • the device shown in FIG. 7 calculates the color matrix values of the respective time nodes before generating the time node, so that the interpolation unit U704 generates each time node, and does not need to calculate the color matrix value again, only by the drawing unit U705.
  • the generated color matrix value corresponding to the current time node is used to set the color filter property of the brush, and then the bitmap is drawn using the brush to obtain a new image and displayed.
  • the device shown in Figure 7 can be compared to the device shown in Figure 5. In order to save computing time and resources, the interval between time nodes can also be smaller, and the program execution efficiency is higher, but the color matrix value calculated in real time in the device shown in FIG. 5 can be temporarily stored only in the current state, the device shown in FIG. The media color matrix values need to be saved in order after the calculation is completed, and the memory consumption may be large.
  • FIG. 8 is a block diagram of still another embodiment of an attribute animation-based tone change animation implementation apparatus according to an exemplary embodiment of the present application.
  • the apparatus includes an original still picture acquisition unit U801, a picture conversion unit U802, and a zoom.
  • the original still picture obtaining unit U801 is configured to acquire an original still picture.
  • the picture conversion unit U802 is configured to convert the original still picture into a bitmap.
  • the scaling unit U803 is configured to scale the bitmap according to the size of the display area.
  • the main color acquiring unit U804 is configured to acquire a main color of the original still picture, where the main color is a color with the most pixels in the original still picture.
  • the preset color matrix determining unit U805 is configured to determine a preset color matrix initial value F and a color matrix end value L according to the primary color.
  • the second color matrix calculation unit U806 is configured to calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, a number of time nodes n, and a color matrix calculation rule;
  • the interpolation unit U807 is configured to generate n time nodes according to a preset time segmentation rule.
  • the drawing unit U808 is configured to filter the value of the attribute by the color matrix value of the i-th time node at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture.
  • the primary color acquiring unit U804 may further include a pixel point counting module, a primary color deviation range determining module, and a primary color determining module (not shown).
  • the pixel point counting module is configured to classify pixel points whose color values are within a preset deviation range into pixel points of the same color, and count pixel points within each preset deviation range.
  • the primary color deviation range determining module is configured to compare pixel points within each preset deviation range The number of preset deviations with the largest number of pixels is the main color deviation range.
  • the main color determining module is configured to calculate an average value of the color values within the main color deviation range, and the color corresponding to the average value is the main color.
  • the preset color matrix determining unit U805 may further include a color matrix initial value determining module, a primary color variation range setting module, and a color matrix end value determining module (not shown).
  • the color matrix initial value determining module is configured to maintain the color matrix initial value F of the color matrix value of the original color value of the primary color.
  • the primary color variation range setting module is configured to set a primary color variation range according to a preset primary color change value by using one of F as a boundary value.
  • the color matrix end value determining module is configured to use the other boundary value of the main color variation range as the color matrix end value L.
  • an embodiment of the present invention further provides a hardware structure of a tone change animation implementing device based on attribute animation
  • FIG. 9 is a block schematic diagram of a hardware structure.
  • the apparatus 900 includes a memory 901 for storing instructions for controlling the processor 902 to operate to perform a tone change animation implementing method according to the present invention, and a processor 902.
  • the memory 901 can include high speed random access memory and can also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • the processor 902 can include, but is not limited to, a processing device such as a microprocessor MCU, a digital signal processor DSP, or a programmable logic device FPGA.
  • a processing device such as a microprocessor MCU, a digital signal processor DSP, or a programmable logic device FPGA.
  • the apparatus 900 may further include an input device 904, a communication device 906, an interface device 903, a display device 905, and the like.
  • the communication device 906 can, for example, have wired or wireless communication.
  • the interface device 903 includes, for example, a USB interface, a network port, and the like.
  • the input device 904 may include, for example, a touch screen, a button, or the like to input various information.
  • the display device 905 is, for example, a liquid crystal display, a touch display, or the like to display an attribute animation.
  • Embodiments of the present invention also provide a computer readable storage medium.
  • the foregoing storage medium may be used to save program code of the method for implementing the tone change animation provided by the present invention.
  • the computer readable storage medium can be a tangible device capable of holding and storing instructions for use by the instruction execution device.
  • the computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Non-exhaustive list of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, with instructions stored thereon A raised structure in the hole card or groove, and any suitable combination of the above.
  • a computer readable storage medium as used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (eg, a light pulse through a fiber optic cable), or through a wire The electrical signal transmitted.
  • the computer readable program instructions described herein can be downloaded from a computer readable storage medium to various computing/processing devices or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers.
  • a network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in each computing/processing device .

Abstract

Disclosed in embodiments of the present application are a method and device for implementing tone variation animation on the basis of attribute animation. The method comprises: obtaining an original static picture; converting the original static picture into a bitmap; generating n time nodes according to a preset time segment rule; calculating a color matrix value of an ith time node at the ith time node according to preset color matrix initial value F, color matrix end value L, and color matrix calculation rule; and using the color matrix value as the value of a color filtering attribute, and drawing the bitmap according to the color filtering attribute to obtain and display a new picture, wherein the i is a natural number, and i = 1, 2 … n.

Description

一种基于属性动画的色调变化动画实现方法及装置Method and device for realizing tone change animation based on attribute animation 技术领域Technical field
本发明涉及动画技术领域,尤其涉及一种基于属性动画的色调变化动画实现方法及装置。The present invention relates to the field of animation technology, and in particular, to a method and an apparatus for implementing a tone change animation based on attribute animation.
背景技术Background technique
动画是将连续渐变的静态图片的序列,沿时间轴顺次更换显示,基于人眼的视觉暂留原理而产生运动视觉感受的媒体形式。为了达到某种动画效果,需要逐帧渐进修改图片的属性比如颜色、图画元素的位置以及图画元素和背景的对比等。色调变化是一种常见的动画效果,指画面的整体颜色逐渐变化,比如天蓝色渐渐转为墨蓝色以表示天黑,或者颜色变亮或变暗表示光线的变化等。An animation is a sequence of static pictures that are continuously gradual, and the display is sequentially changed along the time axis, and a media form of motion visual perception is generated based on the principle of visual persistence of the human eye. In order to achieve some kind of animation effect, it is necessary to gradually modify the attributes of the picture such as the color, the position of the picture element, and the contrast of the picture element and the background, etc., frame by frame. Tone change is a common animation effect, which means that the overall color of the picture changes gradually. For example, the sky blue gradually turns blue to indicate darkness, or the color becomes brighter or darker to indicate changes in light.
实现色调变化需要按一定的规则改变图片像素的颜色值,使图片像素趋向于某一个色调,最常用的方式是使用底层的OpenGL来控制像素点颜色变化。OpenGL(Open Graphics Library,开放图形库)是一个跨编程语言和平台的专业图形程序接口和底层图形库,但是对于一个静态图片,基于OpenGL实现色调变化动画,需要技术员编写程序读取图片的像素值,再按照一定时间规律逐个修改图片像素点的颜色值,这样的方法程序复杂,代码编写难度高,不易实现且执行效率低。To achieve the change of color tone, it is necessary to change the color value of the picture pixel according to certain rules, so that the picture pixel tends to a certain color tone. The most common way is to use the underlying OpenGL to control the color change of the pixel. OpenGL (Open Graphics Library) is a professional graphics program interface and underlying graphics library across programming languages and platforms. However, for a static image, the implementation of tone change animation based on OpenGL requires the technician to write a program to read the pixel values of the image. Then, according to a certain time rule, the color values of the picture pixels are modified one by one. The method is complicated, the code writing is difficult, the implementation is difficult, and the execution efficiency is low.
发明内容Summary of the invention
为克服相关技术中基于属性动画的色调变化动画实现方法复杂度高、执行效率低的问题,本申请提供一种基于属性动画的色调变化动画实现方法及装置,能够简单方便地由静态图片实现色调变化动画。In order to overcome the problem of high complexity and low execution efficiency of the attribute change animation based on the attribute animation, the present application provides a method and a device for implementing the color change animation based on the attribute animation, which can be easily and conveniently implemented by the static picture. Change animation.
根据本申请实施例的第一方面,提供一种基于属性动画的色调变化动画实现方法,包括: According to a first aspect of the embodiments of the present application, a method for implementing a tone change animation based on an attribute animation is provided, including:
获取原始静态图片;Get the original still image;
将所述原始静态图片转换为位图;Converting the original still picture into a bitmap;
根据预设的时间分段规则生成n个时间节点;Generating n time nodes according to preset time segmentation rules;
在第i个时间节点,根据预设的颜色矩阵初始值F、颜色矩阵结束值L以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;以及,At the i-th time node, calculating a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule;
以所述颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示;Filtering the value of the attribute by the color matrix value, and drawing the bitmap according to the color filter attribute to obtain a new picture and displaying;
其中i为自然数,i=1,2……n。Where i is a natural number, i=1, 2...n.
结合第一方面,在第一方面第一种可能的实现方式中,所述的基于属性动画的色调变化动画实现方法,在将所述原始静态图片转换为位图之后,根据预设的时间分段规则生成n个时间节点之前,还包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, the attribute animation-based tone change animation implementation method, after converting the original still image into a bitmap, according to a preset time Before the segment rule generates n time nodes, it also includes:
根据显示区域的大小对所述位图进行缩放。The bitmap is scaled according to the size of the display area.
结合第一方面,在第一方面第二种可能的实现方式中,所述预设的时间分段规则为时间节点之间的间隔相同且小于0.1秒。With reference to the first aspect, in a second possible implementation manner of the first aspect, the preset time segmentation rule is that the interval between the time nodes is the same and less than 0.1 second.
结合第一方面,在第一方面第三种可能的实现方式中,所述颜色矩阵包括红色R分量、绿色G分量、蓝色B分量、透明度Alpha分量和占位符分量。In conjunction with the first aspect, in a third possible implementation of the first aspect, the color matrix comprises a red R component, a green G component, a blue B component, a transparency Alpha component, and a placeholder component.
结合第一方面,在第一方面第四种可能的实现方式中,所述根据预设的颜色矩阵初始值F、颜色矩阵结束值L以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值,包括:With reference to the first aspect, in a fourth possible implementation manner of the first aspect, the color matrix of the i-th time node is calculated according to the preset color matrix initial value F, the color matrix end value L, and the color matrix calculation rule Values, including:
若i=1,则以颜色矩阵初始值F为第1个时间节点的颜色矩阵值M1If i=1, the color matrix initial value F is the color matrix value M 1 of the first time node;
若i=n,则以颜色矩阵结束值L为第n个时间节点的颜色矩阵值Mn;否则,If i=n, the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
计算第i个时间节点的颜色矩阵值Mi中的第j个分量hj(Mi):Calculating the jth component h j (M i ) in the color matrix value M i of the i-th time node:
当hj(L)≥hj(F)时,hj(Mi)=hj(F)+[hj(L)-hj(F)]×i/n;When h j (L) ≥h j ( F), h j (Mi) = h j (F) + [h j (L) -h j (F)] × i / n;
当hj(L)<hj(F)时,hj(Mi)=hj(L)-[hj(F)-hj(L)]×i/n。When h j (L) < h j (F), h j (Mi) = h j (L) - [h j (F) - h j (L)] × i / n.
结合第一方面,在第一方面第五种可能的实现方式中,所述的基于属性动画的色调变化动画实现方法,在将所述原始静态图片转换为位图之后,根据预设的时间分段规则生成n个时间节点之前,还包括: With reference to the first aspect, in a fifth possible implementation manner of the first aspect, the attribute animation-based tone change animation implementation method, after converting the original still image into a bitmap, according to a preset time Before the segment rule generates n time nodes, it also includes:
获取所述原始静态图片的主色,所述主色为所述原始静态图片中像素点最多的颜色;Obtaining a primary color of the original static picture, where the primary color is a color with the most pixels in the original static picture;
根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L。A preset color matrix initial value F and a color matrix end value L are determined according to the primary color.
结合第一方面第五种可能的实现方式,在第一方面第六种可能的实现方式中,所述获取所述原始静态图片的主色,包括:With reference to the fifth possible implementation manner of the first aspect, in the sixth possible implementation manner of the first aspect, the acquiring the primary color of the original still picture includes:
将颜色值在预设偏差范围以内的像素点归为同一颜色的像素点,统计各个预设偏差范围内的像素点;Pixels whose color values are within the preset deviation range are classified into pixels of the same color, and count the pixels within each preset deviation range;
比较各个预设偏差范围以内像素点的个数,以像素点最多的预设偏差范围为主色偏差范围;Comparing the number of pixels within each preset deviation range, and the preset deviation range with the largest pixel point is the main color deviation range;
计算主色偏差范围内的颜色值的平均值,以所述平均值对应的颜色为主色。The average value of the color values in the range of the main color deviation is calculated, and the color corresponding to the average value is the main color.
结合第一方面第五种或第六种可能的实现方式,在第一方面第七种可能的实现方式中,所述根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L,包括:With reference to the fifth or sixth possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect, the determining, by the primary color, a preset color matrix initial value F and a color matrix end value L, including:
以保持主色的原颜色值的颜色矩阵值为颜色矩阵初始值F;The color matrix value of the original color value of the main color is maintained as the initial value F of the color matrix;
以F为边界值之一根据预设的主色变化值设定主色变化范围;The primary color variation range is set according to a preset primary color change value by using one of F as a boundary value;
以所述主色变化范围的另一边界值为颜色矩阵结束值L。Another boundary value of the range of the primary color variation is the color matrix end value L.
结合第一方面,在第一方面第八种可能的实现方式中,所述的基于属性动画的色调变化动画实现方法,包括:In conjunction with the first aspect, in an eighth possible implementation manner of the first aspect, the method for implementing a tone animation based on an attribute animation includes:
使用插值器根据预设的时间分段规则生成n个时间节点;Generating n time nodes according to preset time segmentation rules using an interpolator;
使用估值器计算第i个时间节点的颜色矩阵值;Using a estimator to calculate a color matrix value of the i-th time node;
所述以所述颜色矩阵值为颜色过滤属性的值,根据所述颜色过滤属性对所述位图进行绘制,包括:将画笔的颜色过滤属性的值设置为所述颜色矩阵值,并使用所述画笔对所述位图进行绘制。The value of the color filter attribute is set by the color matrix value, and the bitmap is drawn according to the color filter attribute, including: setting a value of a color filter attribute of the brush to the color matrix value, and using the The brush draws the bitmap.
根据本申请实施例的第二方面,提供另一种基于属性动画的色调变化动画实现方法,包括:According to a second aspect of the embodiments of the present application, another method for implementing a tone change animation based on an attribute animation is provided, including:
获取原始静态图片;Get the original still image;
将所述原始静态图片转换为位图;Converting the original still picture into a bitmap;
根据预设的颜色矩阵初始值F、颜色矩阵结束值L、时间节点个数n 以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;According to the preset color matrix initial value F, the color matrix end value L, the number of time nodes n And a color matrix calculation rule for calculating a color matrix value of the i-th time node;
根据预设的时间分段规则生成n个时间节点;Generating n time nodes according to preset time segmentation rules;
在第i个时间节点,以第i个时间节点的颜色矩阵值为颜色过滤属性的值,根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示;In the i-th time node, the color matrix value of the i-th time node is used as a color filter attribute value, and the bitmap is drawn according to the color filter attribute to obtain a new picture and displayed;
其中i为自然数,i=1,2……n。Where i is a natural number, i=1, 2...n.
相应于本申请实施例的第一方面,根据本申请实施例的第三方面,提供一种基于属性动画的色调变化动画实现装置,包括:Corresponding to the first aspect of the embodiments of the present application, according to the third aspect of the embodiments of the present application, an apparatus for implementing a tone change animation based on an attribute animation includes:
原始静态图片获取单元,用于获取原始静态图片;An original still picture obtaining unit, configured to acquire an original still picture;
图片转换单元,用于将所述原始静态图片转换为位图;a picture conversion unit, configured to convert the original still picture into a bitmap;
插值单元,用于根据预设的时间分段规则生成n个时间节点;An interpolation unit, configured to generate n time nodes according to a preset time segmentation rule;
第一颜色矩阵计算单元,用于在第i个时间节点,根据预设的颜色矩阵初始值F、颜色矩阵结束值L以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;a first color matrix calculation unit, configured to calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node;
绘制单元,用于在第i个时间节点,以所述颜色矩阵值为颜色过滤属性的值,根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示;a drawing unit, configured to filter a value of the attribute by the color matrix value at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display;
其中i为自然数,i=1,2……n。Where i is a natural number, i=1, 2...n.
结合第三方面,在第三方面第一种可能的实现方式中,所述的基于属性动画的色调变化动画实现装置还包括缩放单元,所述缩放单元用于:在将所述原始静态图片转换为位图之后,根据预设的时间分段规则生成n个时间节点之前,根据显示区域的大小对所述位图进行缩放。In conjunction with the third aspect, in a first possible implementation manner of the third aspect, the attribute animation-based tone change animation implementing apparatus further includes a scaling unit, configured to: convert the original still image After the bitmap is generated, the bitmap is scaled according to the size of the display area before the n time nodes are generated according to the preset time segmentation rule.
结合第三方面,在第三方面第二种可能的实现方式中,,所述预设的时间分段规则为时间节点之间的间隔相同且小于0.1秒。With reference to the third aspect, in a second possible implementation manner of the third aspect, the preset time segmentation rule is that the interval between the time nodes is the same and less than 0.1 second.
结合第三方面,在第三方面第三种可能的实现方式中,,所述颜色矩阵包括红色R分量、绿色G分量、蓝色B分量、透明度Alpha分量和占位符分量。In conjunction with the third aspect, in a third possible implementation of the third aspect, the color matrix includes a red R component, a green G component, a blue B component, a transparency Alpha component, and a placeholder component.
结合第三方面,在第三方面第四种可能的实现方式中,所述颜色矩阵计算单元,在计算第i个时间节点的颜色矩阵值时,具体用于:With reference to the third aspect, in a fourth possible implementation manner of the third aspect, the color matrix calculation unit is specifically configured to: when calculating a color matrix value of the i-th time node:
若i=1,则以颜色矩阵初始值F为第1个时间节点的颜色矩阵值M1If i=1, the color matrix initial value F is the color matrix value M 1 of the first time node;
若i=n,则以颜色矩阵结束值L为第n个时间节点的颜色矩阵值Mn;否则,If i=n, the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
计算第i个时间节点的颜色矩阵值Mi中的第j个分量hj(Mi):Calculating the jth component h j (M i ) in the color matrix value M i of the i-th time node:
当hj(L)≥hj(F)时,hj(Mi)=hj(F)+[hj(L)-hj(F)]×i/n;When h j (L) ≥h j ( F), h j (Mi) = h j (F) + [h j (L) -h j (F)] × i / n;
当hj(L)<hj(F)时,hj(Mi)=hj(L)-[hj(F)-hj(L)]×i/n。When h j (L) < h j (F), h j (Mi) = h j (L) - [h j (F) - h j (L)] × i / n.
结合第三方面,在第三方面第五种可能的实现方式中,所述的基于属性动画的色调变化动画实现装置,还包括:In conjunction with the third aspect, in a fifth possible implementation manner of the third aspect,
主色获取单元,用于在将所述原始静态图片转换为位图之后,使用插值器根据预设的时间分段规则生成n个时间节点之前,获取所述原始静态图片的主色,所述主色为所述原始静态图片中像素点最多的颜色;a main color acquiring unit, configured to acquire a main color of the original still picture before generating the n time nodes according to the preset time segmentation rule after converting the original still picture into a bitmap, The main color is the color of the pixel in the original still picture;
预设颜色矩阵确定单元,用于根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L。And a preset color matrix determining unit configured to determine a preset color matrix initial value F and a color matrix end value L according to the primary color.
结合第三方面第五种可能的实现方式,在第三方面第六种可能的实现方式中,所述主色获取单元,包括:With reference to the fifth possible implementation manner of the third aspect, in the sixth possible implementation manner of the third aspect, the primary color acquiring unit includes:
像素点统计模块,用于将颜色值在预设偏差范围以内的像素点归为同一颜色的像素点,统计各个预设偏差范围内的像素点;a pixel point counting module, configured to classify pixel points whose color values are within a preset deviation range into pixels of the same color, and count pixel points within each preset deviation range;
主色偏差范围确定模块,用于比较各个预设偏差范围以内像素点的个数,以像素点最多的预设偏差范围为主色偏差范围;The main color deviation range determining module is configured to compare the number of pixel points within each preset deviation range, and the preset deviation range with the largest pixel point is the main color deviation range;
主色确定模块,用于计算主色偏差范围内的颜色值的平均值,以所述平均值对应的颜色为主色。The main color determining module is configured to calculate an average value of the color values within the main color deviation range, and the color corresponding to the average value is the main color.
结合第三方面第五种或第六种可能的实现方式,在第三方面第七种可能的实现方式中,所述预设颜色矩阵确定单元,包括:With reference to the fifth or sixth possible implementation manner of the third aspect, in the seventh possible implementation manner of the third aspect, the preset color matrix determining unit includes:
颜色矩阵初始值确定模块,用于以保持主色的原颜色值的颜色矩阵值为颜色矩阵初始值F;a color matrix initial value determining module, configured to maintain a color matrix value of a primary color value of the primary color value as a color matrix initial value F;
主色变化范围设定模块,用于以F为边界值之一根据预设的主色变化值设定主色变化范围;a main color change range setting module, configured to set a main color change range according to a preset main color change value by using one of F as a boundary value;
颜色矩阵结束值确定模块,以所述主色变化范围的另一边界值为颜色矩阵结束值L。The color matrix end value determining module takes another boundary value of the main color variation range as a color matrix end value L.
结合第三方面,在第三方面第八种可能的实现方式中,所述插值单元, 用于使用插值器根据预设的时间分段规则生成n个时间节点;With reference to the third aspect, in an eighth possible implementation manner of the third aspect, the interpolating unit, Generating n time nodes according to preset time segmentation rules using an interpolator;
所述第一颜色矩阵计算单元,用于在第i个时间节点,根据预设的颜色矩阵初始值F、颜色矩阵结束值L以及颜色矩阵计算规则,使用估值器计算第i个时间节点的颜色矩阵值;The first color matrix calculation unit is configured to calculate an i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node. Color matrix value;
所述绘制单元,用于在第i个时间节点,将画笔的颜色过滤属性的值设置为所述颜色矩阵值,并使用所述画笔对所述位图进行绘制,得到新的图片并显示。The drawing unit is configured to set a value of a color filter attribute of the brush to the color matrix value at the i-th time node, and use the brush to draw the bitmap to obtain a new picture and display.
相应于本申请实施例的第二方面,根据本申请实施例的第四方面,提供另一种基于属性动画的色调变化动画实现装置,包括:Corresponding to the second aspect of the embodiments of the present application, according to the fourth aspect of the embodiments of the present application, another apparatus for implementing a tone change animation based on an attribute animation is provided, including:
原始静态图片获取单元,用于获取原始静态图片;An original still picture obtaining unit, configured to acquire an original still picture;
图片转换单元,用于将所述原始静态图片转换为位图;a picture conversion unit, configured to convert the original still picture into a bitmap;
第二颜色矩阵计算单元,根据预设的颜色矩阵初始值F、颜色矩阵结束值L、时间节点个数n以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;a second color matrix calculation unit calculates a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, a number of time nodes n, and a color matrix calculation rule;
插值单元,用于根据预设的时间分段规则生成n个时间节点;An interpolation unit, configured to generate n time nodes according to a preset time segmentation rule;
绘制单元,用于在第i个时间节点,以第i个时间节点的颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示;a drawing unit, configured to filter a value of the attribute by the color matrix value of the i-th time node at the i-th time node, and draw the bitmap according to the color filtering attribute to obtain a new image and display ;
其中i为自然数,i=1,2……n。Where i is a natural number, i=1, 2...n.
本申请实施例提供的技术方案,生成时间序列,并在时间序列的每个时间节点计算得到不同的颜色矩阵值、将画笔的颜色过滤属性值设置为当前时间节点的颜色矩阵值,同时使用画笔对图片进行绘制,在每个时间节点动态改变图片的整体颜色(色调),得到新图片,随着时间序列生成的新图片序列即动画图片序列。动画图片序列是沿时间序列显示的,从而在视觉上形成图片色调变化动画。相比于现有技术基于OpenGL进行复杂编程的方法不同,本申请实施例所提供的基于属性动画的色调变化动画实现方法简单易行,占用资源少,执行效率高,更利于实时在线地实现图片色调变化的动画效果。The technical solution provided by the embodiment of the present application generates a time series, and calculates different color matrix values at each time node of the time series, sets a color filter attribute value of the brush to a color matrix value of the current time node, and uses the brush at the same time. The picture is drawn, and the overall color (hue) of the picture is dynamically changed at each time node to obtain a new picture, and the new picture sequence generated along with the time series is an animated picture sequence. The animated picture sequence is displayed along a time series to visually form a picture tonal variation animation. Compared with the prior art method for performing complex programming based on OpenGL, the implementation method of the color-changing animation based on the attribute animation provided by the embodiment of the present application is simple and easy, requires less resources, has high execution efficiency, and is more conducive to real-time online implementation of the image. Animated effects of tonal changes.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释 性的,并不能限制本申请。It should be understood that the above general description and the following detailed description are merely exemplary and Sexuality does not limit this application.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it will be apparent to those skilled in the art that In other words, other drawings can be obtained based on these drawings without paying for creative labor.
图1为本申请一示例性实施例示出的一种基于属性动画的色调变化动画实现方法的流程示意图;1 is a schematic flow chart of a method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application;
图2为本申请一示例性实施例示出的另一种基于属性动画的色调变化动画实现方法的流程示意图;FIG. 2 is a schematic flowchart diagram of another method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application; FIG.
图3为本申请一示例性实施例示出的又一种基于属性动画的色调变化动画实现方法的流程示意图;FIG. 3 is a schematic flowchart diagram of still another method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application;
图4为本申请一示例性实施例示出的又一种基于属性动画的色调变化动画实现方法的流程示意图;FIG. 4 is a schematic flowchart diagram of still another method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application;
图5为本申请一示例性实施例示出的一种基于属性动画的色调变化动画实现装置的框图;FIG. 5 is a block diagram of an attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application;
图6为本申请一示例性实施例示出的另一种基于属性动画的色调变化动画实现装置的框图;FIG. 6 is a block diagram of another attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application;
图7为本申请一示例性实施例示出的又一种基于属性动画的色调变化动画实现装置的框图;FIG. 7 is a block diagram of still another apparatus for implementing tone change animation based on attribute animation according to an exemplary embodiment of the present application; FIG.
图8为本申请一示例性实施例示出的又一种基于属性动画的色调变化动画实现装置的框图;FIG. 8 is a block diagram of still another attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application; FIG.
图9为本申请一示例性实施例示出的一种基于属性动画的色调变化动画实现装置的硬件结构的框图。FIG. 9 is a block diagram showing a hardware structure of an attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相 似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in the different figures represent the same or Similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with aspects of the present application as detailed in the appended claims.
为了全面理解本申请,在以下详细描述中提到了众多具体的细节,但是本领域技术人员应该理解,本申请可以无需这些具体细节而实现。在其他实施例中,不详细描述公知的方法、过程、组件和电路,以免不必要地导致实施例模糊。In order to fully understand the present invention, numerous specific details are described in the following detailed description, but those skilled in the art will understand that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits are not described in detail to avoid unnecessarily obscuring the embodiments.
为更好地理解本申请,对本申请所涉及的概念做简单介绍如下。属性动画是一种动画制作中对值进行操作的机制,通过将值赋给对象的指定属性来得到动画效果,其中对象可以是任意对象,属性可以是对象的任意属性。时间插值器(为方便描述,以下简称插值器)和估值器是属性动画中两个重要的工具,插值器本质是时间的函数,定义了动画在时间上的变化规律;估值器定义了属性值的计算方式,有int、float和color等类型,主要根据属性的开始值、结束值和插值一起计算出各个时间点的属性值。在属性动画实现过程中,插值器和估值器通常会联合使用,插值器生成时间序列,估值器根据时间序列顺序计算每个时刻属性的值。插值器和估值器都可以由用户自定义以实现更丰富的动画效果。For a better understanding of the present application, the concepts involved in this application are briefly described as follows. Attribute animation is a mechanism for manipulating values in animation. Animating effects by assigning values to specified properties of the object, where the object can be any object, and the property can be any property of the object. The time interpolator (for convenience of description, hereinafter referred to as the interpolator) and the estimator are two important tools in the property animation. The interpolator is essentially a function of time, which defines the variation of the animation over time; the estimator defines The attribute value is calculated by the types of int, float, and color. The attribute values of each time point are calculated based on the start value, end value, and interpolation of the attribute. In the property animation implementation, the interpolator and the estimator are usually used together. The interpolator generates a time series, and the estimator calculates the value of each time attribute according to the time series order. Both the interpolator and the estimator can be customized by the user for richer animations.
位图(Bitmap,BMP文件格式)是一种广泛使用的图像文件格式,由于位图可以不作任何变化地保存图像像素域的数据,因此成为取得RAW数据(原始数据)的重要来源。画笔是属性动画中的绘制工具,可以根据设置的属性对图片进行绘制。颜色过滤,指整体改变图片的颜色,仿佛对图片的颜色进行了过滤一样,故称之为颜色过滤。Bitmap (BMP file format) is a widely used image file format. Since bitmaps can save data of image pixel fields without any change, they are an important source for obtaining RAW data (raw data). A brush is a drawing tool in a property animation that draws a picture based on its properties. Color filtering refers to the overall change of the color of the picture, as if the color of the picture has been filtered, so it is called color filtering.
图1为本申请一示例性实施例示出的一种基于属性动画的色调变化动画实现方法的流程示意图,如图1所示,所述方法包括:FIG. 1 is a schematic flowchart of a method for implementing a tone change animation based on an attribute animation according to an exemplary embodiment of the present application. As shown in FIG. 1 , the method includes:
步骤S101,获取原始静态图片。Step S101: Acquire an original still picture.
该原始静态图片可以预存于某个文件或数据库中,使用系统的图片读取函数来读取,原始静态图片也可以为某个动画或者视频的某一帧,使用帧抓取函数来获取。原始静态图片可以为单独的图片,也可以是合成动画中的背景图片。 The original static image can be pre-stored in a file or database, and can be read using the system's image reading function. The original static image can also be obtained by using a frame grab function for a certain frame of an animation or video. The original still image can be a separate image or a background image in a composite animation.
步骤S102,将所述原始静态图片转换为位图。Step S102, converting the original still picture into a bitmap.
获取到原始静态图片后,将原始静态图片进行格式转换,得到位图,后续便能够以该位图作为Bitmap对象,从该Bitmap对象中读取图片的像素数据来进行相关计算。After obtaining the original static image, the original static image is format converted to obtain a bitmap, and then the bitmap can be used as a Bitmap object, and the pixel data of the image is read from the Bitmap object to perform related calculation.
步骤S103,根据预设的时间分段规则生成n个时间节点,其中,n为正整数。Step S103, generating n time nodes according to a preset time segmentation rule, where n is a positive integer.
在属性动画中,可以使用插值器生成n个时间节点,所有时间节点组成一个时间序列,因此,该步骤S103也可以具体为通过插值器生成包含n个时间节点的时间序列。In the attribute animation, the interpolators can be used to generate n time nodes, and all the time nodes form a time series. Therefore, the step S103 can also specifically generate a time series including n time nodes by using an interpolator.
所述时间序列决定了生成的图片序列的显示频率,每个时间节点生成的图片沿着时间序列依次显示,形成动画效果,因此时间节点之间的时间间隔需满足视觉暂留效果的要求。例如,可以将时间间隔设置在0.4s以下。优选的是,可以将时间间隔进一步设置在0.1s以下,以获得更为平滑的动画效果。The time series determines the display frequency of the generated picture sequence, and the pictures generated by each time node are sequentially displayed along the time series to form an animation effect, so the time interval between the time nodes needs to meet the requirements of the visual persistence effect. For example, the time interval can be set below 0.4s. Preferably, the time interval can be further set below 0.1 s for a smoother animation.
所述预设的时间分段规则可以为线性也可以为非线性,线性指时间节点之间的时间间隔相等,非线性指时间节点之间的时间间隔可以不相等,非线性可以为多种形式例如呈抛物线增加或减少。按线性的时间分段规则得到的时间序列显示的动画平稳渐进,比较符合人的视觉习惯。而按非线性的时间分段规则得到的时间序列显示的动画可以制造闪烁等视觉效果。The preset time segmentation rule may be linear or non-linear, linear means that time intervals between time nodes are equal, non-linear means that time intervals between time nodes may be unequal, and non-linearity may be in multiple forms. For example, the parabola increases or decreases. The time series displayed by the linear time segmentation rule shows an animation that is smooth and gradual, and is more in line with human visual habits. The animations displayed in time series obtained by nonlinear time segmentation rules can produce visual effects such as flicker.
步骤S104,在第i个时间节点,根据预设的颜色矩阵初始值F、颜色矩阵结束值L、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值。Step S104, at the i-th time node, calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule.
步骤S105,在第i个时间节点,以所述颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示。Step S105: At the i-th time node, filter the value of the attribute with the color matrix value, and draw the bitmap according to the color filter attribute to obtain a new picture and display it.
以上i为自然数,i=1,2……n。The above i is a natural number, i=1, 2...n.
在插值器每生成一个时间节点时,计算该时间节点对应的颜色矩阵值,在属性动画中,可以使用估值器计算该时间节点对应的颜色矩阵值。Each time the interpolator generates a time node, the color matrix value corresponding to the time node is calculated. In the attribute animation, the evaluator may be used to calculate the color matrix value corresponding to the time node.
图片像素的颜色都包含有红色R分量、绿色G分量、蓝色B分量和透明度Alpha分量这四个分量,颜色矩阵则将每个分量作为矩阵的一行,按R、G、B、A(Alpha,简写为A)的顺序排列,每行默认分为5列,也 就是以4×5的矩阵来表示颜色矩阵,颜色矩阵规范式为:The color of the picture pixel contains four components: the red R component, the green G component, the blue B component, and the transparency Alpha component. The color matrix uses each component as a row of the matrix, and presses R, G, B, and A (Alpha). , abbreviated as A) in order, each line is divided into 5 columns by default, also The color matrix is represented by a 4×5 matrix, and the color matrix specification is:
Figure PCTCN2017083033-appb-000001
Figure PCTCN2017083033-appb-000001
其中,V为偏移量。例如:Where V is the offset. E.g:
Figure PCTCN2017083033-appb-000002
Figure PCTCN2017083033-appb-000002
F为颜色矩阵。像素颜色计算公式为:F is the color matrix. The pixel color calculation formula is:
r=R*m11+G*m12+B*m13+A*m14+m15*255;r=R*m11+G*m12+B*m13+A*m14+m15*255;
g=R*m21+G*m22+B*m23+A*m24+m25*255;g=R*m21+G*m22+B*m23+A*m24+m25*255;
b=R*m31+G*m32+B*m33+A*m34+m35*255;b=R*m31+G*m32+B*m33+A*m34+m35*255;
a=R*m41+G*m42+B*m43+A*m44+m45*255。a=R*m41+G*m42+B*m43+A*m44+m45*255.
其中,大写的R、G、B和A为经颜色矩阵计算前的原颜色分量值,小写的r、g、b和a为计算后的颜色分量值。颜色矩阵中的元素通常在0和1之间取值,0表示none,也就是颜色不可见,1表示保持原值,用户也可以根据图片的情况和计算的需要自定义元素的取值范围,也就是不限定于在0和1之间取值。通过将颜色矩阵值与像素的原颜色分量值进行计算,可以改变像素的颜色,将颜色矩阵值与图片中的所有像素的原颜色分量值进行计算,可以一致地改变图片中所有像素的颜色,从而能够整体上改变图片的色调。Wherein, uppercase R, G, B, and A are original color component values before being calculated by the color matrix, and lowercase r, g, b, and a are calculated color component values. The elements in the color matrix usually take values between 0 and 1, 0 means none, that is, the color is not visible, 1 means to keep the original value, and the user can customize the value range of the element according to the situation of the picture and the needs of the calculation. That is, it is not limited to taking a value between 0 and 1. By calculating the color matrix value and the original color component value of the pixel, the color of the pixel can be changed, and the color matrix value and the original color component value of all the pixels in the image are calculated, and the colors of all the pixels in the image can be uniformly changed. Thereby, the hue of the picture can be changed as a whole.
较常用的颜色矩阵为4×5的矩阵,为使计算更为方便,在颜色矩阵中引入占位符分量,以占位符分量为第5行,构成5×5的对称矩阵,对称矩阵更方便计算,而且占位符分量有利于引入另外的偏移量,使颜色矩阵对像素颜色的控制更为灵活。The more commonly used color matrix is a 4×5 matrix. To make the calculation more convenient, a placeholder component is introduced into the color matrix, and the placeholder component is the fifth row, which constitutes a 5×5 symmetric matrix, and the symmetric matrix is more Convenient for calculation, and the placeholder component facilitates the introduction of additional offsets, making the color matrix more flexible for pixel color control.
本申请的目的在于跟随插值器生成的时间序列渐进地修改图片的颜 色,因此每个时间节点都要计算得到新的颜色矩阵以改变图片像素的颜色值,也就是要得到一个与时间序列对应的颜色矩阵序列。为计算得到颜色矩阵序列,可以使用内插法,预设一个颜色矩阵初始值F和颜色矩阵结束值L,然后插值得到中间一系列的值。F和L由用户根据图片原本的色调和希望达到的最终色调来设定,所述颜色矩阵计算规则由用户根据希望达到的色调变化动画的中间效果来设定,颜色矩阵计算规则可以为线性也可以为非线性,线性颜色矩阵计算规则使颜色矩阵线性变化,非线性颜色矩阵计算规则使颜色矩阵非线性变化。颜色矩阵线性变化指颜色矩阵中的每个分量的值按线性规律变化,例如按等差规律变化,颜色矩阵非线性变化则指颜色矩阵中的每个分量的值按非线性规律变化,例如按等比规律变化。在线性变化的颜色矩阵序列作用下,图片色调均匀变换,动画效果匀速渐进,视觉上较为平缓,非线性变化的颜色矩阵序列作用下,图片色调变换不均匀,动画效果存在突变,视觉上较有冲击感,但割裂感也较强。The purpose of the present application is to progressively modify the color of the picture following the time series generated by the interpolator. Color, so each time node calculates a new color matrix to change the color value of the picture pixel, that is, to obtain a sequence of color matrices corresponding to the time series. To calculate the color matrix sequence, an interpolation method can be used to preset a color matrix initial value F and a color matrix end value L, and then interpolate to obtain a series of intermediate values. F and L are set by the user according to the original hue of the picture and the desired final hue, which is set by the user according to the intermediate effect of the desired hue change animation, and the color matrix calculation rule can be linear as well. It can be nonlinear, linear color matrix calculation rules make the color matrix linearly change, and the nonlinear color matrix calculation rule makes the color matrix nonlinear. The linear change of the color matrix means that the value of each component in the color matrix changes according to a linear law, for example, according to the law of equal variation, and the nonlinear change of the color matrix means that the value of each component in the color matrix changes according to a nonlinear law, for example, The law of proportional changes. Under the action of linearly changing color matrix sequence, the picture is evenly transformed, the animation effect is gradual and gradual, and the visually gradual, non-linearly changing color matrix sequence, the image tonal transformation is uneven, the animation effect is abrupt, visually more A sense of impact, but a strong sense of splitting.
在一种可能的实施方式中,线性计算颜色矩阵序列,可以包括:In a possible implementation manner, linearly calculating a sequence of color matrices may include:
若i=1,则以颜色矩阵初始值F为第1个时间节点的颜色矩阵值M1If i=1, the color matrix initial value F is the color matrix value M 1 of the first time node;
若i=n,则以颜色矩阵结束值L为第n个时间节点的颜色矩阵值Mn;否则,If i=n, the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
对于第i个时间节点的颜色矩阵值Mi中的第j个分量hj(Mi):For the jth component h j (M i ) in the color matrix value M i of the i-th time node:
当hj(L)≥hj(F)时,hj(Mi)=hj(F)+[hj(L)-hj(F)]×i/n;When h j (L) ≥h j ( F), h j (Mi) = h j (F) + [h j (L) -h j (F)] × i / n;
当hj(L)<hj(F)时,hj(Mi)=hj(L)-[hj(F)-hj(L)]×i/n。When h j (L) < h j (F), h j (Mi) = h j (L) - [h j (F) - h j (L)] × i / n.
在插值器生成第1个时间节点时,以F为第1个颜色矩阵,在生成第n个时间节点时,以L为第n个颜色矩阵,这中间,对于第i个时间节点,以第1个颜色矩阵(即F)为基础,逐步按线性规律计算第i个颜色矩阵,具体地,将第i个颜色矩阵M1的每个分量线性递增或线性递减,对于颜色矩阵的第j个分量,当hj(L)≥hj(F),也就是L中第j个分量的值大于或等于F中第j个分量的值时,第i个颜色矩阵的第j个分量hj(Mi)=hj(F)+[hj(L)-hj(F)]×i/n,hj(Mi)依次递增,其中hj(L)=hj(F)相当于分量没有变化,该分量的各个中间值也就保持不变;当hj(L)<hj(F),也就是L中第j个分量的值小于F中第j个分量的值时,第i个颜色矩阵的第j 个分量hj(Mi)=hj(L)-[hj(F)-hj(L)]×i/n依次递减。这种实施方式中,颜色矩阵序列中颜色矩阵的分量线性递增或递减,计算方法简单,动画效果渐进平稳,占用计算资源也少。When the interpolator generates the first time node, F is the first color matrix, and when the nth time node is generated, L is the nth color matrix, and for the ith time node, Based on a color matrix (ie, F), the i-th color matrix is calculated step by step according to a linear rule. Specifically, each component of the i-th color matrix M 1 is linearly incremented or linearly decremented, for the jth color matrix. component, when h j (L) ≥h j ( F), i.e. the value of L j-th component is greater than or equal to the value of the j-th component of F in the j-th component of the i-th color matrix H j (Mi)=h j (F)+[h j (L)-h j (F)]×i/n, h j (Mi) are sequentially incremented, where h j (L)=h j (F) is equivalent The component has no change, and the respective intermediate values of the component remain unchanged; when h j (L) < h j (F), that is, the value of the jth component in L is smaller than the value of the jth component in F, The jth component h j (Mi) = h j (L) - [h j (F) - h j (L)] × i / n of the i-th color matrix is successively decremented. In this embodiment, the components of the color matrix in the color matrix sequence are linearly incremented or decremented, the calculation method is simple, the animation effect is gradually stable, and the computational resources are also small.
颜色矩阵计算规则也可以为非线性的,例如使颜色矩阵的分量等比变化,也可以根据特效要求设计其他计算规则例如正弦变化规则,也可以不依据数学规则而在设定的范围内随机为颜色矩阵中的分量赋值,设定的范围由颜色矩阵初始值和颜色矩阵结束值决定。例如,希望让绿色植物图的绿色变深,可以将颜色矩阵中的G分量从初始值开始增加,每次增加多少可以随机指定,不超过最终值即可,例如:以下颜色矩阵F在增加G分量后成为以下颜色矩阵M1The color matrix calculation rule may also be non-linear, for example, changing the components of the color matrix, or designing other calculation rules such as sine variation rules according to special effects requirements, or randomly within a set range according to mathematical rules. The component values in the color matrix are set by the initial value of the color matrix and the end value of the color matrix. For example, if you want to make the green of the green plant map darker, you can increase the G component in the color matrix from the initial value. Each time you increase it, you can specify it randomly, and do not exceed the final value. For example, the following color matrix F is increasing G. The component becomes the following color matrix M 1 .
Figure PCTCN2017083033-appb-000003
Figure PCTCN2017083033-appb-000003
在第i个时间节点,得到第i个颜色矩阵后,将画笔(paint)的颜色过滤属性的值设置为第i个颜色矩阵值,使用所述画笔对所述位图进行绘制,得到第i个新图片。生成的所有新图片构成动画图片序列,沿时间序列显示而实现色调变化动画。其中,画笔为图片绘制工具,本申请中画笔对图片进行绘制即画笔将颜色矩阵和图片像素的颜色矩阵进行计算,改变图片像素的颜色值,从而改变图片的颜色,颜色矩阵值则作为画笔的颜色过滤属性的值由画笔在绘制时调用。具体地,画笔在绘制时可以调用绘制函数例如Android系统中的Ondraw函数来完成新图片的绘制,更新原图片像素。After the i-th time matrix is obtained, the value of the color filter attribute of the paint is set to the i-th color matrix value, and the bitmap is drawn using the brush to obtain the i-th New pictures. All the new images generated form a sequence of animated images, and the hue change animation is implemented along the time series display. Among them, the brush is a picture drawing tool. In this application, the brush draws the picture, that is, the brush calculates the color matrix and the color matrix of the picture pixel, changes the color value of the picture pixel, thereby changing the color of the picture, and the color matrix value is used as a brush. The value of the color filter property is called by the brush when it is drawn. Specifically, the brush can call a drawing function such as an Ondraw function in the Android system to complete the drawing of the new picture and update the original picture pixel.
本申请所提供的基于属性动画的色调变化动画实现方法,与通常使用OpenGL进行复杂编程实现的方法不同,只需在时间序列的每个时间节点生成不同的颜色矩阵,使用颜色矩阵改变颜色过滤属性,根据颜色过滤属性对图片进行绘制,从而在每个时间节点动态改变图片的整体颜色(色调),得到图片色调变化动画,本申请所提供的方法简单易行,占用资源少,执行效率高,更利于实时在线地实现图片色调变化的动画效果。另外,需要 说明的是,按照本申请所提供的方法生成的图片色调变化动画,不仅可以单独显示,也可以和其他动画例如图片元素位置变化动画叠加在一起形成更丰富的动画效果。The attribute animation-based tone change animation implementation method provided by the present application is different from the method commonly used in OpenGL for complex programming, and only needs to generate different color matrices in each time node of the time series, and use the color matrix to change the color filter attribute. According to the color filter attribute, the picture is drawn, so that the overall color (hue) of the picture is dynamically changed at each time node, and the picture color change animation is obtained. The method provided by the present application is simple and easy, takes less resources, and has high execution efficiency. It is more conducive to realizing the animation effect of the picture color change in real time online. In addition, need It is noted that the picture tonal variation animation generated according to the method provided by the present application can be displayed not only separately, but also superimposed with other animations such as picture element position change animations to form a richer animation effect.
本申请所提供的基于属性动画的色调变化动画实现方法,可以应用于具有属性动画的系统,包括但不限于Android(安卓)和iOS(苹果移动系统)等。The attribute animation-based tone change animation implementation method provided by the present application can be applied to a system with attribute animation, including but not limited to Android (Android) and iOS (Apple Mobile System).
图2为本申请一示例性实施例示出的另一种基于属性动画的色调变化动画实现方法的流程示意图,如图2所示,所述方法包括:FIG. 2 is a schematic flowchart diagram of another method for implementing a tone animation based on attribute animation according to an exemplary embodiment of the present application. As shown in FIG. 2, the method includes:
步骤S201,获取原始静态图片。Step S201: Acquire an original still picture.
步骤S201,将所述原始静态图片转换为位图。Step S201, converting the original still picture into a bitmap.
步骤S203,根据显示区域的大小对所述位图进行缩放。Step S203, the bitmap is scaled according to the size of the display area.
其中,步骤S201至步骤S202与步骤S101至步骤S102相同。在将静态图片转为位图后,为更准确地获取位图像素,防止像素缺失(图片大于显示区域时),以及消除边框的影响(图片小于显示区域时在图片周围可能会出现边框),对所述位图进行缩放以使位图与显示区域的大小一致。通常在图像处理程序中,图片为View(视图)中的一个对象,为更方便地对图片进行缩放等处理,可以使图片的View继承于包含缩放功能函数的父视图,例如安卓系统中的ImageView,将包含位图的View继承于ImageView,可以方便地调用父视图中的缩放功能函数对位图进行缩放,使位图和显示区域一致。The steps S201 to S202 are the same as the steps S101 to S102. After converting a still image into a bitmap, in order to obtain bitmap pixels more accurately, prevent missing pixels (when the image is larger than the display area), and eliminate the influence of the border (the border may appear around the image when the image is smaller than the display area), The bitmap is scaled to match the size of the bitmap to the display area. Usually in an image processing program, an image is an object in a View. To make it easier to scale the image, you can make the View of the image inherit from the parent view containing the zoom function, such as ImageView in Android. The View containing the bitmap is inherited from the ImageView. You can easily call the zoom function in the parent view to scale the bitmap so that the bitmap and the display area are consistent.
步骤S204,获取所述原始静态图片的主色,所述主色为所述原始静态图片中像素点最多的颜色。Step S204: Acquire a main color of the original still picture, where the main color is a color with the most pixels in the original still picture.
步骤S205,根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L。Step S205, determining a preset color matrix initial value F and a color matrix end value L according to the primary color.
图片的色调通常由图片的主要颜色决定,图片的主色发生变化在视觉上也会形成色调变化的效果,在有些应用场景下,需要从图片本来具有的主色基调出发来设计动画效果,比如图片中有多种颜色区别较大的色块例如红色块、蓝色块和绿色块,由于色块颜色区别较大,难以直接确定整体色调变化的起始颜色值和结束颜色值,这种情况下便可以先获取图片的主 色,从主色出发改变图片的色调。主色即图片中像素点最多的颜色,在得到原始静态图片的位图后,读取位图的像素数据,根据像素数据统计同颜色值的像素点,哪种颜色值的像素点最多,则该颜色值对应的颜色为主色。由于像素点的颜色值与标准颜色值之间可能存在误差,因此也可以将颜色值在预设的偏差范围内的像素点归为同一颜色,然后统计各个偏差范围内的像素点,比较各个偏差范围内的像素点的个数,以像素点最多的偏差范围为主色偏差范围,然后取该主色偏差范围内的颜色值的平均值,以该平均值对应的颜色为主色。所述偏差范围可以根据图片颜色分布情况确定,如果图片色块颜色差别较大,则偏差范围可以预设得较小,以使颜色归类更精确,若色块很多,色块颜色差别较小或者有大有小,则可以将偏差范围预设得较大,以方便得到主色。The hue of a picture is usually determined by the main color of the picture. The change of the main color of the picture will also form a hue change effect visually. In some application scenarios, it is necessary to design an animation effect based on the main color tone of the picture. In the picture, there are a plurality of color blocks having different colors, such as a red block, a blue block, and a green block. Since the color difference of the color blocks is large, it is difficult to directly determine the initial color value and the end color value of the overall color tone change. Underneath, you can get the main picture first. Color, change the hue of the picture from the main color. The main color is the color with the most pixels in the picture. After obtaining the bitmap of the original still picture, the pixel data of the bitmap is read, and the pixel points of the same color value are counted according to the pixel data, and which color value has the most pixel points, then The color corresponding to the color value is the main color. Since there may be an error between the color value of the pixel and the standard color value, it is also possible to classify the pixel points whose color values are within the preset deviation range into the same color, and then count the pixel points within the respective deviation ranges, and compare the deviations. The number of pixels in the range, the deviation range of the pixel point is the main color deviation range, and then the average value of the color values in the main color deviation range is taken, and the color corresponding to the average value is the main color. The deviation range may be determined according to the color distribution of the picture. If the color difference of the picture color block is large, the deviation range may be preset to be smaller, so that the color classification is more accurate. If there are many color blocks, the color difference of the color block is small. Or if there are large or small, you can preset the deviation range to be larger to facilitate the main color.
在获取到位图的主色后,可以以保持主色的原颜色值的颜色矩阵值为颜色矩阵初始值F,具体地,若得到的主色与图片中最大色块的颜色值相同,则F为单位矩阵即可,若得到的主色如前面所述是根据主色偏差范围内的颜色值的平均值得到的,则主色的颜色值可能与图片色块的实际颜色值存在数学计算上的偏差,这种情况下,取最大色块的某一像素点的颜色值,以能够将该颜色值改变为主色颜色值的颜色矩阵为F。确定F后,再以F为边界值之一根据预设的主色变化值设定主色变化范围,以主色变化范围的另一边界值为颜色矩阵结束值L,其中主色变化值可以由用户根据期望达到的色调变化程度在程序中预先设定,主色变化值即主色变化范围两个边界值之差的绝对值。或者,系统在获取到位图的主色后,通过用户界面显示主色信息,并在用户界面上设置用于输入F和L的输入框,用户在查看图片的主色信息后,根据期望的效果自定义F和L,并通过F和L的输入框进行输入,系统通过所述输入框获取F和L,完成F和L的确定。After obtaining the main color of the bitmap, the color matrix value of the original color value of the main color may be the initial value F of the color matrix. Specifically, if the main color obtained is the same as the color value of the largest color patch in the image, then F It can be a unit matrix. If the obtained main color is obtained according to the average value of the color values within the main color deviation range, the color value of the main color may be mathematically calculated with the actual color value of the picture color block. The deviation, in this case, takes the color value of a certain pixel of the largest color patch, so that the color matrix capable of changing the color value to the primary color value is F. After determining F, the main color change range is set according to the preset main color change value by one of F as the boundary value, and the other boundary value of the main color change range is the color matrix end value L, wherein the main color change value can be The absolute value of the difference between the two boundary values of the main color change range, which is set by the user according to the desired degree of change in hue, is set in the program. Alternatively, after acquiring the main color of the bitmap, the system displays the main color information through the user interface, and sets an input box for inputting F and L on the user interface, and the user selects the main color information of the image according to the desired effect. Customize F and L, and input through the input boxes of F and L. The system obtains F and L through the input box to complete the determination of F and L.
步骤S206,根据预设的时间分段规则生成n个时间节点。Step S206, generating n time nodes according to a preset time segmentation rule.
步骤S207,在第i个时间节点,根据预设的颜色矩阵初始值F、颜色矩阵结束值L、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值。Step S207, at the i-th time node, calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule.
步骤S208,以所述颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示; Step S208, filtering the value of the attribute with the color matrix value, and drawing the bitmap according to the color filter attribute to obtain a new picture and displaying it;
其中i为自然数,i=1,2……n。Where i is a natural number, i=1, 2...n.
其中,步骤S206至步骤S208与步骤S103至步骤S105相同。本实施例所提供的基于属性动画的色调变化动画实现方法,在得到位图后,根据显示区域的大小对位图进行缩放,以防止像素缺失以及消除边框的影响,从而更精确地得到图片的像素数据,并且本实施例所提供的方法先获取图片的主色,基于主色确定颜色矩阵初始值和颜色矩阵结束值,可以更方便地实现多色块图片的色调变化动画效果。Among them, steps S206 to S208 are the same as steps S103 to S105. The method for realizing the tone change animation based on the attribute animation provided by the embodiment, after obtaining the bitmap, scaling the bitmap according to the size of the display area, to prevent the pixel from being missing and eliminating the influence of the frame, thereby obtaining the picture more accurately. Pixel data, and the method provided by the embodiment first acquires the main color of the picture, and determines the color matrix initial value and the color matrix end value based on the main color, so that the hue change animation effect of the multi-color block picture can be more conveniently realized.
图3为本申请一示例性实施例示出的又一种基于属性动画的色调变化动画实现方法的流程示意图,如图3所示,所述方法包括:FIG. 3 is a schematic flowchart diagram of still another method for implementing a tone change animation based on an attribute animation according to an exemplary embodiment of the present application. As shown in FIG. 3, the method includes:
步骤S301,获取原始静态图片。Step S301, acquiring an original still picture.
步骤S302,将所述原始静态图片转换为位图。Step S302, converting the original still picture into a bitmap.
步骤S303,根据预设的颜色矩阵初始值F、颜色矩阵结束值L、时间节点个数n、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值。Step S303, calculating a color matrix value of the i-th time node according to the preset color matrix initial value F, the color matrix end value L, the number of time nodes n, and the color matrix calculation rule.
步骤S304,根据预设的时间分段规则生成n个时间节点。Step S304, generating n time nodes according to a preset time segmentation rule.
步骤S305,在第i个时间节点,以第i个时间节点的颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示。Step S305, in the i-th time node, filter the value of the attribute with the color matrix value of the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display.
以上i为自然数,i=1,2……n。The above i is a natural number, i=1, 2...n.
图3所示实施例与图1所示实施例的主要区别在于,图1所示实施例是在每个时间节点实时计算颜色矩阵值,而图3所示实施例是在生成时间节点之前先将各个时间节点的颜色矩阵值计算好,然后使用插值器生成时间节点,在生成每个时间节点的同时,不必再计算颜色矩阵值,只需根据已生成的对应于当前时间节点的颜色矩阵值来设置颜色过滤属性的值,具体地,在第i个时间节点,将画笔的颜色过滤属性设置为已生成的第i个颜色矩阵值,再使用画笔对位图进行绘制。本实施例由于先计算颜色矩阵值,因此时间序列生成过程及动画图片序列生成过程中不需耗费计算时间和资源,相比图1所示的方法,时间序列中时间节点之间的间隔可以更小,程序执行效率更高,不过图3所示的方法中颜色矩阵值在计算完毕后需依次保存,而图1中实时计算得到的颜色矩阵值可以只在当前暂存,内存消耗 可以较少。The main difference between the embodiment shown in FIG. 3 and the embodiment shown in FIG. 1 is that the embodiment shown in FIG. 1 calculates the color matrix value in real time at each time node, and the embodiment shown in FIG. 3 is before the time node is generated. Calculate the color matrix values of each time node, and then use the interpolator to generate the time node. After generating each time node, it is no longer necessary to calculate the color matrix value, just according to the generated color matrix value corresponding to the current time node. To set the value of the color filter attribute, specifically, at the i-th time node, set the color filter property of the brush to the generated i-th color matrix value, and then use the brush to draw the bitmap. In this embodiment, since the color matrix value is calculated first, the time series generation process and the animation picture sequence generation process do not need to calculate the calculation time and resources. Compared with the method shown in FIG. 1, the interval between the time nodes in the time series may be more Small, the program execution efficiency is higher, but the color matrix values in the method shown in Figure 3 need to be saved in order after the calculation, and the color matrix value calculated in real time in Figure 1 can only be temporarily stored, memory consumption. Can be less.
图4为本申请一示例性实施例示出的又一种基于属性动画的色调变化动画实现方法的流程示意图,如图4所示,所述方法包括:FIG. 4 is a schematic flowchart diagram of still another method for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application. As shown in FIG. 4, the method includes:
步骤S401,获取原始静态图片。Step S401, obtaining an original still picture.
步骤S402,将所述原始静态图片转换为位图。Step S402, converting the original still picture into a bitmap.
步骤S403,根据显示区域的大小对所述位图进行缩放。Step S403, the bitmap is scaled according to the size of the display area.
步骤S404,获取所述原始静态图片的主色,所述主色为所述原始静态图片中像素点最多的颜色。Step S404: Acquire a main color of the original still picture, where the main color is a color with the most pixels in the original still picture.
步骤S405,根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L。Step S405, determining a preset color matrix initial value F and a color matrix end value L according to the primary color.
步骤S406,根据预设的颜色矩阵初始值F、颜色矩阵结束值L、时间节点个数n、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;Step S406, calculating a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, a number of time nodes n, and a color matrix calculation rule;
步骤S407,根据预设的时间分段规则生成n个时间节点。Step S407, generating n time nodes according to a preset time segmentation rule.
步骤S408,在第i个时间节点,以第i个时间节点的颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示。Step S408: In the i-th time node, filter the value of the attribute by the color matrix value of the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display it.
以上i为自然数,i=1,2……n。The above i is a natural number, i=1, 2...n.
以上步骤S401至步骤S402与步骤S301至步骤S302相同,步骤S403至步骤S405与步骤S203至步骤S205相同,步骤S406至步骤S408与步骤S303至步骤S305相同。在本申请中,步骤S403与步骤S404至S405可以同时加入到图1和图3所示的基于属性动画的色调变化动画实现方法中,也可以只加入步骤S403,或者只加入步骤S404和S405。The above steps S401 to S402 are the same as steps S301 to S302, and steps S403 to S405 are the same as steps S203 to S205, and steps S406 to S408 are the same as steps S303 to S305. In the present application, step S403 and steps S404 to S405 may be simultaneously added to the attribute animation-based tone change animation implementation method shown in FIGS. 1 and 3, or only step S403 may be added, or only steps S404 and S405 may be added.
通过以上的方法实施例的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,并存储在一个存储介质中,包括若干指令用以使得一台智能设备执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:只读存储器(ROM)、随机存取存储器(RAM)、磁碟或者光盘等 各种可以存储数据和程序代码的介质。Through the description of the above method embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product and stored in a storage medium, including a plurality of instructions for making a smart device. All or part of the steps of the method described in the various embodiments of the present application are performed. The foregoing storage medium includes: a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. A variety of media that can store data and program code.
图5为本申请一示例性实施例示出的一种基于属性动画的色调变化动画实现装置的框图,如图5所示,所述装置包括原始静态图片获取单元U501、图片转换单元U502、插值单元U503、第一颜色矩阵计算单元U504、及绘制单元U505。FIG. 5 is a block diagram of an attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application. As shown in FIG. 5, the apparatus includes an original still picture acquiring unit U501, a picture converting unit U502, and an interpolation unit. U503, a first color matrix calculation unit U504, and a rendering unit U505.
该原始静态图片获取单元U501用于获取原始静态图片。The original still picture obtaining unit U501 is configured to acquire an original still picture.
该图片转换单元U502用于将所述原始静态图片转换为位图。The picture conversion unit U502 is configured to convert the original still picture into a bitmap.
该插值单元U503用于根据预设的时间分段规则生成n个时间节点。The interpolation unit U503 is configured to generate n time nodes according to a preset time segmentation rule.
该第一颜色矩阵计算单元U504用于在第i个时间节点,根据预设的颜色矩阵初始值F、颜色矩阵结束值L、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值。The first color matrix calculation unit U504 is configured to calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node.
该绘制单元U505用于在第i个时间节点,以所述颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示;The drawing unit U505 is configured to filter the value of the attribute with the color matrix value at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display the same;
以上i为自然数,i=1,2……n。The above i is a natural number, i=1, 2...n.
若原始静态图片预存于某个文件或数据库中,则原始静态图片获取单元U501可以使用系统的图片读取函数来获取原始静态图片,若原始静态图片为某个动画或者视频的某一帧,则原始静态图片获取单元U501可以使用帧抓取函数来获取原始静态图片。在U501获取到原始静态图片后,图片转换单元U502将图片进行格式转换,得到位图,后续绘制单元U505便能够以该位图作为Bitmap对象,从该Bitmap对象中读取图片的像素数据来进行计算和绘制。If the original still picture is pre-stored in a file or a database, the original still picture obtaining unit U501 can use the system's picture reading function to obtain the original still picture. If the original still picture is a certain frame of an animation or video, then The original still picture obtaining unit U501 can use the frame grabbing function to acquire the original still picture. After the U501 obtains the original still picture, the picture converting unit U502 formats the picture to obtain a bitmap, and the subsequent drawing unit U505 can use the bitmap as a Bitmap object to read the pixel data of the picture from the Bitmap object. Calculate and draw.
该插值单元U503可以使用插值器生成n个时间节点,所有时间节点组成一个时间序列,每个时间节点生成的图片沿着时间序列依次显示,形成动画效果。为满足视觉暂留效果,可将时间节点的时间间隔设置在0.4s以下。优选的是,可以进一步将时间间隔设置在0.1s以下,以获得更为平滑的动画效果。The interpolation unit U503 can use the interpolator to generate n time nodes, all of which form a time series, and the pictures generated by each time node are sequentially displayed along the time series to form an animation effect. To meet the visual persistence effect, the time interval of the time node can be set below 0.4s. Preferably, the time interval can be further set below 0.1 s for a smoother animation effect.
该插值单元U503所使用的预设的时间分段规则可以为线性也可以为非线性,线性指时间节点之间的时间间隔相等,非线性指时间节点之间的 时间间隔可以不相等。按线性的时间分段规则得到的时间序列显示的动画平稳渐进,比较符合人的视觉习惯,按非线性的时间分段规则得到的时间序列显示的动画可以制造闪烁等视觉效果。The preset time segmentation rule used by the interpolation unit U503 may be linear or non-linear, linear means that the time intervals between time nodes are equal, and non-linear refers to between time nodes. The time intervals can be unequal. The time series displayed by the linear time segmentation rule shows an animation that is smooth and gradual, and is more in line with human visual habits. The animation displayed in time series according to the nonlinear time segmentation rule can produce visual effects such as flicker.
该插值单元U503每生成一个时间节点,第一颜色矩阵计算单元U504计算该时间节点对应的颜色矩阵值,第一颜色矩阵计算单元U504可以使用属性动画的估值器来计算颜色矩阵值。颜色矩阵规范式为:Each time the interpolation unit U503 generates a time node, the first color matrix calculation unit U504 calculates a color matrix value corresponding to the time node, and the first color matrix calculation unit U504 can calculate the color matrix value using the estimator of the attribute animation. The color matrix specification is:
Figure PCTCN2017083033-appb-000004
Figure PCTCN2017083033-appb-000004
其中,V为偏移量;F为颜色矩阵。像素颜色计算公式为:Where V is the offset; F is the color matrix. The pixel color calculation formula is:
r=R*m11+G*m12+B*m13+A*m14+m15*255;r=R*m11+G*m12+B*m13+A*m14+m15*255;
g=R*m21+G*m22+B*m23+A*m24+m25*255;g=R*m21+G*m22+B*m23+A*m24+m25*255;
b=R*m31+G*m32+B*m33+A*m34+m35*255;b=R*m31+G*m32+B*m33+A*m34+m35*255;
a=R*m41+G*m42+B*m43+A*m44+m45*255。a=R*m41+G*m42+B*m43+A*m44+m45*255.
其中,大写的R、G、B和A为经颜色矩阵计算前的原颜色分量值,小写的r、g、b和a为计算后的颜色分量值。较常用的颜色矩阵为4×5的矩阵,为使计算更为方便,在颜色矩阵中引入占位符分量,以占位符分量为第5行,构成5×5的对称矩阵,对称矩阵更方便计算,而且占位符分量有利于引入另外的偏移量,使颜色矩阵对像素颜色的控制更为灵活。Wherein, uppercase R, G, B, and A are original color component values before being calculated by the color matrix, and lowercase r, g, b, and a are calculated color component values. The more commonly used color matrix is a 4×5 matrix. To make the calculation more convenient, a placeholder component is introduced into the color matrix, and the placeholder component is the fifth row, which constitutes a 5×5 symmetric matrix, and the symmetric matrix is more Convenient for calculation, and the placeholder component facilitates the introduction of additional offsets, making the color matrix more flexible for pixel color control.
绘制单元U505跟随插值器生成的时间序列渐进地使用第一颜色矩阵计算单元U504计算得到的颜色矩阵修改图片的颜色,第一颜色矩阵计算单元U504每个时间节点计算得到新的颜色矩阵,从而得到与时间序列相对应的颜色矩阵序列。第一颜色矩阵计算单元U504可以使用内插法进行计算,预设颜色矩阵初始值F和颜色矩阵结束值L,然后插值得到中间一系列的颜色矩阵值。F和L由用户根据图片原本的色调和希望达到的最终色调来设定,所述颜色矩阵计算规则由用户根据希望达到的色调变化动画的中间效果来设定,颜色矩阵计算规则可以为线性也可以为非线性,线性颜色矩 阵计算规则使颜色矩阵线性变化,非线性颜色矩阵计算规则使颜色矩阵非线性变化。在线性变化的颜色矩阵序列作用下,图片色调均匀变换,动画效果匀速渐进,非线性变化的颜色矩阵序列作用下,图片色调变换不均匀,动画效果存在突变。The rendering unit U505 progressively uses the time series generated by the interpolator to progressively use the color matrix of the color matrix modification unit calculated by the first color matrix calculation unit U504, and the first color matrix calculation unit U504 calculates a new color matrix for each time node, thereby obtaining A sequence of color matrices corresponding to a time series. The first color matrix calculation unit U504 can perform calculation using interpolation, preset the color matrix initial value F and the color matrix end value L, and then interpolate to obtain a series of color matrix values in the middle. F and L are set by the user according to the original hue of the picture and the desired final hue, which is set by the user according to the intermediate effect of the desired hue change animation, and the color matrix calculation rule can be linear as well. Can be nonlinear, linear color moment The matrix calculation rule makes the color matrix linearly change, and the nonlinear color matrix calculation rule makes the color matrix nonlinearly change. Under the action of the linearly changing color matrix sequence, the picture is evenly transformed, and the animation effect is gradual and gradual. Under the action of the nonlinear color matrix sequence, the picture tonal transformation is not uniform, and the animation effect is abrupt.
在一种可能的实施方式中,第一颜色矩阵计算单元U504线性计算颜色矩阵序列时,具体用于:In a possible implementation manner, when the first color matrix calculation unit U504 linearly calculates the color matrix sequence, it is specifically used to:
若i=1,则以颜色矩阵初始值F为第1个时间节点的颜色矩阵值M1If i=1, the color matrix initial value F is the color matrix value M 1 of the first time node;
若i=n,则以颜色矩阵结束值L为第n个时间节点的颜色矩阵值Mn;否则,If i=n, the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
对于第i个时间节点的颜色矩阵值Mi中的第j个分量hj(Mi):For the jth component h j (M i ) in the color matrix value M i of the i-th time node:
当hj(L)≥hj(F)时,hj(Mi)=hj(F)+[hj(L)-hj(F)]×i/n;When h j (L) ≥h j ( F), h j (Mi) = h j (F) + [h j (L) -h j (F)] × i / n;
当hj(L)<hj(F)时,hj(Mi)=hj(L)-[hj(F)-hj(L)]×i/n。When h j (L) < h j (F), h j (Mi) = h j (L) - [h j (F) - h j (L)] × i / n.
在插值单元U503生成第1个时间节点时,以F为第1个颜色矩阵,在生成第n个时间节点时,以L为第n个颜色矩阵,这中间,对于第i个时间节点,以第1个颜色矩阵(即F)为基础,逐步按线性规律计算第i个颜色矩阵,具体地,将第i个颜色矩阵M1的每个分量线性递增或线性递减,对于颜色矩阵的第j个分量,当hj(L)≥hj(F),也就是L中第j个分量的值大于或等于F中第j个分量的值时,第i个颜色矩阵的第j个分量hj(Mi)=hj(F)+[hj(L)-hj(F)]×i/n,hj(Mi)依次递增,其中hj(L)=hj(F)相当于分量没有变化,该分量的各个中间值也就保持不变;当hj(L)<hj(F),也就是L中第j个分量的值小于F中第j个分量的值时,第i个颜色矩阵的第j个分量hj(Mi)=hj(L)-[hj(F)-hj(L)]×i/n依次递减。这种实施方式中,颜色矩阵序列中颜色矩阵的分量线性递增或递减,计算方法简单,动画效果渐进平稳,占用计算资源也少。When the first time node is generated by the interpolation unit U503, F is the first color matrix, and when the nth time node is generated, L is the nth color matrix, and for the ith time node, Based on the first color matrix (ie, F), the i-th color matrix is gradually calculated according to a linear rule. Specifically, each component of the i-th color matrix M 1 is linearly incremented or linearly decremented, for the jth of the color matrix. of component, when h j (L) ≥H j (F), i.e. the value of L j-th component is greater than or equal to the value of the j-th component of F in the j-th component of the i-th color matrix h j (Mi)=h j (F)+[h j (L)-h j (F)]×i/n, h j (Mi) are sequentially incremented, where h j (L)=h j (F) is equivalent There is no change in the component, and the respective intermediate values of the component remain unchanged; when h j (L) < h j (F), that is, the value of the jth component in L is smaller than the value of the jth component in F The jth component of the i-th color matrix h j (Mi)=h j (L)-[h j (F)-h j (L)]×i/n is sequentially decremented. In this embodiment, the components of the color matrix in the color matrix sequence are linearly incremented or decremented, the calculation method is simple, the animation effect is gradually stable, and the computational resources are also small.
其中,在插值单元U503生成第1个时间节点时,第一颜色矩阵计算单元U504以F为第1个颜色矩阵,在插值单元U503生成第n个时间节点时,第一颜色矩阵计算单元U504以L为第n个颜色矩阵,这中间,对于第i个时间节点,第一颜色矩阵计算单元U504以第1个颜色矩阵(即F)为基础,逐步按线性规律计算第i个颜色矩阵,具体地,将第i个颜色矩阵Mi的每个分量线性递 增或线性递减,对于颜色矩阵的第j个分量,当hj(L)≥hj(F)时,第i个颜色矩阵的第j个分量hj(Mi)=hj(F)+[hj(L)-hj(F)]×i/n,hj(Mi)依次递增,其中hj(L)=hj(F)相当于分量没有变化,该分量的各个中间值也就保持不变;当hj(L)<hj(F)时,第i个颜色矩阵的第j个分量hj(Mi)=hj(L)-[hj(F)-hj(L)]×i/n,hj(Mi)依次递减。这种实施方式中,颜色矩阵序列中颜色矩阵的分量线性递增或递减,计算方法简单,动画效果渐进平稳,占用计算资源少。Wherein, when the interpolation unit U503 generates the first time node, the first color matrix calculation unit U504 takes F as the first color matrix, and when the interpolation unit U503 generates the nth time node, the first color matrix calculation unit U504 L is the nth color matrix. In the middle, for the ith time node, the first color matrix calculation unit U504 calculates the i-th color matrix according to the linear rule based on the first color matrix (ie, F). Ground, each component of the i-th color matrix Mi is linearly incremented or linearly decremented. For the j-th component of the color matrix, when h j (L) ≥ h j (F), the jth of the i-th color matrix The components h j (Mi)=h j (F)+[h j (L)-h j (F)]×i/n, h j (Mi) are sequentially incremented, where h j (L)=h j ( F) the equivalent component does not change, and the respective intermediate values of the component remain unchanged; when h j (L) < h j (F), the jth component of the i-th color matrix h j (Mi)= h j (L) - [h j (F) - h j (L)] × i / n, h j (M i ) are successively decremented. In this embodiment, the components of the color matrix in the color matrix sequence are linearly incremented or decremented, the calculation method is simple, the animation effect is gradually stable, and the computational resources are small.
第一颜色矩阵计算单元U504使用的颜色矩阵计算规则也可以为非线性的,例如使颜色矩阵的分量等比变化,也可以根据特效要求设计其他颜色矩阵计算规则例如正弦变化规则,也可以不依据数学规则而在设定的范围内随机为颜色矩阵中的分量赋值,设定的范围由颜色矩阵初始值和颜色矩阵结束值决定。The color matrix calculation rule used by the first color matrix calculation unit U504 may also be non-linear, for example, the components of the color matrix may be changed in proportion, or other color matrix calculation rules such as sine change rules may be designed according to special effect requirements, or may not be based on The mathematical rules randomly assign values to the components in the color matrix within the set range, and the set range is determined by the initial value of the color matrix and the end value of the color matrix.
在第i个时间节点,第一颜色矩阵计算单元U504得到第i个颜色矩阵后,绘制单元U505将画笔的颜色过滤属性设置为第i个颜色矩阵值,使用所述画笔对所述位图进行绘制改变图片的色调,得到第i个新图片。生成的所有新图片构成动画图片序列,沿时间序列显示而实现色调变化动画。After the first color matrix calculation unit U504 obtains the i-th color matrix at the i-th time node, the drawing unit U505 sets the color filter attribute of the brush to the i-th color matrix value, and uses the brush to perform the bitmap on the bitmap. Draw the hue of the changed picture to get the i-th new picture. All the new images generated form a sequence of animated images, and the hue change animation is implemented along the time series display.
本申请所提供的基于属性动画的色调变化动画实现装置,在时间序列的每个时间节点生成不同的颜色矩阵,通过画笔使用颜色矩阵在每个时间节点动态改变图片的整体颜色,从而得到图片色调变化动画,所述装置执行时占用资源少,执行效率高,更利于实时在线地实现图片色调变化的动画效果。按照本申请所提供的装置生成的图片色调变化动画,不仅可以单独显示,也可以和其他动画叠加在一起形成更丰富的动画效果。本申请所提供的基于属性动画的色调变化动画实现装置,可以应用于具有属性动画的系统,包括但不限于Android(安卓)和iOS(苹果移动系统)等。The attribute animation-based tone change animation implementing device provided by the present application generates different color matrices at each time node of the time series, and dynamically changes the overall color of the image at each time node by using a color matrix through a brush, thereby obtaining a picture color tone. The animation of the change, the device takes up less resources when executing, and has high execution efficiency, which is more conducive to realizing the animation effect of changing the tone of the picture in real time online. The picture color change animation generated by the device provided by the present application can be displayed not only separately but also with other animations to form a richer animation effect. The attribute animation-based tone change animation implementing device provided by the present application can be applied to a system with attribute animation, including but not limited to Android (Android) and iOS (Apple Mobile System).
图6为本申请一示例性实施例示出的另一种基于属性动画的色调变化动画实现装置的框图,如图6所示,所述装置包括原始静态图片获取单元U601、图片转换单元U602、缩放单元U603、主色获取单元U604、预设颜色矩阵确定单元U605、插值单元U606、第一颜色矩阵计算单元U607、及绘制单元U608。FIG. 6 is a block diagram of another attribute animation-based tone change animation implementing apparatus according to an exemplary embodiment of the present application. As shown in FIG. 6, the apparatus includes an original still picture acquiring unit U601, a picture converting unit U602, and zooming. The unit U603, the primary color acquiring unit U604, the preset color matrix determining unit U605, the interpolation unit U606, the first color matrix calculating unit U607, and the drawing unit U608.
该原始静态图片获取单元U601用于获取原始静态图片。 The original still picture obtaining unit U601 is configured to acquire an original still picture.
该图片转换单元U602用于将所述原始静态图片转换为位图。The picture conversion unit U602 is configured to convert the original still picture into a bitmap.
该缩放单元U603用于根据显示区域的大小对所述位图进行缩放。The scaling unit U603 is configured to scale the bitmap according to the size of the display area.
该主色获取单元U604用于获取所述原始静态图片的主色,所述主色为所述原始静态图片中像素点最多的颜色。The main color obtaining unit U604 is configured to acquire a main color of the original still picture, where the main color is a color with the most pixel points in the original still picture.
该预设颜色矩阵确定单元U605用于根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L。The preset color matrix determining unit U605 is configured to determine a preset color matrix initial value F and a color matrix end value L according to the primary color.
该插值单元U606用于根据预设的时间分段规则生成n个时间节点。The interpolation unit U606 is configured to generate n time nodes according to a preset time segmentation rule.
该第一颜色矩阵计算单元U607用于在第i个时间节点,根据预设的颜色矩阵初始值F、颜色矩阵结束值L、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值。The first color matrix calculation unit U607 is configured to calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node.
该绘制单元U608用于在第i个时间节点,以所述颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示。The drawing unit U608 is configured to filter the value of the attribute with the color matrix value at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display it.
以上i为自然数,i=1,2……n。The above i is a natural number, i=1, 2...n.
在图片转换单元U602将静态图片转为位图后,缩放单元U603对所述位图进行缩放以使位图与显示区域的大小一致,从而能够更准确地获取位图像素,防止像素缺失,以及消除边框的影响。为更方便地对图片进行缩放等处理,图片转换单元U602将原始静态图片转换为位图后,可以使位图对象的View继承于包含缩放功能函数的父视图,这样缩放单元U603可以方便地调用父视图中的缩放功能函数对位图进行缩放。After the picture conversion unit U602 converts the still picture into a bitmap, the scaling unit U603 scales the bitmap to make the bitmap conform to the size of the display area, thereby more accurately acquiring the bitmap pixel, preventing the pixel from being missing, and Eliminate the effects of the border. In order to more conveniently scale the image and the like, the image conversion unit U602 converts the original static image into a bitmap, so that the View of the bitmap object can inherit the parent view containing the zoom function, so that the zoom unit U603 can be conveniently called. The zoom function in the parent view scales the bitmap.
以上主色获取单元U604可以进一步包括像素点统计模块、主色偏差范围确定模块、及主色确定模块(图中未示出)。The above primary color acquiring unit U604 may further include a pixel point counting module, a primary color deviation range determining module, and a primary color determining module (not shown).
该像素点统计模块用于将颜色值在预设偏差范围以内的像素点归为同一颜色的像素点,统计各个预设偏差范围内的像素点。The pixel point counting module is configured to classify pixel points whose color values are within a preset deviation range into pixel points of the same color, and count pixel points within each preset deviation range.
该主色偏差范围确定模块用于比较各个预设偏差范围以内像素点的个数,以像素点最多的预设偏差范围为主色偏差范围。The main color deviation range determining module is configured to compare the number of pixel points within each preset deviation range, and the preset deviation range with the largest pixel point is the main color deviation range.
该主色确定模块用于计算主色偏差范围内的颜色值的平均值,以所述平均值对应的颜色为主色。The main color determining module is configured to calculate an average value of the color values within the main color deviation range, and the color corresponding to the average value is the main color.
主色即图片中像素点最多的颜色,在缩放单元U603对位图进行缩放 后,主色获取单元U604读取位图的像素数据,根据像素数据统计同颜色值的像素点,哪种颜色值的像素点最多,则该颜色值对应的颜色为主色。由于像素点的颜色值与标准颜色值之间可能存在误差,因此可以由像素点统计模块将颜色值在预设的偏差范围内的像素点归为同一颜色,然后统计各个偏差范围内的像素点,然后主色偏差范围确定模块比较各个偏差范围内的像素点的个数,以像素点最多的偏差范围为主色偏差范围,主色确定模则取该主色偏差范围内的颜色值的平均值,以该平均值对应的颜色为主色。所述偏差范围可以根据图片颜色分布情况确定,如果图片色块颜色差别较大,则偏差范围可以预设得较小,以使颜色归类更精确,若色块很多,色块颜色差别较小或者有大有小,则可以将偏差范围预设得较大,以方便得到主色。The main color is the color with the most pixels in the picture, and the bitmap is scaled in the scaling unit U603. After that, the main color acquiring unit U604 reads the pixel data of the bitmap, and counts the pixel points of the same color value according to the pixel data, and which color value has the largest number of pixels, the color corresponding to the color value is the main color. Since there may be an error between the color value of the pixel and the standard color value, the pixel point of the color value within the preset deviation range may be classified into the same color by the pixel point counting module, and then the pixel within each deviation range is counted. Then, the main color deviation range determining module compares the number of pixels in each deviation range, and the deviation range with the largest pixel point is the main color deviation range, and the main color determination mode takes the average of the color values within the main color deviation range. The value is the main color corresponding to the average value. The deviation range may be determined according to the color distribution of the picture. If the color difference of the picture color block is large, the deviation range may be preset to be smaller, so that the color classification is more accurate. If there are many color blocks, the color difference of the color block is small. Or if there are large or small, you can preset the deviation range to be larger to facilitate the main color.
以上预设颜色矩阵确定单元U605可以进一步包括颜色矩阵初始值确定模块、主色变化范围设定模块、及颜色矩阵结束值确定模块(图中未示出)。The above preset color matrix determining unit U605 may further include a color matrix initial value determining module, a primary color variation range setting module, and a color matrix end value determining module (not shown).
该颜色矩阵初始值确定模块用于以保持主色的原颜色值的颜色矩阵值为颜色矩阵初始值F。The color matrix initial value determining module is configured to maintain the color matrix initial value F of the color matrix value of the original color value of the primary color.
该主色变化范围设定模块用于以F为边界值之一根据预设的主色变化值设定主色变化范围。The primary color variation range setting module is configured to set a primary color variation range according to a preset primary color change value by using one of F as a boundary value.
该颜色矩阵结束值确定模块用于以所述主色变化范围的另一边界值为颜色矩阵结束值L。The color matrix end value determining module is configured to use the other boundary value of the main color variation range as the color matrix end value L.
在主色获取单元U604获取到位图的主色后,预设颜色矩阵确定单元U605中的颜色矩阵初始值确定模块以保持主色的原颜色值的颜色矩阵值为颜色矩阵初始值F,若得到的主色与图片中最大色块的颜色值相同,则F为单位矩阵即可,若得到的主色是由主色确定模块根据平均值得到的,则主色的颜色值可能与图片色块的实际颜色值存在数学计算上的偏差,这种情况下,颜色矩阵初始值确定模块可以取最大色块的某一像素点的颜色值,以能够将该颜色值改变为主色颜色值的颜色矩阵为F。确定F后,主色变化范围设定模块再以F为边界值之一根据预设的主色变化值设定主色变化范围,颜色矩阵结束值确定模块以主色变化范围的另一边界值为颜色矩阵 结束值L,其中主色变化值可以由用户根据期望达到的色调变化程度在程序中预先设定。或者预设颜色矩阵确定单元U605在主色获取单元U604获取到位图的主色后,通过用户界面显示主色信息,并在用户界面上设置用于输入F和L的输入框,用户在查看图片的主色信息后,根据期望的效果自定义F和L,并通过F和L的输入框进行输入,预设颜色矩阵确定单元U605通过所述输入框获取F和L,完成F和L的确定。After the main color acquiring unit U604 acquires the main color of the bitmap, the color matrix initial value determining module in the preset color matrix determining unit U605 maintains the color matrix value of the original color value of the main color as the color matrix initial value F, if obtained The main color of the main color is the same as the color value of the largest color block in the picture, then F is the unit matrix. If the main color is obtained by the main color determining module according to the average value, the color value of the main color may be the same as the picture color block. The actual color value has a mathematical deviation. In this case, the color matrix initial value determining module can take the color value of a certain pixel of the largest color block to change the color value to the color of the primary color value. The matrix is F. After determining F, the main color change range setting module sets the main color change range according to the preset main color change value by using one of F as the boundary value, and the color matrix end value determination module takes another boundary value of the main color change range. Color matrix The end value L, in which the main color change value can be preset in the program by the user according to the degree of hue change desired to be achieved. Or the preset color matrix determining unit U605 displays the main color information through the user interface after the main color acquiring unit U604 acquires the main color of the bitmap, and sets an input box for inputting F and L on the user interface, and the user views the picture. After the main color information, F and L are customized according to the desired effect, and input is made through the input boxes of F and L, and the preset color matrix determining unit U605 acquires F and L through the input box to complete the determination of F and L. .
图7为本申请一示例性实施例示出的又一种基于属性动画的色调变化动画实现装置的框图,如图7所示,所述装置包括原始静态图片获取单元U701、图片转换单元U702、第二颜色矩阵计算单元U703、插值单元U704、及绘制单元U705。FIG. 7 is a block diagram of still another apparatus for implementing a tone change animation based on attribute animation according to an exemplary embodiment of the present application. As shown in FIG. 7, the apparatus includes an original still picture acquiring unit U701, a picture converting unit U702, and A two-color matrix calculation unit U703, an interpolation unit U704, and a rendering unit U705.
该原始静态图片获取单元U701用于获取原始静态图片。The original still picture obtaining unit U701 is configured to acquire an original still picture.
该图片转换单元U702用于将所述原始静态图片转换为位图。The picture conversion unit U702 is configured to convert the original still picture into a bitmap.
该第二颜色矩阵计算单元U703根据预设的颜色矩阵初始值F、颜色矩阵结束值L、时间节点个数n、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值。The second color matrix calculation unit U703 calculates the color matrix value of the i-th time node according to the preset color matrix initial value F, the color matrix end value L, the number of time nodes n, and the color matrix calculation rule.
该插值单元U704用于根据预设的时间分段规则生成n个时间节点。The interpolation unit U704 is configured to generate n time nodes according to a preset time segmentation rule.
该绘制单元U705用于在第i个时间节点,将以第i个时间节点的颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片。The drawing unit U705 is configured to filter the value of the attribute by the color matrix value of the i-th time node at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture. .
以上i为自然数,i=1,2……n。The above i is a natural number, i=1, 2...n.
图7所示装置与图5所示装置的主要区别在于,第二颜色矩阵计算单元U703在查找单元U704之前,先由第二颜色矩阵计算单元U703执行颜色矩阵计算,再由插值单元U704生成各个时间节点,图5所示装置则插值单元在先,由第一颜色矩阵计算单元跟随插值单元时间节点的生成在每个时间节点实时计算颜色矩阵值。图7所示装置在生成时间节点之前先将各个时间节点的颜色矩阵值计算好,这样插值单元U704生成每个时间节点的同时,不需要再计算颜色矩阵值,只需由绘制单元U705根据已生成的对应于当前时间节点的颜色矩阵值来设置画笔的颜色过滤属性,再使用画笔对位图进行绘制,得到新的图片并显示。图7所示装置相比图5所示装置可 以节省计算时间和资源,时间节点之间的间隔也可以更小,程序执行效率更高,但图5所示装置中实时计算得到的颜色矩阵值可以只在当前暂存,图7所述装置中颜色矩阵值在计算完毕后需依次保存,内存消耗可能会较大。The main difference between the apparatus shown in FIG. 7 and the apparatus shown in FIG. 5 is that the second color matrix calculation unit U703 performs color matrix calculation by the second color matrix calculation unit U703 before the search unit U704, and then generates each by the interpolation unit U704. The time node, the device shown in FIG. 5, the interpolation unit is first, and the color matrix value is calculated in real time at each time node by the first color matrix calculation unit following the generation of the interpolation unit time node. The device shown in FIG. 7 calculates the color matrix values of the respective time nodes before generating the time node, so that the interpolation unit U704 generates each time node, and does not need to calculate the color matrix value again, only by the drawing unit U705. The generated color matrix value corresponding to the current time node is used to set the color filter property of the brush, and then the bitmap is drawn using the brush to obtain a new image and displayed. The device shown in Figure 7 can be compared to the device shown in Figure 5. In order to save computing time and resources, the interval between time nodes can also be smaller, and the program execution efficiency is higher, but the color matrix value calculated in real time in the device shown in FIG. 5 can be temporarily stored only in the current state, the device shown in FIG. The media color matrix values need to be saved in order after the calculation is completed, and the memory consumption may be large.
图8为本申请一示例性实施例示出的又一种基于属性动画的色调变化动画实现装置的框图,如图8所示,所述装置包括原始静态图片获取单元U801、图片转换单元U802、缩放单元U803、主色获取单元U804、预设颜色矩阵确定单元U805、第二颜色矩阵计算单元U806、插值单元U807、及绘制单元U808。FIG. 8 is a block diagram of still another embodiment of an attribute animation-based tone change animation implementation apparatus according to an exemplary embodiment of the present application. As shown in FIG. 8, the apparatus includes an original still picture acquisition unit U801, a picture conversion unit U802, and a zoom. The unit U803, the main color acquiring unit U804, the preset color matrix determining unit U805, the second color matrix calculating unit U806, the interpolation unit U807, and the drawing unit U808.
该原始静态图片获取单元U801用于获取原始静态图片。The original still picture obtaining unit U801 is configured to acquire an original still picture.
该图片转换单元U802用于将所述原始静态图片转换为位图。The picture conversion unit U802 is configured to convert the original still picture into a bitmap.
该缩放单元U803用于根据显示区域的大小对所述位图进行缩放。The scaling unit U803 is configured to scale the bitmap according to the size of the display area.
该主色获取单元U804用于获取所述原始静态图片的主色,所述主色为所述原始静态图片中像素点最多的颜色。The main color acquiring unit U804 is configured to acquire a main color of the original still picture, where the main color is a color with the most pixels in the original still picture.
该预设颜色矩阵确定单元U805用于根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L。The preset color matrix determining unit U805 is configured to determine a preset color matrix initial value F and a color matrix end value L according to the primary color.
该第二颜色矩阵计算单元U806用于根据预设的颜色矩阵初始值F、颜色矩阵结束值L、时间节点个数n、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;The second color matrix calculation unit U806 is configured to calculate a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, a number of time nodes n, and a color matrix calculation rule;
该插值单元U807用于根据预设的时间分段规则生成n个时间节点。The interpolation unit U807 is configured to generate n time nodes according to a preset time segmentation rule.
该绘制单元U808用于在第i个时间节点,以第i个时间节点的颜色矩阵值为颜色过滤属性的值,根据所述颜色过滤属性对所述位图进行绘制,得到新的图片。The drawing unit U808 is configured to filter the value of the attribute by the color matrix value of the i-th time node at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture.
以上i为自然数,i=1,2……n。The above i is a natural number, i=1, 2...n.
所述主色获取单元U804可以进一步包括像素点统计模块、主色偏差范围确定模块、及主色确定模块(图中未示出)。The primary color acquiring unit U804 may further include a pixel point counting module, a primary color deviation range determining module, and a primary color determining module (not shown).
该像素点统计模块用于将颜色值在预设偏差范围以内的像素点归为同一颜色的像素点,统计各个预设偏差范围内的像素点。The pixel point counting module is configured to classify pixel points whose color values are within a preset deviation range into pixel points of the same color, and count pixel points within each preset deviation range.
该主色偏差范围确定模块用于比较各个预设偏差范围以内像素点的 个数,以像素点最多的预设偏差范围为主色偏差范围。The primary color deviation range determining module is configured to compare pixel points within each preset deviation range The number of preset deviations with the largest number of pixels is the main color deviation range.
该主色确定模块用于计算主色偏差范围内的颜色值的平均值,以所述平均值对应的颜色为主色。The main color determining module is configured to calculate an average value of the color values within the main color deviation range, and the color corresponding to the average value is the main color.
所述预设颜色矩阵确定单元U805可以进一步包括颜色矩阵初始值确定模块、主色变化范围设定模块、及颜色矩阵结束值确定模块(图中未示出)。The preset color matrix determining unit U805 may further include a color matrix initial value determining module, a primary color variation range setting module, and a color matrix end value determining module (not shown).
该颜色矩阵初始值确定模块用于以保持主色的原颜色值的颜色矩阵值为颜色矩阵初始值F。The color matrix initial value determining module is configured to maintain the color matrix initial value F of the color matrix value of the original color value of the primary color.
该主色变化范围设定模块用于以F为边界值之一根据预设的主色变化值设定主色变化范围。The primary color variation range setting module is configured to set a primary color variation range according to a preset primary color change value by using one of F as a boundary value.
该颜色矩阵结束值确定模块用于以所述主色变化范围的另一边界值为颜色矩阵结束值L。The color matrix end value determining module is configured to use the other boundary value of the main color variation range as the color matrix end value L.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, the above devices are described separately by function into various units. Of course, the functions of each unit may be implemented in the same software or software and/or hardware when implementing the present application.
另外,本发明实施例还提供了基于属性动画的色调变化动画实现装置的一种硬件结构,图9是一种硬件结构的方框原理图。In addition, an embodiment of the present invention further provides a hardware structure of a tone change animation implementing device based on attribute animation, and FIG. 9 is a block schematic diagram of a hardware structure.
根据图9所示,该装置900包括存储器901和处理器902,存储器901用于存储指令,指令用于控制处理器902进行操作以执行根据本发明的色调变化动画实现方法。According to FIG. 9, the apparatus 900 includes a memory 901 for storing instructions for controlling the processor 902 to operate to perform a tone change animation implementing method according to the present invention, and a processor 902.
该存储器901可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。The memory 901 can include high speed random access memory and can also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
该处理器902可以包括但不限于微处理器MCU、数字信号处理器DSP、或者可编程逻辑器件FPGA等处理装置。The processor 902 can include, but is not limited to, a processing device such as a microprocessor MCU, a digital signal processor DSP, or a programmable logic device FPGA.
该装置900还可以进一步包括输入装置904、通信装置906、接口装置903和显示装置905等。The apparatus 900 may further include an input device 904, a communication device 906, an interface device 903, a display device 905, and the like.
该通信装置906例如能够进行有有线或无线通信。The communication device 906 can, for example, have wired or wireless communication.
该接口装置903例如包括USB接口、网口等。The interface device 903 includes, for example, a USB interface, a network port, and the like.
该输入装置904例如可以包括触摸屏、按键等,以输入各种信息。 The input device 904 may include, for example, a touch screen, a button, or the like to input various information.
该显示装置905例如是液晶显示屏、触摸显示屏等,以显示属性动画。The display device 905 is, for example, a liquid crystal display, a touch display, or the like to display an attribute animation.
本发明的实施例还提供了一种计算机可读存储介质。可选地,在本实施例中,上述存储介质可以用于保存本发明所提供的色调变化动画实现方法的程序代码。Embodiments of the present invention also provide a computer readable storage medium. Optionally, in the embodiment, the foregoing storage medium may be used to save program code of the method for implementing the tone change animation provided by the present invention.
计算机可读存储介质可以是能够保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。The computer readable storage medium can be a tangible device capable of holding and storing instructions for use by the instruction execution device. The computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, with instructions stored thereon A raised structure in the hole card or groove, and any suitable combination of the above. A computer readable storage medium as used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (eg, a light pulse through a fiber optic cable), or through a wire The electrical signal transmitted.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer readable program instructions described herein can be downloaded from a computer readable storage medium to various computing/processing devices or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in each computing/processing device .
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置或系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置及系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可 以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。The various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for a device or system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and the relevant portions can be referred to the description of the method embodiment. The apparatus and system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may be Therefore, it may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without any creative effort.
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者逆序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、装置或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、装置或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、装置或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these There is any such actual relationship or reverse order between entities or operations. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, apparatus, or device that includes a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, device, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of the same element in the process, method, apparatus, or device that comprises the element.
以上所述仅是本申请的具体实施方式,使本领域技术人员能够理解或实现本申请。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。 The above description is only a specific embodiment of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments are obvious 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 the application. Therefore, the application is not limited to the embodiments shown herein, but is to be accorded the broadest scope of the principles and novel features disclosed herein.

Claims (20)

  1. 一种基于属性动画的色调变化动画实现方法,其特征在于,包括:A method for realizing tone change animation based on attribute animation, comprising:
    获取原始静态图片;Get the original still image;
    将所述原始静态图片转换为位图;Converting the original still picture into a bitmap;
    根据预设的时间分段规则生成n个时间节点;Generating n time nodes according to preset time segmentation rules;
    在第i个时间节点,根据预设的颜色矩阵初始值F、颜色矩阵结束值L、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;以及,At the i-th time node, calculating a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule;
    以所述颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示;Filtering the value of the attribute by the color matrix value, and drawing the bitmap according to the color filter attribute to obtain a new picture and displaying;
    其中,i为自然数,i=1,2……n。Where i is a natural number, i=1, 2...n.
  2. 如权利要求1所述的基于属性动画的色调变化动画实现方法,其特征在于,在将所述原始静态图片转换为位图之后,根据预设的时间分段规则生成n个时间节点之前,所述方法还包括:The attribute animation-based tone change animation implementation method according to claim 1, wherein after converting the original still picture into a bitmap, generating n time nodes according to a preset time segmentation rule, The method also includes:
    根据显示区域的大小对所述位图进行缩放。The bitmap is scaled according to the size of the display area.
  3. 如权利要求1或2所述的基于属性动画的色调变化动画实现方法,其特征在于,所述预设的时间分段规则为时间节点之间的间隔相同且小于0.1秒。The attribute animation-based tone change animation implementing method according to claim 1 or 2, wherein the preset time segmentation rule is that the interval between time nodes is the same and less than 0.1 second.
  4. 如权利要求1、2或3所述的基于属性动画的色调变化动画实现方法,其特征在于,所述颜色矩阵包括红色R分量、绿色G分量、蓝色B分量、透明度Alpha分量和占位符分量。The method for realizing an animation based tone change animation according to claim 1, 2 or 3, wherein the color matrix comprises a red R component, a green G component, a blue B component, a transparency alpha component, and a placeholder. Component.
  5. 如权利要求1至4中任一项所述的基于属性动画的色调变化动画实现方法,其特征在于,所述根据预设的颜色矩阵初始值F、颜色矩阵结 束值L、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值,包括:The attribute animation-based tone change animation implementing method according to any one of claims 1 to 4, wherein the initial value F and color matrix knot according to a preset color matrix The bundle value L and the color matrix calculation rule calculate the color matrix value of the i-th time node, including:
    若i=1,则以颜色矩阵初始值F为第1个时间节点的颜色矩阵值M1If i=1, the color matrix initial value F is the color matrix value M 1 of the first time node;
    若i=n,则以颜色矩阵结束值L为第n个时间节点的颜色矩阵值Mn;否则,If i=n, the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
    计算第i个时间节点的颜色矩阵值Mi中的第j个分量hj(Mi):Calculating the jth component h j (M i ) in the color matrix value M i of the i-th time node:
    当hj(L)≥hj(F)时,hj(Mi)=hj(F)+[hj(L)-hj(F)]×i/n;When h j (L) ≥h j ( F), h j (M i) = h j (F) + [h j (L) -h j (F)] × i / n;
    当hj(L)<hj(F)时,hj(Mi)=hj(L)-[hj(F)-hj(L)]×i/n。When h j (L) < h j (F), h j (M i )=h j (L)−[h j (F)−h j (L)]×i/n.
  6. 如权利要求1至5中任一项所述的基于属性动画的色调变化动画实现方法,其特征在于,在将所述原始静态图片转换为位图之后,根据预设的时间分段规则生成n个时间节点之前,还包括:The attribute animation-based tone change animation implementing method according to any one of claims 1 to 5, wherein after converting the original still picture into a bitmap, generating n according to a preset time segmentation rule Before the time node, it also includes:
    获取所述原始静态图片的主色,所述主色为所述原始静态图片中像素点最多的颜色;Obtaining a primary color of the original static picture, where the primary color is a color with the most pixels in the original static picture;
    根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L。A preset color matrix initial value F and a color matrix end value L are determined according to the primary color.
  7. 如权利要求6所述的基于属性动画的色调变化动画实现方法,其特征在于,所述获取所述原始静态图片的主色,包括:The attribute animation-based tone change animation implementation method according to claim 6, wherein the acquiring the main color of the original still picture comprises:
    将颜色值在预设偏差范围以内的像素点归为同一颜色的像素点,统计各个预设偏差范围内的像素点;Pixels whose color values are within the preset deviation range are classified into pixels of the same color, and count the pixels within each preset deviation range;
    比较各个预设偏差范围以内像素点的个数,以像素点最多的预设偏差范围为主色偏差范围;Comparing the number of pixels within each preset deviation range, and the preset deviation range with the largest pixel point is the main color deviation range;
    计算主色偏差范围内的颜色值的平均值,以所述平均值对应的颜色为主色。The average value of the color values in the range of the main color deviation is calculated, and the color corresponding to the average value is the main color.
  8. 如权利要求6或7所述的基于属性动画的色调变化动画实现方法,其特征在于,所述根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L,包括:The attribute animation-based tone change animation implementation method according to claim 6 or 7, wherein the determining the preset color matrix initial value F and the color matrix end value L according to the primary color comprises:
    以保持主色的原颜色值的颜色矩阵值为颜色矩阵初始值F; The color matrix value of the original color value of the main color is maintained as the initial value F of the color matrix;
    以所述颜色矩阵初始值F为边界值之一根据预设的主色变化值设定主色变化范围;Setting a primary color variation range according to a preset primary color change value by using the color matrix initial value F as a boundary value;
    以所述主色变化范围的另一边界值为颜色矩阵结束值L。Another boundary value of the range of the primary color variation is the color matrix end value L.
  9. 如权利要求1至8中任一项所述的基于属性动画的色调变化动画实现方法,其特征在于,The method for realizing a tone change animation based on attribute animation according to any one of claims 1 to 8, wherein
    使用插值器根据预设的时间分段规则生成n个时间节点;Generating n time nodes according to preset time segmentation rules using an interpolator;
    使用估值器计算第i个时间节点的颜色矩阵值;Using a estimator to calculate a color matrix value of the i-th time node;
    所述以所述颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,包括:将画笔的颜色过滤属性的值设置为所述颜色矩阵值,并使用所述画笔对所述位图进行绘制。The value of the color filter attribute is filtered by the color matrix value, and the bitmap is drawn according to the color filter attribute, including: setting a value of a color filter attribute of the brush to the color matrix value, and using The brush draws the bitmap.
  10. 一种基于属性动画的色调变化动画实现方法,其特征在于,包括:A method for realizing tone change animation based on attribute animation, comprising:
    获取原始静态图片;Get the original still image;
    将所述原始静态图片转换为位图;Converting the original still picture into a bitmap;
    根据预设的颜色矩阵初始值F、颜色矩阵结束值L、时间节点个数n、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;Calculating a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, a number of time nodes n, and a color matrix calculation rule;
    根据预设的时间分段规则生成n个时间节点;Generating n time nodes according to preset time segmentation rules;
    在第i个时间节点,以第i个时间节点的颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示;In the i-th time node, the color matrix value of the i-th time node is used to filter the value of the attribute, and the bitmap is drawn according to the color filter attribute to obtain a new picture and displayed;
    其中,i为自然数,i=1,2……n。Where i is a natural number, i=1, 2...n.
  11. 一种基于属性动画的色调变化动画实现装置,其特征在于,包括:An apparatus for realizing tone change animation based on attribute animation, comprising:
    原始静态图片获取单元,用于获取原始静态图片;An original still picture obtaining unit, configured to acquire an original still picture;
    图片转换单元,用于将所述原始静态图片转换为位图;a picture conversion unit, configured to convert the original still picture into a bitmap;
    插值单元,用于根据预设的时间分段规则生成n个时间节点;An interpolation unit, configured to generate n time nodes according to a preset time segmentation rule;
    第一颜色矩阵计算单元,用于在第i个时间节点,根据预设的颜色矩 阵初始值F、颜色矩阵结束值L、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;以及,a first color matrix calculation unit for using the preset color moment at the i-th time node a matrix initial value F, a color matrix end value L, and a color matrix calculation rule, and calculating a color matrix value of the i-th time node;
    绘制单元,用于在第i个时间节点,以所述颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示;a drawing unit, configured to filter a value of the attribute with the color matrix value at the i-th time node, and draw the bitmap according to the color filter attribute to obtain a new picture and display;
    其中,i为自然数,i=1,2……n。Where i is a natural number, i=1, 2...n.
  12. 如权利要求11所述的基于属性动画的色调变化动画实现装置,其特征在于,还包括缩放单元,所述缩放单元用于:在将所述原始静态图片转换为位图之后,根据预设的时间分段规则生成n个时间节点之前,根据显示区域的大小对所述位图进行缩放。The attribute animation-based tone change animation implementing apparatus according to claim 11, further comprising a scaling unit, configured to: after converting the original still picture into a bitmap, according to a preset The time segmentation rule scales the bitmap according to the size of the display area before generating n time nodes.
  13. 如权利要求11或12所述的基于属性动画的色调变化动画实现装置,其特征在于,所述预设的时间分段规则为时间节点之间的间隔相同且小于0.1秒。The attribute animation-based tone change animation implementing apparatus according to claim 11 or 12, wherein the preset time segmentation rule is that the interval between time nodes is the same and less than 0.1 second.
  14. 如权利要求11、12或13所述的基于属性动画的色调变化动画实现装置,其特征在于,所述颜色矩阵包括红色R分量、绿色G分量、蓝色B分量、透明度Alpha分量和占位符分量。The attribute animation-based tone change animation implementing apparatus according to claim 11, 12 or 13, wherein the color matrix comprises a red R component, a green G component, a blue B component, a transparency alpha component, and a placeholder Component.
  15. 如权利要求11至14中任一项所述的基于属性动画的色调变化动画实现装置,其特征在于,所述颜色矩阵计算单元,在计算第i个时间节点的颜色矩阵值时,具体用于:The attribute animation-based tone change animation implementing apparatus according to any one of claims 11 to 14, wherein the color matrix calculating unit is specifically used when calculating a color matrix value of the i-th time node. :
    若i=1,则以颜色矩阵初始值F为第1个时间节点的颜色矩阵值M1If i=1, the color matrix initial value F is the color matrix value M 1 of the first time node;
    若i=n,则以颜色矩阵结束值L为第n个时间节点的颜色矩阵值Mn;否则,If i=n, the color matrix end value L is the color matrix value M n of the nth time node; otherwise,
    计算第i个时间节点的颜色矩阵值Mi中的第j个分量hj(Mi):Calculating the jth component h j (M i ) in the color matrix value M i of the i-th time node:
    当hj(L)≥hj(F)时,hj(Mi)=hj(F)+[hj(L)-hj(F)]×i/n; When h j (L) ≥h j ( F), h j (M i) = h j (F) + [h j (L) -h j (F)] × i / n;
    当hj(L)<hj(F)时,hj(Mi)=hj(L)-[hj(F)-hj(L)]×i/n。When h j (L) < h j (F), h j (M i )=h j (L)−[h j (F)−h j (L)]×i/n.
  16. 如权利要求11至15中任一项所述的基于属性动画的色调变化动画实现装置,其特征在于,还包括:The attribute animation-based tone change animation implementing apparatus according to any one of claims 11 to 15, further comprising:
    主色获取单元,用于在将所述原始静态图片转换为位图之后,根据预设的时间分段规则生成n个时间节点之前,获取所述原始静态图片的主色,所述主色为所述原始静态图片中像素点最多的颜色;以及,a main color acquiring unit, configured to acquire a main color of the original still picture before generating the n time nodes according to the preset time segmentation rule, after converting the original still picture into a bitmap, where the main color is The color of the pixel in the original still picture; and,
    预设颜色矩阵确定单元,用于根据所述主色确定预设的颜色矩阵初始值F和颜色矩阵结束值L。And a preset color matrix determining unit configured to determine a preset color matrix initial value F and a color matrix end value L according to the primary color.
  17. 如权利要求16所述的基于属性动画的色调变化动画实现装置,其特征在于,所述主色获取单元,包括:The attribute color animation animation implementing device according to claim 16, wherein the main color acquiring unit comprises:
    像素点统计模块,用于将颜色值在预设偏差范围以内的像素点归为同一颜色的像素点,统计各个预设偏差范围内的像素点;a pixel point counting module, configured to classify pixel points whose color values are within a preset deviation range into pixels of the same color, and count pixel points within each preset deviation range;
    主色偏差范围确定模块,用于比较各个预设偏差范围以内像素点的个数,以像素点最多的预设偏差范围为主色偏差范围;以及,The main color deviation range determining module is configured to compare the number of pixels within each preset deviation range, and the preset deviation range with the largest pixel point is the main color deviation range;
    主色确定模块,用于计算主色偏差范围内的颜色值的平均值,以所述平均值对应的颜色为主色。The main color determining module is configured to calculate an average value of the color values within the main color deviation range, and the color corresponding to the average value is the main color.
  18. 如权利要求16或17所述的基于属性动画的色调变化动画实现装置,其特征在于,所述预设颜色矩阵确定单元,包括:The attribute color animation animation implementing device according to claim 16 or 17, wherein the preset color matrix determining unit comprises:
    颜色矩阵初始值确定模块,用于以保持主色的原颜色值的颜色矩阵值为颜色矩阵初始值F;a color matrix initial value determining module, configured to maintain a color matrix value of a primary color value of the primary color value as a color matrix initial value F;
    主色变化范围设定模块,用于以F为边界值之一根据预设的主色变化值设定主色变化范围;以及,a main color change range setting module, configured to set a main color change range according to a preset main color change value by using one of F as a boundary value; and
    颜色矩阵结束值确定模块,以所述主色变化范围的另一边界值为颜色矩阵结束值L。 The color matrix end value determining module takes another boundary value of the main color variation range as a color matrix end value L.
  19. 如权利要求11至18中任一项所述的基于属性动画的色调变化动画实现装置,其特征在于,The attribute animation-based tone change animation implementing device according to any one of claims 11 to 18, wherein
    所述插值单元,用于使用插值器根据预设的时间分段规则生成n个时间节点;The interpolation unit is configured to generate n time nodes according to a preset time segmentation rule by using an interpolator;
    所述第一颜色矩阵计算单元,用于在第i个时间节点,根据预设的颜色矩阵初始值F、颜色矩阵结束值L以及颜色矩阵计算规则,使用估值器计算第i个时间节点的颜色矩阵值;The first color matrix calculation unit is configured to calculate an i-th time node according to a preset color matrix initial value F, a color matrix end value L, and a color matrix calculation rule at the i-th time node. Color matrix value;
    所述绘制单元,用于在第i个时间节点,将画笔的颜色过滤属性的值设置为所述颜色矩阵值,并使用所述画笔对所述位图进行绘制,得到新的图片并显示。The drawing unit is configured to set a value of a color filter attribute of the brush to the color matrix value at the i-th time node, and use the brush to draw the bitmap to obtain a new picture and display.
  20. 一种基于属性动画的色调变化动画实现装置,其特征在于,包括:An apparatus for realizing tone change animation based on attribute animation, comprising:
    原始静态图片获取单元,用于获取原始静态图片;An original still picture obtaining unit, configured to acquire an original still picture;
    图片转换单元,用于将所述原始静态图片转换为位图;a picture conversion unit, configured to convert the original still picture into a bitmap;
    第二颜色矩阵计算单元,根据预设的颜色矩阵初始值F、颜色矩阵结束值L、时间节点个数n、以及颜色矩阵计算规则,计算第i个时间节点的颜色矩阵值;a second color matrix calculation unit calculates a color matrix value of the i-th time node according to a preset color matrix initial value F, a color matrix end value L, a number of time nodes n, and a color matrix calculation rule;
    插值单元,用于根据预设的时间分段规则生成n个时间节点;An interpolation unit, configured to generate n time nodes according to a preset time segmentation rule;
    绘制单元,用于在第i个时间节点,以第i个时间节点的颜色矩阵值为颜色过滤属性的值,并根据所述颜色过滤属性对所述位图进行绘制,得到新的图片并显示;a drawing unit, configured to filter a value of the attribute by the color matrix value of the i-th time node at the i-th time node, and draw the bitmap according to the color filtering attribute to obtain a new image and display ;
    其中,i为自然数,i=1,2……n。 Where i is a natural number, i=1, 2...n.
PCT/CN2017/083033 2016-09-08 2017-05-04 Method and device for implementing tone variation animation on basis of attribute animation WO2018045769A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610811213.1 2016-09-08
CN201610811213.1A CN106408632B (en) 2016-09-08 2016-09-08 A kind of tone variations cartoon implementing method and device based on attribute animation

Publications (1)

Publication Number Publication Date
WO2018045769A1 true WO2018045769A1 (en) 2018-03-15

Family

ID=57998795

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/083033 WO2018045769A1 (en) 2016-09-08 2017-05-04 Method and device for implementing tone variation animation on basis of attribute animation

Country Status (2)

Country Link
CN (1) CN106408632B (en)
WO (1) WO2018045769A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109166166A (en) * 2018-09-06 2019-01-08 北京酷我科技有限公司 A kind of implementation method of diffusion particle animation

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106408632B (en) * 2016-09-08 2019-10-25 广州阿里巴巴文学信息技术有限公司 A kind of tone variations cartoon implementing method and device based on attribute animation
EP3671627A4 (en) * 2017-10-09 2020-10-21 Huawei Technologies Co., Ltd. Image processing method and device
CN110033501B (en) * 2018-01-10 2023-09-26 武汉斗鱼网络科技有限公司 Animation realization method and electronic terminal
CN109064529A (en) * 2018-07-30 2018-12-21 北京酷我科技有限公司 A kind of animation algorithms of button dynamic flashing
CN116797700A (en) * 2023-07-13 2023-09-22 北京可利邦信息技术股份有限公司 Dynamic color gradient background image generation method, device, system and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020025066A1 (en) * 1996-09-12 2002-02-28 Daniel Pettigrew Processing image data
CN103810739A (en) * 2014-02-20 2014-05-21 南京师范大学 Image character morphing animation generating method
CN106408632A (en) * 2016-09-08 2017-02-15 广州阿里巴巴文学信息技术有限公司 Method and device for realizing tone changing animation based on attribute animation

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309377B (en) * 2007-05-14 2011-01-19 深圳艾科创新微电子有限公司 Method for implementing OSD background display in gradations of color
JPWO2009050798A1 (en) * 2007-10-17 2011-02-24 三菱電機株式会社 Image processing device
CN103903587B (en) * 2012-12-27 2017-07-21 腾讯科技(深圳)有限公司 A kind of method and device for handling image data
CN103413342B (en) * 2013-07-25 2016-06-15 南京师范大学 A kind of pictograph gradual changed method based on pixel
CN104679380A (en) * 2013-11-30 2015-06-03 富泰华工业(深圳)有限公司 System and method for adjusting background color of user interface
CN103761303B (en) * 2014-01-22 2017-09-15 广东欧珀移动通信有限公司 The arrangement display methods and device of a kind of picture
CN104217452A (en) * 2014-09-10 2014-12-17 珠海市君天电子科技有限公司 Method and device for implementing gradual change of colors
CN104965631B (en) * 2015-05-26 2020-05-15 深圳市万普拉斯科技有限公司 Desktop color matching method and device and intelligent terminal
CN105427358B (en) * 2015-12-23 2020-05-12 武汉斗鱼网络科技有限公司 View animation generation method and system based on android

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020025066A1 (en) * 1996-09-12 2002-02-28 Daniel Pettigrew Processing image data
CN103810739A (en) * 2014-02-20 2014-05-21 南京师范大学 Image character morphing animation generating method
CN106408632A (en) * 2016-09-08 2017-02-15 广州阿里巴巴文学信息技术有限公司 Method and device for realizing tone changing animation based on attribute animation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109166166A (en) * 2018-09-06 2019-01-08 北京酷我科技有限公司 A kind of implementation method of diffusion particle animation
CN109166166B (en) * 2018-09-06 2022-11-22 北京酷我科技有限公司 Method for realizing diffusion particle animation

Also Published As

Publication number Publication date
CN106408632A (en) 2017-02-15
CN106408632B (en) 2019-10-25

Similar Documents

Publication Publication Date Title
WO2018045769A1 (en) Method and device for implementing tone variation animation on basis of attribute animation
CN111104962B (en) Semantic segmentation method and device for image, electronic equipment and readable storage medium
CN109712145B (en) Image matting method and system
US10937200B2 (en) Object-based color adjustment
CN108701351B (en) Image display enhancement method and device
CN111199518B (en) Image presentation method, device and equipment of VR equipment and computer storage medium
CN103347152A (en) Method, device and terminal for picture processing
US10424269B2 (en) Flexible addressing for a three dimensional (3-D) look up table (LUT) used for gamut mapping
US9007373B2 (en) Systems and methods for creating texture exemplars
CN112785493B (en) Model training method, style migration method, device, equipment and storage medium
CN111754431A (en) Image area replacement method, device, equipment and storage medium
CN112132941B (en) Text rendering method, device, equipment and storage medium
CN112580213A (en) Method and apparatus for generating display image of electric field lines, and storage medium
US20160117851A1 (en) Method and apparatus for displaying statictical graphs on a terminal display
CN113254000B (en) Method, device, storage medium and equipment for generating 2D scene based on JSON data
WO2018103143A1 (en) Imaging method and apparatus for virtual reality device, and virtual reality device
CN103871024A (en) Image interpolation method based on adjustable adaption of rational function to human vision
US11900258B2 (en) Learning device, image generating device, learning method, image generating method, and program
CN113495658A (en) SVG (scalable vector graphics) interactive display method, terminal device, computer device and medium
CN112767508A (en) Pseudo color display method, system, device, and medium for respiratory gated image
CN106558034A (en) A kind of method and apparatus for clearing up view data in a mobile device
Welk et al. Matrix morphology with extremum principle
Zhou et al. Improved single image super-resolution based on edge directed interpolation
US11043015B2 (en) Generating reflections within images
Kvitle et al. Adaptive colour rendering of maps for users with colour vision deficiencies

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17847943

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.07.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17847943

Country of ref document: EP

Kind code of ref document: A1