Picture light effect generation method, system, device and storage medium

By generating a background image identical to the original image, performing pixel color replacement and blurring, and automatically merging to generate a glowing effect, the technology solves the production problem that requires professional skills in existing technologies and improves efficiency.

CN115601452BActive Publication Date: 2026-01-02SHENZHEN SHANJIAN INTELLIGENT SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211304843.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2026-01-02
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

Creating glowing effects in images using current technology requires professional image processing skills, resulting in a poor user experience.

Method used

The system receives the original image uploaded by the user, generates a background image that matches the original image, generates a glowing layer texture through pixel color replacement and blurring, calculates the color mixing coefficient by combining transparency and light transmittance percentage, and automatically merges the original image and the glowing layer texture to generate a glowing effect.

Benefits of technology

It eliminates the need for manual processing by users, improving the efficiency of creating glowing effects and simplifying the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115601452B_ABST
    Figure CN115601452B_ABST
Patent Text Reader

Abstract

The application provides a picture light-emitting special effect generation method, system, device and storage medium, and the method comprises the steps of receiving a user-uploaded original picture; executing a picture copying instruction in the background to generate a background picture consistent with the original picture; performing expansion processing on the patterns in the background picture based on pixel color replacement to obtain a light-emitting layer texture; performing horizontal and vertical blur processing on each pixel point in the light-emitting layer texture; calculating a color mixing coefficient of each pixel point of the patterns in the original picture based on the transparency of each pixel point of the patterns in the original picture and a light transmission percentage parameter set by a user; and performing fusion processing on the patterns in the original picture and the light-emitting layer texture in the blur-processed background picture based on the color mixing coefficient to obtain a light-emitting special effect picture. According to the method, after a user uploads an original picture, the background automatically performs cutout to generate a light-emitting layer texture, and then fuses the patterns and the light-emitting layer texture to obtain a light-emitting special effect picture, so that manual processing of the user is not needed, and the light-emitting special effect production efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of light-emitting special effect making, and in particular to a picture light-emitting special effect generation method, system, device and storage medium. BACKGROUND

[0002] When video clips, pictures or texts are processed, some special effects are often needed to highlight the main content. At this time, a light-emitting special effect can be added to the main body to make the content be noticed at a glance. Sometimes, an object also needs to be added with a light-emitting special effect for rendering some special atmosphere and setting off the scene. In the prior art, a picture light-emitting special effect is generally made by manually using a picture editing software such as PS or AE. Therefore, the user needs to have professional image processing skills. For ordinary personnel, they need to learn to use these software before learning to make special effects, which is very unfriendly.

[0003] Therefore, the prior art still needs to be improved and developed. SUMMARY

[0004] The main purpose of the present application is to provide a picture light-emitting special effect generation method, system, device and storage medium to solve the above problems in the prior art.

[0005] The first aspect of the present application provides a picture light-emitting special effect generation method, comprising the following steps:

[0006] Receiving a user uploaded original picture for making a light-emitting special effect, the pattern in the original picture is opaque, and other parts in the original picture except the pattern are completely transparent;

[0007] Executing a picture copying instruction in the background to generate a background picture for making a light-emitting layer texture of the pattern in the original picture; Figure One

[0008] Performing an expansion processing based on pixel color replacement on the pattern in the background picture to obtain a light-emitting layer texture of the pattern;

[0009] Performing horizontal and vertical blur processing on each pixel point in the light-emitting layer texture;

[0010] Calculating a color mixing coefficient of each pixel point of the pattern based on the transparency of each pixel point of the pattern in the original picture and a light transmission percentage parameter set by a user;

[0011] Performing fusion processing on the pattern in the original picture and the light-emitting layer texture in the background picture after the blur processing based on the color mixing coefficient to obtain a light-emitting special effect picture.

[0012] ​In an alternative implementation of the first aspect of the present application, the pixel color replacement-based expansion processing of the pattern in the background image to obtain the luminous layer texture of the pattern comprises:

[0013] In the background image, for each pixel, it is determined whether there is an opaque pixel in a circle with the pixel as the center and a user-set aperture size as the radius;

[0014] If there is an opaque pixel, the color of the pixel is set to the color of the user-set luminous special effect, and the transparency of the pixel is set to be completely opaque.

[0015] If there is an opaque pixel, the color of the pixel is set to black, and the transparency of the pixel is set to be completely transparent.

[0016] In an alternative implementation of the first aspect of the present application, the horizontal and vertical blur processing of each pixel in the luminous layer texture comprises:

[0017] In the horizontal blur processing of each pixel in the luminous layer texture, for each pixel, a first blur coefficient corresponding to each pixel in a first distance range on the left and right sides of the pixel is calculated by a preset relationship between a blur coefficient and a distance from the pixel and a user-set aperture virtual-real parameter.

[0018] The product of the initial color value of each pixel and the first blur coefficient corresponding to each pixel is calculated, and a first accumulated value is obtained by accumulating the products calculated for each pixel in the first distance range on the left and right sides of the pixel, and the first accumulated value is used as a first calculation color value of the pixel.

[0019] In an alternative implementation of the first aspect of the present application, the horizontal and vertical blur processing of each pixel in the luminous layer texture further comprises:

[0020] On the basis of the calculation of the first calculation color value of each pixel, in the vertical blur processing of each pixel in the luminous layer texture, for each pixel, a second blur coefficient corresponding to each pixel in a second distance range on the top and bottom sides of the pixel is calculated by a preset relationship between a blur coefficient and a distance from the pixel and a user-set aperture virtual-real parameter.

[0021] The product of the calculated color value of each pixel point and the second blur coefficient corresponding to each pixel point is recalculated, the products calculated from each pixel point in the second distance range on the left and right sides of the pixel point are accumulated, and a second accumulated value is obtained, and the second accumulated value is used as the final calculated color value of the pixel point.

[0022] In an optional implementation of the first aspect of the present application, the horizontal and vertical blur processing of each pixel point in the luminous layer texture includes:

[0023] When performing horizontal blur processing on each pixel point in the luminous layer texture, for each pixel point, the sum of the initial color values of all pixel points in the third distance range on the left and right sides of the pixel point is calculated, and the sum is multiplied by a third blur coefficient to obtain a first calculated color value of the pixel point.

[0024] On the basis of the first calculated color value of each pixel point, when performing vertical blur processing on each pixel point in the luminous layer texture, for each pixel point, the sum of the first calculated color values of all pixel points in the second distance range on the upper and lower sides of the pixel point is calculated, and the sum is multiplied by a fourth blur coefficient to obtain a final calculated color value of the pixel point.

[0025] In an optional implementation of the first aspect of the present application, the calculation of the color mixing coefficient of each pixel point in the pattern based on the transparency of the pixel point in the pattern and the light transmission percentage parameter set by the user includes:

[0026] For each pixel point, if the transparency of the pixel point is less than or equal to the light transmission percentage, the color mixing coefficient is equal to zero.

[0027] For each pixel point, if the transparency of the pixel point is greater than the light transmission percentage, the color mixing coefficient is equal to the transparency minus the light transmission percentage.

[0028] In an optional implementation of the first aspect of the present application, the fusion processing of the pattern in the original image and the luminous layer texture in the background image after blur processing based on the color mixing coefficient to obtain a luminous special effect picture includes:

[0029] The center alignment processing of the pattern and the luminous layer texture is performed.

[0030] The color fusion of each same position pixel point is performed starting from the center pixel point of the pattern and the center pixel point of the luminous layer texture.

[0031] For two pixel points at the same position, the mixed color of the two pixel points = the final calculated color value of the pixel point in the light-emitting layer texture * (1-the color mixing coefficient of the pixel point in the pattern) + the color value of the pixel point in the pattern * the color mixing coefficient of the pixel point in the pattern.

[0032] The second aspect of the present application provides a picture light-emitting special effect generation system, the picture light-emitting special effect generation system comprising:

[0033] A picture receiving module is configured to receive a user-uploaded original picture for which a light-emitting special effect is to be produced, wherein the pattern in the original picture is opaque, and the other parts in the original picture except the pattern are completely transparent.

[0034] A picture copying module is configured to execute a picture copying instruction in the background to generate a background picture for producing a light-emitting layer texture. Figure One

[0035] A light-emitting layer texture obtaining module is configured to perform an expansion processing based on pixel color replacement on the pattern in the background picture to obtain a light-emitting layer texture of the pattern.

[0036] A blur processing module is configured to perform horizontal and vertical blur processing on each pixel point in the light-emitting layer texture.

[0037] A color mixing coefficient calculating module is configured to calculate a color mixing coefficient of each pixel point of the pattern based on the transparency of each pixel point of the pattern in the original picture and a light transmission percentage parameter set by a user.

[0038] A pattern fusion module is configured to perform a fusion processing on the pattern in the original picture and the light-emitting layer texture in the background picture after the blur processing based on the color mixing coefficient to obtain a light-emitting special effect picture.

[0039] The third aspect of the present application provides a picture light-emitting special effect generation device, the picture light-emitting special effect generation device comprising: a memory and at least one processor, the memory having instructions stored therein, and the memory and the at least one processor being interconnected by a circuit;

[0040] The at least one processor invokes the instructions in the memory to enable the picture light-emitting special effect generation device to perform the picture light-emitting special effect generation method according to any one of the above.

[0041] The fourth aspect of the present application provides a computer readable storage medium, the computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the picture light-emitting special effect generation method according to any one of the above.

[0042] ​Beneficial effects: the present application provides a picture light effect generation method, system, device and storage medium, the method comprises: receiving the original picture uploaded by the user; executing a picture copy instruction in the background to generate a background picture corresponding to the original picture Figure One ; performing pixel color replacement-based expansion processing on the patterns in the background picture to obtain a light layer texture; performing horizontal and vertical blur processing on each pixel point in the light layer texture; calculating color mixing coefficients of each pixel point of the patterns in the original picture based on the transparency of each pixel point of the patterns in the original picture and a light transmission percentage parameter set by the user; and performing fusion processing on the patterns in the original picture and the light layer texture in the blurred background picture based on the color mixing coefficients to obtain a light effect picture. After the user uploads the original picture, the background automatically performs cutout to generate the light layer texture, and then fuses the patterns and the light layer texture to obtain the light effect picture, without the need for manual processing by the user, thereby improving the light effect production efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 An embodiment schematic diagram of a picture light effect generation method of the present application;

[0044] Figure 2 An embodiment schematic diagram of an original picture of the present application;

[0045] Figure 3 An embodiment schematic diagram of a background picture after color replacement and pattern expansion of the present application.

[0046] Figure 4 An embodiment schematic diagram of a background picture after horizontal and vertical blur processing of the present application;

[0047] Figure 5 An embodiment schematic diagram of a light picture obtained after fusion of a light layer texture and patterns of the present application.

[0048] Figure 6 An embodiment schematic diagram of a picture light effect generation system of the present application;

[0049] Figure 7 An embodiment schematic diagram of a picture light effect generation device of the present application. DETAILED DESCRIPTION

[0050] The embodiment of the present application provides a picture light effect generation method, system, device and storage medium. The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in other than the order illustrated

[0051] The order of description herein may not encompass all of the

[0052] Reference Figure 1 The first aspect of the present application provides a method for generating a picture light-emitting special effect, comprising the following steps:

[0053] S100, receiving a user uploaded original picture for making a light-emitting special effect, the pattern in the original picture is opaque, and other parts of the original picture except the pattern are completely transparent; Specifically, the technical solution of the present application is mainly applicable to pictures with a certain fixed format, for example Figure 2 In this picture, there are some patterns Figure 2 Chinese characters) in the picture, the text is the opaque part of the picture, and the other parts are completely transparent. The text here corresponds to the pattern in the picture;

[0054] S200, executing a picture copying instruction in the background to generate a background picture for making a light-emitting layer texture; in the present application, the main function of the background picture is to extract the pattern part in the background picture by a method similar to matting, and to enlarge the extracted part according to the set text peripheral aperture size; Figure One

[0055] S300, performing an expansion processing based on pixel color replacement on the pattern in the background picture to obtain a light-emitting layer texture of the pattern; in the present application, the pattern part is directly processed by one step to place by using the pixel color replacement method, so as to improve the processing efficiency;

[0056] S400, performing horizontal and vertical blur processing on each pixel point in the light-emitting layer texture; in the present application, the main function of the blur processing is to make the text part more prominent after the subsequent light-emitting special effect fusion, so as to not affect the clarity of the original picture;

[0057] S500, calculating a color mixing coefficient of each pixel point of the pattern in the original picture based on the transparency of each pixel point of the pattern and a light transmission percentage parameter set by the user; in the present application, the function of the color mixing coefficient is to make the subsequent pattern and light-emitting layer texture fusion more natural;

[0058] ​S600, fusing the pattern in the original picture and the luminescent layer texture in the background picture after the blur processing based on the color mixing coefficient, to obtain a luminescent special effect picture. In the present application, in order to make the fusion more convenient, the fusion of the pattern and the luminescent layer texture is to fuse the pattern into the picture where the luminescent layer texture is located.

[0059] Specifically, the present application is applicable to any picture with a pattern (the pattern is not limited to text) in the picture style defined in S100, and the pattern has a luminescent effect. The luminescent effect of the present application can be set to any color in step S300, and the luminescent intensity and the pattern transparency can be set in step S500. The present application can be used in various scenes and has wide applicability. The method is to enlarge the pattern, blur the enlarged picture to obtain a luminescent layer, and then mix the luminescent layer with the picture to generate the luminescent effect.

[0060] In an optional embodiment of the first aspect of the present application, the pixel color replacement-based enlargement processing of the pattern in the background picture to obtain the luminescent layer texture of the pattern comprises:

[0061] In the background picture, for each pixel point, it is determined whether there is an opaque pixel point on a circle with a user-set aperture size as a radius and the pixel point as a center point;

[0062] If there is an opaque pixel point, the color of the pixel point is set to the color of the user-set luminescent special effect, and the transparency of the pixel point is set to be completely opaque. In the present application, if an opaque pixel point is found, it means that the current pixel is within the luminescent range, and the current pixel point is set to the corresponding luminescent color and opaque, for example, white opaque 0xFFFFFFFF (RGBA);

[0063] If there is an opaque pixel point, the color of the pixel point is set to black, and the transparency of the pixel point is set to be completely transparent. In the present application, if no opaque pixel point is found, it means that the current pixel is not within the luminescent range, and the current pixel point is set to black and completely transparent 0x00000000 (RGBA). In the present application, the enlarged background picture is shown in Figure 3

[0064] In an optional embodiment of the first aspect of the present application, the horizontal and vertical blur processing of each pixel point in the luminescent layer texture comprises:

[0065] ​In the horizontal blur processing of the pixels in the light-emitting layer texture, for each pixel, a first blur coefficient corresponding to each pixel in a first distance range on the left and right sides of the pixel is calculated by a preset relationship between the blur coefficient, the distance from the pixel and the user-set aperture virtual-real parameter.

[0066] The product of the initial color value of each pixel and the first blur coefficient corresponding to each pixel is calculated, and a first accumulated value is obtained by accumulating the products calculated for each pixel in the first distance range on the left and right sides of the pixel, and the first accumulated value is used as a first calculated color value of the pixel.

[0067] Specifically, in the present application, the light-emitting layer texture is blurred, and the blurring needs to be performed twice, once in the horizontal direction and once in the vertical direction. When blurring in the horizontal direction, the processing method for each pixel is as follows: the pixel color within a distance range B (aperture virtual-real parameter, unit: pixel, the larger B is, the more virtual the aperture is) on the left and right of the current pixel is multiplied by a blur coefficient Blur, and all the results are accumulated.

[0068] The blur coefficient Blur is calculated based on the distance between the pixel and the current pixel, and the specific formula is as follows:

[0069] wherein D is the distance between each pixel and the current pixel in the horizontal direction, and B is the aperture virtual-real parameter;

[0070] The color LightColor of a single pixel in the light-emitting layer texture when blurring in the horizontal direction is the result of accumulating the pixel color within a distance range B multiplied by the blur coefficient Blur, and the calculation formula is as follows:

[0071]

[0072] In an optional embodiment of the first aspect of the present application, the horizontal and vertical blur processing of the pixels in the light-emitting layer texture further comprises:

[0073] Based on the first calculated color value of each pixel, in the vertical blur processing of the pixels in the light-emitting layer texture, for each pixel, a second blur coefficient corresponding to each pixel in a second distance range on the upper and lower sides of the pixel is calculated by a preset relationship between the blur coefficient, the distance from the pixel and the user-set aperture virtual-real parameter.

[0074] The product between the calculated color value of each pixel point and the second blur coefficient corresponding to each pixel point is recalculated, the products calculated from each pixel point in the second distance range on the left and right sides of the pixel point are accumulated, and a second accumulated value is obtained, and the second accumulated value is used as the final calculated color value of the pixel point.

[0075] In the present application, the vertical direction and the horizontal direction are similar, but in the vertical direction, the pixel points in the distance range within B (up and down) are taken, and the background image after horizontal and vertical blur processing of each pixel point in the luminescent layer texture can be as shown in Figure 4

[0076] In another optional embodiment of the first aspect of the present application, the horizontal and vertical blur processing of each pixel point in the luminescent layer texture comprises:

[0077] When performing horizontal blur processing on each pixel point in the luminescent layer texture, for each pixel point, the sum of the initial color values of all pixel points in the third distance range on the left and right sides of the pixel point is calculated, and the sum is multiplied by a third blur coefficient to obtain a first calculated color value of the pixel point.

[0078] On the basis of the calculation of the first calculated color value of each pixel point, when performing vertical blur processing on each pixel point in the luminescent layer texture, for each pixel point, the sum of the first calculated color values of all pixel points in the second distance range on the upper and lower sides of the pixel point is calculated, and the sum is multiplied by a fourth blur coefficient to obtain a final calculated color value of the pixel point.

[0079] In the present application, another method for performing horizontal and vertical blur processing on each pixel point in the luminescent layer texture is also included, which uses a method of multiplying all total pixel value colors by a fixed blur coefficient. Although this method is not as effective as the previously mentioned blur method, it can also meet the requirements of horizontal and vertical blur processing on each pixel point in the luminescent layer texture.

[0080] In an optional embodiment of the first aspect of the present application, the calculation of the color mixing coefficient of each pixel point in the pattern based on the transparency of the pixel point in the original image and the light transmission percentage parameter set by the user comprises:

[0081] For each pixel point, if the transparency of the pixel point is less than or equal to the light transmission percentage, the color mixing coefficient is equal to zero.

[0082] ​If the transparency of the pixel point is greater than the light transmission percentage, the color mixing coefficient is equal to the transparency minus the light transmission percentage.

[0083] Specifically, in the present application, the original picture is mixed with the light-emitting picture, first, the pixel color LightColor in the light-emitting texture at the current position of the pixel is obtained, and the color Color and the transparency Alpha of the pixel in the picture are obtained, the mixing is divided into two steps,

[0084] The first step is to obtain the mixing coefficient f, and the formula is as follows:

[0085] T is the light transmission percentage.

[0086] In an optional embodiment of the first aspect of the present application, the fusion processing of the pattern in the original picture and the light-emitting layer texture in the blurred background picture based on the color mixing coefficient to obtain the light-emitting special effect picture includes:

[0087] The center alignment processing is performed on the pattern and the light-emitting layer texture;

[0088] The color fusion of the same position pixel points is performed from the center pixel point of the pattern and the center pixel point of the light-emitting layer texture;

[0089] For two pixel points at the same position, the mixed color of the two pixel points = the final calculated color value of the pixel point in the light-emitting layer texture *(1-the color mixing coefficient of the pixel point in the pattern)+ the color value of the pixel point in the pattern * the color mixing coefficient of the pixel point in the pattern.

[0090] In the present application, after obtaining the color mixing coefficient, the color mixing is performed using the color mixing coefficient f to obtain the final color FinalColor of the pixel, and the formula is as follows:

[0091] FinalColor = LightColor *(1-f) + Color *f, in the present application, the picture after the fusion processing is as shown in Figure 5 .

[0092] Embodiment

[0093] In order to better illustrate the technical scheme of the present application, the present application exemplarily provides a full-process embodiment as follows:

[0094] (1)First, prepare a picture with transparency, and the picture has some patterns, which means the non-transparent part of the picture, for example, the following picture with transparency, the text part is not transparent, and the other part is completely transparent, and the text here is the corresponding pattern.

[0095] (2) Then set the following parameters

[0096] Aperture size S (custom parameter, which can be understood as how wide the light range needs to be generated at the edge of the pattern), unit pixel, S represents the size of the aperture, the larger S, the larger the aperture;

[0097] Aperture virtual-real parameter B (custom parameter, which can be understood as the range of pixels that need to be blurred around the edge of the pattern), unit pixel, the larger B, the more virtual the aperture;

[0098] Light transmission percentage T (i.e. the light transmission rate of each pixel), range [0.0, 1.0].

[0099] (3) Then copy a picture, and enlarge the pattern in the copied picture to get the light layer texture, the enlargement method is as follows:

[0100] For each pixel, in the picture, find out whether there is a non-transparent pixel on the circle with a radius of S;

[0101] If a non-transparent pixel is found, it means that the current pixel is within the light range, then set the current pixel to the corresponding light color and non-transparent, for example, set it to white non-transparent 0xFFFFFFFF (RGBA);

[0102] If no non-transparent pixel is found, the current pixel is not within the light range, then set the current pixel to black completely transparent 0x00000000 (RGBA).

[0103] (4) Then blur the light layer texture, which needs to be done twice, once in the horizontal direction and once in the vertical direction;

[0104] When blurring in the horizontal direction, the processing method for each pixel is: take the pixel color within the distance range of B in the horizontal direction (left and right) of the current pixel, multiply it by the blur coefficient Blur, and add all the results.

[0105] Blur coefficient Blur is calculated by the distance of the pixel from the current pixel, and the specific formula is as follows:

[0106] Where D is the distance, and B is the virtual-real of the aperture

[0107] LightColor is the result of multiplying the pixel color within the distance range B in the horizontal direction by the blur coefficient Blur, and the calculation formula is:

[0108]

[0109] Similar to the horizontal direction, only in the vertical direction, the pixel within the distance range B (up and down) is taken.

[0110] (5) Finally, the original picture is mixed with the light-emitting picture. First, get the pixel color LightColor in the light-emitting texture at the current position of the pixel, and the color Color and transparency Alpha of the pixel in the picture, and the mixing is divided into two steps,

[0111] The first step is to obtain the mixing coefficient f, and the formula is as follows:

[0112] T is the parameter of the light transmission percentage.

[0113] The second step uses the mixing coefficient f to perform color mixing to obtain the final color FinalColor of the pixel, and the formula is as follows:

[0114] FinalColor=LightColor*(1-f)+Color*f.

[0115] Referring to Figure 6 , the second aspect of the present application provides a picture light-emitting special effect generation system, the picture light-emitting special effect generation system comprises:

[0116] The picture receiving module 10 is used for receiving a user uploaded original picture to be made into a light-emitting special effect, and the pattern in the original picture is opaque, and other parts of the original picture except the pattern are completely transparent;

[0117] The picture copying module 20 is used for executing a picture copying instruction in the background to generate a background picture for making a light-emitting layer texture; Figure One

[0118] The light-emitting layer texture acquisition module 30 is used for performing an expansion processing based on pixel color replacement on the pattern in the background picture to obtain a light-emitting layer texture of the pattern;

[0119] The blur processing module 40 is used for performing horizontal and vertical blur processing on each pixel point in the light-emitting layer texture;

[0120] The color mixing coefficient calculation module 50 is used for calculating the color mixing coefficient of each pixel point of the pattern based on the transparency of each pixel point of the pattern in the original picture and a light transmission percentage parameter set by a user.​

[0121] a pattern fusion module 60, configured to fuse the pattern in the original picture and the luminescent layer texture in the background picture after the blur processing based on the color mixing coefficient, to obtain a luminescent special effect picture.

[0122] In an optional implementation of the second aspect of the present application, the luminescent layer texture acquisition module 30 comprises:

[0123] an opaque pixel point searching unit, configured to, in the background picture, for each pixel point, search whether there is an opaque pixel point on a circle with the pixel point as the center point and with a user-set aperture size as the radius;

[0124] a first color replacement unit, configured to, if there is an opaque pixel point, set the color of the pixel point to a color of a user-set luminescent special effect and set the transparency of the pixel point to be completely opaque;

[0125] a second color replacement unit, configured to, if there is an opaque pixel point, set the color of the pixel point to black and set the transparency of the pixel point to be completely transparent.

[0126] In an optional implementation of the second aspect of the present application, the blur processing module 40 comprises:

[0127] a first horizontal blur processing unit, configured to, when performing horizontal blur processing on each pixel point in the luminescent layer texture, for each pixel point, calculate a first blur coefficient corresponding to each pixel point in a first distance range on the left and right sides of the pixel point by a preset relationship between a blur coefficient and a distance from the pixel point and a user-set aperture virtual-real parameter, calculate a product between an initial color value of each pixel point and the first blur coefficient corresponding to each pixel point, accumulate the product calculated for each pixel point in the first distance range on the left and right sides of the pixel point to obtain a first accumulated value, and use the first accumulated value as a first calculation color value of the pixel point.

[0128] In an optional implementation of the second aspect of the present application, the blur processing module 40 further comprises:

[0129] a first vertical blur processing unit, configured to, on the basis of the first calculation color value of each pixel point, when performing vertical blur processing on each pixel point in the luminescent layer texture, for each pixel point, calculate a second blur coefficient corresponding to each pixel point in a second distance range on the upper and lower sides of the pixel point by a preset relationship between a blur coefficient and a distance from the pixel point and a user-set aperture virtual-real parameter.

[0130] The product of the calculated color value of each pixel point and the second blur coefficient corresponding to each pixel point is recalculated, the products calculated from each pixel point in the second distance range on the left and right sides of the pixel point are accumulated, and a second accumulated value is obtained, and the second accumulated value is used as the final calculated color value of the pixel point.

[0131] In another optional implementation of the second aspect of the present application, the blur processing module 40 comprises:

[0132] The second horizontal blur processing unit performs horizontal blur processing on each pixel point in the light-emitting layer texture, and for each pixel point, calculates the sum of the initial color values of all pixel points in the third distance range on the left and right sides of the pixel point, and multiplies the sum by a third blur coefficient to obtain a first calculated color value of the pixel point.

[0133] The second vertical blur processing unit performs vertical blur processing on each pixel point in the light-emitting layer texture on the basis of the first calculated color value of each pixel point, and for each pixel point, calculates the sum of the first calculated color values of all pixel points in the second distance range on the upper and lower sides of the pixel point, and multiplies the sum by a fourth blur coefficient to obtain a final calculated color value of the pixel point.

[0134] In an optional implementation of the second aspect of the present application, the color mixing coefficient calculation module 50 comprises:

[0135] The first color mixing coefficient calculation unit is configured to, for each pixel point, if the transparency of the pixel point is less than or equal to the light transmission percentage, the color mixing coefficient is equal to zero.

[0136] The second color mixing coefficient calculation unit is configured to, for each pixel point, if the transparency of the pixel point is greater than the light transmission percentage, the color mixing coefficient is equal to the transparency minus the light transmission percentage.

[0137] In an optional implementation of the second aspect of the present application, the pattern fusion module 60 comprises:

[0138] The pattern light-emitting layer alignment unit is configured to perform center alignment processing on the pattern and the light-emitting layer texture.

[0139] The pixel color fusion unit is configured to perform color fusion of pixels in the same position from the center pixel of the pattern and the center pixel of the luminescent layer texture; wherein for two pixels in the same position, the mixed color of the two pixels = the final calculated color value of the pixel in the luminescent layer texture * (1-the color mixing coefficient of the pixel in the pattern) + the color value of the pixel in the pattern * the color mixing coefficient of the pixel in the pattern.

[0140] Figure 7 is a schematic diagram of a picture light special effect generation device provided by an embodiment of the present application. The picture light special effect generation device can have great differences due to different configurations or performances, and can include one or more processors 90 (central processing units, CPU) (for example, one or more processors) and a memory 100, and one or more storage media 110 (for example, one or more mass storage devices) for storing applications or data. The memory and the storage medium can be temporary storage or persistent storage. The programs stored in the storage medium can include one or more modules (not shown in the figure), and each module can include a series of instruction operations of the picture light special effect generation device. Further, the processor can be configured to communicate with the storage medium and execute the series of instruction operations in the storage medium on the medical tablet.

[0141] The picture light special effect generation device of the present application can also include one or more power supplies 120, one or more wired or wireless network interfaces 130, one or more input / output interfaces 140, and / or one or more operating systems such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art can understand that the picture light special effect generation device can also include other components that are not shown in the figure, and the components shown in the figure can be combined or replaced by other components. Figure 7 The structure of the picture light special effect generation device shown in the figure does not constitute a specific limitation on the picture light special effect generation device of the present application, and can include more or fewer components than shown, or combine certain components, or different component arrangements.

[0142] The present application also provides a computer readable storage medium, which can be a non-volatile computer readable storage medium, or a volatile computer readable storage medium. The computer readable storage medium has instructions stored therein, and when the instructions are executed on a computer, the computer performs the steps of the picture light special effect generation method.

[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system or device, unit described above can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0144] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0145] The above-described embodiments are merely used to illustrate the technical solutions of the present application, rather than limit the present application; even though the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for generating a picture light effect, characterized in that, The method comprises the following steps: receiving a user-uploaded original image for making a light-emitting special effect, the pattern in the original image being opaque, and other parts of the original image being completely transparent; executing a picture copying instruction in the background to generate a background image for making a light-emitting layer texture consistent with the original image; performing an expansion process on the pattern in the background image based on pixel color replacement to obtain a light-emitting layer texture of the pattern; performing horizontal and vertical blur processing on each pixel point in the light-emitting layer texture; calculating a color mixing coefficient of each pixel point of the pattern in the original image based on the transparency of each pixel point of the pattern in the original image and a light transmission percentage parameter set by the user; performing fusion processing on the pattern in the original image and the light-emitting layer texture in the background image after blur processing based on the color mixing coefficient to obtain a light-emitting special effect picture.

2. The method of claim 1, wherein, The expansion process on the pattern in the background image based on pixel color replacement to obtain a light-emitting layer texture of the pattern comprises: in the background image, for each pixel point, checking whether there is an opaque pixel point on a circle with a radius of a user-set aperture size and the pixel point as the center point; if there is an opaque pixel point, setting the color of the pixel point to the color of the user-set light-emitting special effect and setting the transparency of the pixel point to complete opacity; if there is an opaque pixel point, setting the color of the pixel point to black and setting the transparency of the pixel point to complete transparency.

3. The method of claim 1, wherein, The horizontal and vertical blur processing on each pixel point in the light-emitting layer texture comprises: when performing horizontal blur processing on each pixel point in the light-emitting layer texture, for each pixel point, a first blur coefficient corresponding to each pixel point in a first distance range on the left and right sides of the pixel point is calculated through a preset relationship between a blur coefficient, a distance from the pixel point, and a user-set aperture virtual-real parameter; a product between an initial color value of each pixel point and the first blur coefficient corresponding to each pixel point is calculated, and a first accumulated value is obtained by accumulating the products calculated for each pixel point in the first distance range on the left and right sides of the pixel point, and the first accumulated value is used as a first calculation color value of the pixel point.

4. The method of claim 3, wherein, The horizontal and vertical blur processing on each pixel point in the light-emitting layer texture further comprises: on the basis of the first calculation color value of each pixel point, when performing vertical blur processing on each pixel point in the light-emitting layer texture, for each pixel point, a second blur coefficient corresponding to each pixel point in a second distance range on the upper and lower sides of the pixel point is calculated through a preset relationship between a blur coefficient, a distance from the pixel point, and a user-set aperture virtual-real parameter. Recalculate the product between the calculated color value of each pixel point and the second blur coefficient corresponding to each pixel point, accumulate the products calculated by each pixel point in the second distance range on the left and right of the pixel point, and obtain a second accumulated value. The final calculated color value of the pixel point is taken as the second accumulated value.

5. The method of claim 1, wherein, The horizontal and vertical blur processing of each pixel point in the light-emitting layer texture includes: When performing horizontal blur processing on each pixel point in the light-emitting layer texture, for each pixel point, calculate the sum of the initial color values of all pixel points in the third distance range on the left and right of the pixel point, multiply the sum by a third blur coefficient to obtain a one-time calculated color value of the pixel point. On the basis of calculating the one-time calculated color value of each pixel point, when performing vertical blur processing on each pixel point in the light-emitting layer texture, for each pixel point, calculate the sum of the one-time calculated color values of all pixel points in the second distance range on the top and bottom of the pixel point, and multiply the sum by a fourth blur coefficient to obtain a final calculated color value of the pixel point.

6. The method of claim 4, wherein, The calculation of the color mixing coefficient of each pixel point of the pattern in the original image based on the transparency of the pixel point of the pattern and the light transmission percentage parameter set by the user includes: For each pixel point, if the transparency of the pixel point is less than or equal to the light transmission percentage, the color mixing coefficient is equal to zero; For each pixel point, if the transparency of the pixel point is greater than the light transmission percentage, the color mixing coefficient is equal to the transparency minus the light transmission percentage.

7. The method of claim 6, wherein, The fusion processing of the pattern in the original image and the light-emitting layer texture in the background image after blur processing based on the color mixing coefficient to obtain a light-emitting special effect picture includes: Performing center alignment processing on the pattern and the light-emitting layer texture; Starting from the center pixel point of the pattern and the center pixel point of the light-emitting layer texture, performing color fusion on each same-position pixel point; For two same-position pixel points, the mixed color of the two pixel points = the final calculated color value of the pixel point in the light-emitting layer texture * (1-the color mixing coefficient of the pixel point in the pattern) + the color value of the pixel point in the pattern * the color mixing coefficient of the pixel point in the pattern.

8. A system for generating a picture light effect, characterized in that The picture light-emitting special effect generation system includes: A picture receiving module is configured to receive an original picture uploaded by a user, wherein the pattern in the original picture is opaque, and other parts in the original picture except the pattern are completely transparent. A picture copying module is configured to execute a picture copying instruction in the background to generate a background picture used for making a light-emitting layer texture, which is consistent with the original picture. A light-emitting layer texture acquisition module is configured to perform an expansion processing based on pixel color replacement on the pattern in the background picture to obtain a light-emitting layer texture of the pattern. A blur processing module is configured to perform horizontal and vertical blur processing on each pixel point in the light-emitting layer texture. The color mixing coefficient calculation module is configured to calculate color mixing coefficients of each pixel point of the pattern in the original picture based on the transparency of each pixel point of the pattern in the original picture and a light transmission percentage parameter set by a user. The pattern fusion module is configured to perform fusion processing on the pattern in the original picture and the luminescent layer texture in the background picture after the blur processing based on the color mixing coefficients, to obtain a luminescent special effect picture.

9. A device for generating image glowing effects, characterized in that, The picture luminescent special effect generation device comprises a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected through a circuit; The at least one processor invokes the instructions in the memory, so that the picture luminescent special effect generation device executes the picture luminescent special effect generation method in any one of claims 1-7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the picture luminescent special effect generation method in any one of claims 1-7.

Citation Information

Patent Citations

  • Method for drawing photoelectric special effect of graph

    CN111951156A

  • Display control method and device of virtual object and electronic equipment

    CN114392551A