Virtual item display method, device and computer-readable storage medium

By receiving virtual item sending instructions, obtaining item images and animation videos, determining the location of pixel points and fusion, generating virtual item animation videos, solving the problem of monotonous display of virtual gifts and achieving rich animation effects and visual experiences.

CN113538302BActive Publication Date: 2025-07-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010301991.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-16
Publication Date
2025-07-04
Estimated Expiration
2040-04-16

AI Technical Summary

Technical Problem

In the prior art, the display method of virtual gifts is too monotonous, the visual effect is poor, and lacks richness and personalization.

Method used

By receiving virtual item sending instructions, obtaining item images and target animation videos, determining the pixel location information in the video frame, and fusing them with the pixel information in the target animation videos, generating virtual item animation videos, realizing the combination of animation effects and transparent processing, eliminating edge jagging, and improving visual experience.

Benefits of technology

It improves the richness and visual effects of virtual items display, so that virtual items can be integrated with background animation effects to form new animation effects, solves the problem of monotony of display and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113538302B_ABST
    Figure CN113538302B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a method, apparatus, and computer-readable storage medium for virtual item display; embodiments of the present application can receive a virtual item sending instruction, which carries a virtual item identifier, obtain an item image and a target animation video that make up the virtual item based on the virtual item identifier, the target animation video includes at least one video frame, then determine the position information of each pixel point in the item image fusion area within the video frame, and then obtain the pixel information at the corresponding position in the item image according to the position information, fuse the pixel information with the pixel information at the corresponding position in the target animation video to obtain a virtual item animation video, and send the virtual item animation video to the terminal of the target object for the animation display of the virtual item; this solution can effectively improve the richness of virtual item display and improve the visual effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a method and apparatus for virtual item display and a computer-readable storage medium. Background Art

[0002] With the development of electronic technologies, the widespread popularity of electronic devices (such as mobile phones, tablet computers, etc.), the number of applications that electronic devices can support is increasing, and the functions are becoming more and more powerful. Electronic devices are developing towards diversification and personalization and have become indispensable electronic products in users' lives.

[0003] In the applications of existing electronic devices, a user can select a specific virtual gift from the candidate virtual gifts provided by an application platform and send it to a target object (such as a relative, friend, colleague, etc.). When the user sends a gift to the target object, the gift can be displayed on the target object's electronic device, or the user's electronic device and the target object's electronic device will display the gift simultaneously. However, the current display of gifts is too monotonous and the visual effect is poor. Summary of the Invention

[0004] Embodiments of this application provide a method and apparatus for virtual item display and a computer-readable storage medium, which can effectively improve the richness of virtual item display and improve the visual effect.

[0005] Embodiments of this application provide a method for virtual item display, including:

[0006] Receiving a virtual item sending instruction, where the virtual item sending instruction carries a virtual item identifier;

[0007] Obtaining an item image and a target dynamic effect video that make up the virtual item based on the virtual item identifier, where the target dynamic effect video includes at least one video frame;

[0008] Determining the position information of each pixel point in the item image fusion area within the video frame;

[0009] Obtaining pixel information at corresponding positions in the item image according to the position information, and fusing the pixel information with the pixel information at corresponding positions in the target dynamic effect video to obtain a virtual item dynamic effect video;

[0010] Sending the virtual item dynamic effect video to the terminal of the target object for dynamic effect display of the virtual item.

[0011] Correspondingly, embodiments of this application also provide a virtual item display apparatus, including:

[0012] A receiving unit, configured to receive a virtual item sending instruction, where the virtual item sending instruction carries a virtual item identifier;

[0013] An acquisition unit, configured to acquire an item image and a target animation video that make up a virtual item based on the virtual item identifier, where the target animation video includes at least one video frame;

[0014] A calculation unit, configured to determine the position information of each pixel point in the item image fusion area within the video frame;

[0015] A fusion unit, configured to acquire pixel information at corresponding positions in the item image according to the position information, and fuse the pixel information with the pixel information at corresponding positions in the target animation video to obtain a virtual item animation video;

[0016] A sending unit, configured to send the virtual item animation video to the terminal of the target object for animating the virtual item.

[0017] Optionally, in some embodiments, the video frame includes an animation fusion area, the position information includes global position information and relative position information, and the calculation unit may include a determination subunit, a first calculation subunit, and a second calculation subunit, as follows:

[0018] The determination subunit is configured to perform pixel recognition on the animation fusion area to determine the item image fusion area in the animation fusion area;

[0019] The first calculation subunit is configured to calculate the global position information of each pixel point in the item image fusion area in the animation fusion area;

[0020] The second calculation subunit is configured to calculate the relative position information of each pixel point in the item image fusion area in the item image fusion area.

[0021] Optionally, in some embodiments, the second calculation subunit may specifically be configured to calculate the percentage of each pixel point in the item image fusion area in a first direction in the item image fusion area; calculate the percentage of each pixel point in the item image fusion area in a second direction in the item image fusion area; and determine the relative position information of the pixel point in the item image fusion area according to the percentage in the first direction and the percentage in the first direction.

[0022] Optionally, in some embodiments, the fusion unit may specifically be configured to determine the position information of the pixel point in a first direction in the item image according to the percentage in the first direction and the length of the item image; determine the position information of the pixel point in a second direction in the item image according to the percentage in the second direction and the width of the item image; and acquire the pixel information at the corresponding position based on the position information in the first direction and the position information in the second direction.

[0023] Optionally, in some embodiments, the video frame includes an animated special effect area. The fusion unit may specifically be configured to obtain pixel information at a corresponding position in the item image according to the relative position information; map the global position information to the animated special effect area to obtain corresponding pixel points in the animated special effect area; and fuse the pixel information with the pixel information of the corresponding pixel points in the animated special effect area to obtain a virtual item animation video.

[0024] Optionally, in some embodiments, the fusion unit may include a judgment subunit and a fusion subunit, as follows:

[0025] The judgment subunit is configured to judge whether a pixel point of the item image is located at the edge of the item image;

[0026] The fusion subunit is configured to, if the pixel point is located at the edge of the item image, perform a fusion process on the pixel information of the pixel point to obtain fused pixel information, and use the fused pixel information to replace the pixel information at the corresponding position in the target animation video to obtain a virtual item animation video; if the pixel point is not located at the edge of the item image, use the pixel information to replace the pixel information at the corresponding position in the target animation video to obtain a virtual item animation video.

[0027] Optionally, in some embodiments, the judgment subunit may specifically be configured to obtain the pixel information and position information of each pixel point in the item image; determine adjacent pixel points of the pixel point based on the position information; obtain the pixel information of the adjacent pixel points, and judge whether the pixel point is located at the edge of the item image according to the pixel information of the pixel point and the pixel information of the adjacent pixel points.

[0028] Optionally, in some embodiments, the fusion subunit may specifically be configured to determine the pixel value of the pixel point and the adjacent pixel value of the adjacent pixel point according to the pixel information of the pixel point and the pixel information of the adjacent pixel points; calculate the average value of the pixel value and the adjacent pixel value; and perform a fusion process on the pixel value and the average value to obtain fused pixel information.

[0029] Optionally, in some embodiments, the judgment subunit may specifically be configured to load the item image using an Open Graphics Library to obtain a target texture corresponding to the item image; and sample the target texture to obtain the pixel information and position information of each pixel point.

[0030] Optionally, in some embodiments, the virtual item display device may further include a transparency processing unit, which is specifically configured to obtain a non-item image fusion area in the target animation video; and set each pixel in the non-item image fusion area as a transparent pixel.

[0031] Optionally, in some embodiments, the receiving unit is specifically configured to display a user interaction page, where the user interaction page includes a virtual item selection control; when detecting a trigger operation by the user on the virtual item selection control, display a virtual item selection page; and when the user sends an operation on a virtual item in the virtual item selection page, receive a virtual item sending instruction.

[0032] Optionally, in some embodiments, the obtaining unit is specifically configured to, based on the virtual item identifier, use an animation component to load an item image and a target animation video that make up the virtual item, where the animation component includes a decoder; and use the decoder to parse the target animation video to obtain at least one video frame.

[0033] In addition, an embodiment of the present application further provides a computer-readable storage medium storing multiple instructions, which are suitable for being loaded by a processor to execute the steps in any virtual item display method provided by an embodiment of the present application.

[0034] In addition, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the program, it implements the steps in any virtual item display method provided by an embodiment of the present application.

[0035] An embodiment of the present application can receive a virtual item sending instruction carrying a virtual item identifier, and then, based on the virtual item identifier, obtain an item image and a target animation video that make up the virtual item, where the target animation video includes at least one video frame, then determine the position information of each pixel in the item image fusion area within the video frame, then, according to the position information, obtain the pixel information at the corresponding position in the item image, fuse the pixel information with the pixel information at the corresponding position in the target animation video to obtain a virtual item animation video, and then send the virtual item animation video to the terminal of the target object for the animation display of the virtual item; this solution can effectively improve the richness of virtual item display and improve the visual effect. Description of the Drawings

[0036] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0037] Figure 1a It is a schematic diagram of the scenario of the virtual item display method provided by the embodiment of the present application;

[0038] Figure 1b It is a flowchart of the virtual item display method provided by the embodiment of the present application;

[0039] Figure 1c It is an architecture diagram of the animation component provided by the embodiment of the present application;

[0040] Figure 1d It is a processing flowchart of the animation component provided by the embodiment of the present application;

[0041] Figure 1e It is a schematic diagram of the edge fusion process provided by the embodiment of the present application;

[0042] Figure 2a It is another flowchart of the virtual item display method provided by the embodiment of the present application;

[0043] Figure 2b It is a user interaction page diagram provided by the embodiment of the present application;

[0044] Figure 2c It is a virtual item selection page diagram provided by the embodiment of the present application;

[0045] Figure 2d It is a schematic diagram of the virtual item switching page provided by the embodiment of the present application;

[0046] Figure 2e It is a schematic diagram of pixel point processing of the virtual item display method provided by the embodiment of the present application;

[0047] Figure 2f It is a comparison diagram before and after the filtering and smoothing processing provided by the embodiment of the present application;

[0048] Figure 2g It is a page display diagram of the virtual item that has been sent provided by the embodiment of the present application;

[0049] Figure 3 It is a schematic structural diagram of the virtual item display device provided by the embodiment of the present application;

[0050] Figure 4 It is a schematic structural diagram of the electronic device provided by the embodiment of the present application. Detailed implementation manners

[0051] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the protection scope of the present application.

[0052] The embodiments of the present application provide a virtual item display method, device, and computer-readable storage medium. Among them, the virtual item display device can be integrated in an electronic device, and the electronic device can be a server or a terminal device, etc.

[0053] For example, referring to Figure 1a , first, the terminal integrated with the virtual item display device can receive a virtual item sending instruction triggered by a user. The virtual item sending instruction carries a virtual item identifier. Then, based on the virtual item identifier, obtain the item image and the target dynamic effect video that make up the virtual item. The target dynamic effect video includes at least one video frame. Then, determine the item image fusion area in the video frame, calculate the position information of each pixel point in the item image fusion area. Next, obtain the pixel information at the corresponding position in the item image according to the position information, and fuse the pixel information with the pixel information at the corresponding position in the target dynamic effect video to obtain a virtual item dynamic effect video. Then, send the virtual item dynamic effect video to the terminal of the target object for dynamic effect display of the virtual item.

[0054] Since this solution can use pixel recognition and fusion to achieve the combination of animation effects, provide rich animation effects, enable the elements in the animation video frame to be replaced and synthesized, and can be reused in similar usage scenarios, solving the problem of low efficiency in similar scenarios. At the same time, it has customized characteristics, rich and personalized visual effects. Use the transparent processing technology of video frames to achieve transparent animation effects and solve the occlusion problem, improving the user's visual experience. This solution enables the virtual item to not only be presented as a transparent animation on the video after being selected by the user, but also be fused with the background dynamic effect to form a new animation effect and presented on the video. A custom filtering algorithm is applied during the sampling of the target texture to eliminate the edge jaggedness that appears when pixels are fused into the video frame, effectively improving the richness of virtual item display and improving the visual effect.

[0055] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.

[0056] This embodiment will be described from the perspective of a virtual item display device, which can be specifically integrated into an electronic device. The electronic device can include devices such as mobile phones, tablet computers, laptop computers, terminals, and personal computers (PCs).

[0057] A virtual item display method includes: receiving a virtual item sending instruction, which carries a virtual item identifier. Then, based on the virtual item identifier, obtaining the item image and the target dynamic effect video that make up the virtual item. The target dynamic effect video includes at least one video frame. Next, determining the position information of each pixel point in the item image fusion area within the video frame. Then, obtaining the pixel information at the corresponding position in the item image according to the position information, and fusing the pixel information with the pixel information at the corresponding position in the target dynamic effect video to obtain a virtual item dynamic effect video. Then, sending the virtual item dynamic effect video to the terminal of the target object for dynamic effect display of the virtual item.

[0058] As Figure 1b shown, the specific process of this virtual item display method can be as follows:

[0059] 101. Receive a virtual item sending instruction, which carries a virtual item identifier.

[0060] Among them, the virtual item sending instruction can carry a virtual item identifier. The virtual item identifier refers to information that can be used to identify a virtual item. For example, it is the number or code of a virtual cake, virtual flower, virtual duck, etc. Specifically, it can be the identity document (ID) of the virtual item.

[0061] Among them, a virtual item refers to a non-physical item that cannot be touched. Another production mode, another production field, visible but untouchable, is a product in the virtual world. For example, it can be a virtual gift sent through the network, such as virtual flowers, cakes, etc. sent to friends or strangers, or gifts sent to the anchor when watching a live broadcast. It can also be an item derived from the virtual online game world, such as equipment.

[0062] Among them, the virtual item sending instruction can be generated by the virtual item display device receiving a virtual item request sent by the user, or can be generated by other devices, such as a terminal, after receiving a virtual item request sent by the user, and then provided to the virtual item display device. That is, the virtual item display device can specifically receive the virtual item sending instruction or receive the virtual item sending instruction sent by other devices.

[0063] For example, a user interaction page can be displayed. The user interaction page includes a virtual item selection control. When a trigger operation by the user on the virtual item selection control is detected, a virtual item selection page is displayed. When the user sends an operation on a virtual item on the virtual item selection page, a virtual item sending instruction is received.

[0064] Among them, the manifestation form of the control can be in the form of an icon, an input box, a button, etc. For example, specifically, a user interaction page for the user to communicate with the target object can be displayed on the user's terminal. The user interaction interface can include a virtual item selection button. For example, in a dating software, it can be a "want to get to know" button. When the user performs a trigger operation on the button, such as clicking, swiping, or others, when the terminal detects the trigger operation by the user on the virtual item selection control, a virtual item selection page can be displayed. On the virtual item selection page, the user can select a gift that they want to send to the target object. For example, the virtual item selection page can include a virtual item switching control, such as a refresh button, a switching button, etc. When the user performs a trigger operation on the virtual item switching control, different virtual items can be switched for the user to select. When the user performs a trigger operation on the virtual item sending control on the virtual item selection page, the virtual item displayed on the current virtual item selection page is determined as the gift that the user wants to send to the target object. At this time, a virtual item sending instruction can be triggered, and the terminal will receive this instruction. Among them, the target object refers to the object that the user wants to send the virtual item to, such as a target user, etc.

[0065] 102. Obtain the item image and the target dynamic effect video that make up the virtual item based on the virtual item identifier. The target dynamic effect video includes at least one video frame.

[0066] For example, based on the virtual item identifier, the item image and the target dynamic effect video that make up the virtual item can be loaded using an animation component. The animation component includes a decoder, and the decoder is used to parse the target dynamic effect video to obtain at least one video frame.

[0067] Among them, the target dynamic effect video refers to a video that wants the virtual item to display a specific animation effect. The target animation video can be stored in the device in a one-to-one correspondence with the item image in advance, or can be personalized selected by the user according to their own preferences, etc., and no limitation is made here. To implement the animation fusion effect of the virtual item, it can be composed of a video file of the animation effect (i.e., the target dynamic effect video), the target image (such as the item image) that needs to be integrated into the video frame, and a JavaScript file that defines the specific fusion logic.

[0068] Among them, JavaScript (abbreviated as JS) is a lightweight, interpreted or just-in-time compiled programming language with function priority. Although it is famous as a scripting language for developing web pages, it is also used in many non-browser environments. JavaScript is a prototype-based, multi-paradigm dynamic scripting language that supports object-oriented, imperative, and declarative (such as functional programming) styles.

[0069] For example, as Figure 1c and 1d shown, an animation component can be used to load business animation resources, that is, to load js animation logic, animation materials, and animation-related video files. Then, the internal js rendering engine of the animation component interprets the js code. The js rendering engine loads the animation resources, parses the js animation logic, and uses the Open Graphics Library (OpenGL) or Metal to load the item image to obtain the corresponding texture data, that is, the target texture corresponding to the item image. Call the internal decoding module (i.e., decoder) to load the animation-related video file, such as the target effect video. The video file can be decoded using AVFoundation or FFmpeg to obtain at least one video frame. Among them, the video frame can be divided into two equal regions: the animation special effect region and the position information region for fusing the target texture.

[0070] Among them, the Open Graphics Library is a cross-language and cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. This interface consists of nearly 350 different function calls for drawing from simple graphic bits to complex three-dimensional scenes. Metal is a brand-new technology designed for developers of high-fidelity console games, which allows developers to fully utilize the performance of the A7 and A8 chips. This technology is optimized to enable the processor and the graphics processor to work together to achieve optimal performance. It is designed for multi-threading and provides various excellent tools to integrate all materials in Xcode. Metal is a low-level rendering application programming interface that provides the lowest layer required by the software to ensure that the software can run on different graphics chips.

[0071] Among them, AVFoundation is a framework for processing audio and video frames that comes with iOS. For example, it can be used for audio and video encoding and decoding. It is one of the frameworks that can be used to play and create time-based audio-visual media. It provides OC interfaces at a detailed level for time-based audio-visual data. It can be used to check, create, edit, and re-encode media files. It can also obtain input streams from devices and manipulate videos during real-time capture and playback for processing time-based media data in an advanced OC framework. It takes full advantage of the multi-core hardware and makes extensive use of block and multi-threaded programming (Grand Central Dispatch, GCD) mechanisms to run complex computing processes in background threads. It automatically provides hardware-accelerated operations to ensure that applications can run with optimal performance on most devices.

[0072] FFmpeg is a third-party open-source framework for powerful audio and video frames. It is an open-source computer program that can be used to record, convert digital audio and video, and stream them. It uses the LGPL or GPL license. It provides a complete solution for recording, converting, and streaming audio and video. It includes a very advanced audio / video codec library (libavcodec). To ensure high portability and codec quality, many codes in libavcodec are developed from scratch. The multimedia video processing tool FFmpeg has very powerful functions, including video capture, video format conversion, video screenshot, adding watermarks to videos, etc.

[0073] Figure 1c The programmable part is the js business logic code that implements specific animation effects, controlling the specific effects of video frames, such as video frame transparency processing, video frame synthesis, etc. For example, js1 and js2 represent different js animation logics, and the js rendering engine can select different js animation logics according to video fusion needs.

[0074] 103. Determine the position information of each pixel point in the item image fusion area within the video frame.

[0075] Among them, the position information can include global position information and relative position information. For example, pixel recognition can be performed on the animation fusion area to determine the item image fusion area within the animation fusion area, calculate the global position information of each pixel point in the item image fusion area within the animation fusion area, and calculate the relative position information of each pixel point in the item image fusion area within the item image fusion area.

[0076] For example, it is possible to determine the object image fusion region in the video frame and calculate the position information of each pixel point in the object image fusion region. For instance, specifically, the RGBA values of the pixels can be utilized to identify each pixel point in the animation fusion region to determine the object image fusion region in the animation fusion region, and then calculate the position information of each pixel point in the object image fusion region.

[0077] Among them, RGBA is a color space representing Red, Green, Blue, and Alpha. Although it is sometimes described as a color space, it is actually just an addition of extra information to the RGB model. The colors used are RGB, which can belong to any RGB color space. However, Catmull and Smith proposed this essential alpha value between 1971 and 1972, making alpha rendering and alpha composition possible.

[0078] The alpha channel is generally used as the opacity parameter. If the alpha channel value of a pixel is 0%, it is completely transparent (i.e., invisible), while a value of 100% means a completely opaque pixel (traditional digital image). Values between 0% and 100% enable the pixel to be displayed through the background, just like through glass (semi-transparency), which cannot be achieved by simple binary transparency (transparent or opaque). It makes digital composition easier. The alpha channel value can be represented as a percentage, an integer, or a real number from 0 to 1 like the RGB parameters.

[0079] Among them, there are many ways to calculate the relative position information of each pixel point. For example, the relative position information of the pixel point can be determined by calculating the relative percentage of the pixel point in each direction. For a 2D image, the x and y directions can be calculated, and for a 3D image, the x, y, and z directions can be calculated, and so on.

[0080] For example, specifically, the percentage of each pixel point in the object image fusion region in the first direction of the object image fusion region can be calculated, the percentage of each pixel point in the object image fusion region in the second direction of the object image fusion region can be calculated, and the relative position information of the pixel point in the object image fusion region can be determined based on the percentage in the first direction and the percentage in the first direction.

[0081] 104. Obtain the pixel information at the corresponding position in the object image based on the position information, and fuse the pixel information with the pixel information at the corresponding position in the target motion effect video to obtain the virtual object motion effect video.

[0082] For example, the position information of the pixel point in the first direction of the item image can be determined according to the percentage in the first direction and the length of the item image, and the position information of the pixel point in the second direction of the item image can be determined according to the percentage in the second direction and the width of the item image. Based on the position information in the first direction and the position information in the second direction, the pixel information at the corresponding position is obtained.

[0083] Among them, the pixel information can refer to the color information, brightness information, and / or grayscale information of the pixel point, etc., such as pixel values. The pixel value is the value assigned by the computer when the original image is digitized.

[0084] For example, the js engine can be used to perform image processing on the video frame and the target texture to obtain the animated effect texture of the final effect, that is, the virtual item dynamic effect video. For example, specifically, the relative position information identified can be used to sample in the target texture to obtain the pixel value of the corresponding point, and the pixel value can be used to replace the pixel value of the corresponding point in the original video frame. The same technology is applied to other pixel points, and finally other image materials (such as item images) are incorporated into the video frame to achieve the effect of the fusion animation.

[0085] For example, specifically, the pixel information at the corresponding position can be obtained in the item image according to the relative position information, the global position information is mapped to the animation special effect area to obtain the corresponding pixel point in the animation special effect area, and the pixel information is fused with the pixel information of the corresponding pixel point in the animation special effect area to obtain the virtual item dynamic effect video.

[0086] In order to eliminate the edge jaggedness that appears when the pixels are fused into the video frame, the edge pixel points can be smoothed, such as applying a custom filtering algorithm when sampling the target texture. For example, specifically, it can be determined whether the pixel point of the item image is located at the edge of the item image. If the pixel point is located at the edge of the item image, the pixel information of the pixel point is fused to obtain the fused pixel information, and the fused pixel information is used to replace the pixel information at the corresponding position in the target dynamic effect video to obtain the virtual item dynamic effect video. If the pixel point is not located at the edge of the item image, the pixel information is used to replace the pixel information at the corresponding position in the target dynamic effect video to obtain the virtual item dynamic effect video.

[0087] Among them, there are many ways to determine whether the pixel point of the item image is located at the edge of the item image. For example, it can be determined whether the pixel point is at the edge through the adjacent pixel points of the pixel point, and so on. Among them, the adjacent pixel points can be the upper, lower, left, and right pixel points of the pixel point, or the east, west, south, and north pixel points, or the pixel points in the southeast, southwest, northwest, and northeast directions, etc.

[0088] For example, such as Figure 1eAs shown, specifically, the pixel information and position information of each pixel in the item image can be obtained. Based on the position information, the adjacent pixels of the pixel can be determined, the pixel information of the adjacent pixel can be obtained, and it can be judged whether the pixel is located at the edge of the item image according to the pixel information of the pixel and the pixel information of the adjacent pixel. Then, according to the pixel information of the pixel and the pixel information of the adjacent pixel, the pixel value of the pixel and the adjacent pixel value of the adjacent pixel are respectively determined, the average value of the pixel value and the adjacent pixel value is calculated, the pixel value and the average value are fused, and the fused pixel information is obtained. Then, the pixel information at the corresponding position in the target animated video is replaced with the fused pixel information to obtain the virtual item animated video.

[0089] Among them, there are many ways to obtain the pixel information and position information of each pixel in the item image. For example, the item image can be loaded using the Open Graphics Library to obtain the target texture corresponding to the item image, and the target texture can be sampled to obtain the pixel information and position information of each pixel.

[0090] In order to present the virtual item animated video in a transparent form on the video, the transparent processing technology of the video frame can be used to achieve the transparent animation effect and solve the occlusion problem. For example, specifically, the non-item image fusion area in the target animated video can be obtained, and each pixel in the non-item image fusion area can be set as a transparent pixel.

[0091] 105. Send the virtual item animated video to the terminal of the target object for the animated effect display of the virtual item.

[0092] For example, after generating the virtual item animated video, it can be directly sent to the terminal of the target object, or the virtual item animated video can be saved on the server so that the server sends the virtual item animated video to the terminal of the target object for the animated effect display of the virtual item in the terminal of the target object. It can also be displayed simultaneously on the user's terminal while sending, and so on.

[0093] Among them, an interface for displaying the animation effect can be used. For example, RAAnimationView (animation view interface), and the video frame output by the rendering engine is finally projected onto the display interface to display the final specific effect.

[0094] As described above, this embodiment can receive a virtual item sending instruction, which carries a virtual item identifier. Then, based on the virtual item identifier, it obtains the item image and the target animation video that make up the virtual item. The target animation video includes at least one video frame. Next, it determines the position information of each pixel point in the item image fusion area within the video frame. Then, according to the position information, it obtains the pixel information at the corresponding position in the item image, and fuses the pixel information with the pixel information at the corresponding position in the target animation video to obtain a virtual item animation video. Then, it sends the virtual item animation video to the terminal of the target object for the animation display of the virtual item. Since this solution can use pixel recognition and fusion to achieve the combination of animation effects, provide rich animation effects, enable the elements in the video frame to be replaced and synthesized, and can be reused in similar usage scenarios, it solves the problem of low efficiency in similar scenarios. At the same time, it has customized characteristics, rich and personalized visual effects. Using the transparent processing technology of the video frame to achieve the transparent animation effect solves the occlusion problem and improves the user's visual experience. This solution enables the virtual item to not only be presented as a transparent animation on the video after being selected by the user, but also be fused with the background animation effect to form a new animation effect and presented on the video. When sampling the target texture, a custom filtering algorithm is applied to eliminate the edge jaggedness that appears when pixels are fused into the video frame, effectively improving the richness of the virtual item display and improving the visual effect.

[0095] According to the method described in the previous embodiment, the following will give examples for further detailed description.

[0096] In this embodiment, it will be described by taking the virtual item display device being specifically integrated in an electronic device, the item image of the virtual item being a duck image, and the target animation video being a fireworks video as an example.

[0097] As Figure 2a shown, a virtual item display method, the specific process can be as follows:

[0098] 201. The electronic device displays a user interaction page, and the user interaction page includes a virtual item selection control.

[0099] For example, the electronic device can specifically display a user interaction page for the user to communicate with the target object. The user interaction page can include a virtual item selection control. For example, as Figure 2b shown, it can be a "want to know" button, and the user can click on this button.

[0100] 202. When detecting a trigger operation by the user on the virtual item selection control, the electronic device displays a virtual item selection page.

[0101] For example, specifically, when the electronic device detects a triggering operation of the user on the control for selecting the virtual item, such as clicking on the "want to know" button, a virtual item selection page is displayed, such as Figure 2c As shown, the virtual item selection page may include a virtual item switching control, such as a refresh button. The user can switch different virtual items by clicking on the refresh button. For example, gifts, such as Figure 2d As shown, select the virtual item that the user wants to send to the target object from it.

[0102] 203. When the user performs a virtual item sending operation on the virtual item selection page, the electronic device receives a virtual item sending instruction.

[0103] For example, the virtual item selection page may include a virtual item sending control, which can be a Figure 2c "Send" button as shown. Specifically, when the user performs a triggering operation on the virtual item sending control on the virtual item selection page, such as clicking on the "Send" button, the virtual item displayed on the current virtual item selection page is determined, such as a duck, as the gift that the user wants to send to the target object. At this time, a virtual item sending instruction can be triggered, and the electronic device will receive this instruction. The virtual item sending instruction can carry a virtual item identifier.

[0104] 204. The electronic device obtains the item image and the target animation effect video that make up the virtual item based on the virtual item identifier. The target animation effect video includes at least one video frame.

[0105] For example, the electronic device can, based on the virtual item identifier, use an animation component to load the item image (such as a duck image) and the target animation effect video (such as a fireworks animation effect video) that make up the virtual item, as well as the js animation logic. Using the js engine inside the animation component, the js code is interpreted, and the decoding module inside the animation component is called to parse the fireworks animation effect video to obtain at least one video frame. Among them, the video frame can be divided into two equal regions: the animation special effect region and the position information region for fusing the target texture. The duck image is loaded using OpenGL to obtain the target texture corresponding to the duck image.

[0106] 205. The electronic device performs pixel recognition on the animation fusion region to determine the item image fusion region in the animation fusion region.

[0107] For example, such as Figure 2eAs shown, the position of the target texture in the animation fusion area can be marked with a solid color block. Specifically, the electronic device can identify each pixel in the animation fusion area using the pixel RGBA value. For example, it can use the underlying Graphics Processing Unit (GPU) hardware for pixel scanning and recognition to determine the duck image fusion area in the animation fusion area, such as Figure 2e The solid color small block in the middle of the animation fusion area.

[0108] 206. The electronic device calculates the position information of each pixel in the item image fusion area.

[0109] Among them, the position information can include global position information and relative position information. For example, the electronic device can calculate the global position information of each pixel in the duck image fusion area in the animation fusion area. For example, as Figure 2e shown, when a pixel in the duck image fusion area is recognized, the coordinate information of this pixel in the animation fusion area is calculated. For example, for pixel point A(x0, y0), the coordinate information of point C (x2, y2) is obtained after mapping to the left animation special effect area. Point C is the pixel point that needs to be fused.

[0110] Next, the electronic device can calculate the relative position information of each pixel in the duck image fusion area in the duck image fusion area. For example, specifically, it can calculate the percentage of each pixel in the duck image fusion area in the first direction in the duck image fusion area, such as the percentage in the x direction, calculate the percentage of each pixel in the duck image fusion area in the second direction in the duck image fusion area, such as the percentage in the y direction, and determine the relative position information of this pixel in the duck image fusion area according to the percentage in the first direction and the percentage in the first direction.

[0111] 207. The electronic device obtains the pixel information at the corresponding position in the item image according to the position information. For example, the electronic device can determine the position information of the pixel in the first direction in the duck image according to the percentage in the first direction and the length of the duck image, determine the position information of the pixel in the second direction in the duck image according to the percentage in the second direction and the width of the duck image, and based on the position information in the first direction and the position information in the second direction, obtain the pixel information at the corresponding position in the duck image. For example, mapping point A to the duck image to obtain the position information of point B (x2, y2), and sampling the target texture of the duck image to obtain the RGBA pixel information of point B in the target texture.

[0112] 208. The electronic device fuses the pixel information with the pixel information at the corresponding position in the target special effect video to obtain a virtual item special effect video.

[0113] For example, the electronic device may obtain the pixel information at the corresponding position in the duck image according to the relative position information, map the global position information to the animation special effect area to obtain the corresponding pixel points in the animation special effect area, fuse the pixel information with the pixel information of the corresponding pixel points in the animation special effect area, and perform the operations in steps 205 to 208 for each video frame until all video frames are processed to obtain the virtual item animation effect video.

[0114] For example, in order to eliminate the edge jaggedness that appears when pixels are fused into the video frame, the edge pixel points can be smoothed, such as applying a custom filtering algorithm when sampling the target texture. For example, the electronic device can specifically obtain the pixel information and position information of each pixel point in the duck image, determine the adjacent pixel points of the pixel point based on the position information, obtain the pixel information of the adjacent pixel points, and judge whether the pixel point is located at the edge of the duck image according to the pixel information of the pixel point and the pixel information of the adjacent pixel points. For example, it can be judged whether the pixel point is at the edge of the target texture according to whether the alpha channel based on the pixel is less than 1.

[0115] If the pixel point is located at the edge of the duck image, the pixel value of the pixel point and the adjacent pixel value of the adjacent pixel point are respectively determined according to the pixel information of the pixel point and the pixel information of the adjacent pixel point, the average value of the pixel value and the adjacent pixel value is calculated, the pixel value and the average value are fused to obtain the fused pixel information, and the fused pixel information is used to replace the pixel information at the corresponding position in the fireworks animation effect video to obtain the virtual item animation effect video. If the pixel point is not located at the edge of the duck image, the pixel information is used to replace the pixel information at the corresponding position in the fireworks animation effect video to obtain the virtual item animation effect video.

[0116] For example, as Figure 1e shown, here, the southeast pixel point ES, southwest pixel point WS, northwest pixel point WN, and northeast pixel point EN of pixel point M can be taken as adjacent pixel points. Then, the average value of the pixel values of pixel point M, southeast pixel point ES, southwest pixel point WS, northwest pixel point WN, and northeast pixel point EN is calculated, and after fusing the pixel value of pixel point M and the average value, the fused pixel information is obtained. The comparison before and after the filtering and smoothing process is as Figure 2f shown, Figure 2f (1) The rendering before applying the custom filtering algorithm for smoothing the pixel point. Figure 2f (2) The rendering after applying the custom filtering algorithm for smoothing the pixel point.

[0117] Among them, part of the code for applying the custom filtering algorithm to eliminate the edge jaggedness that appears when pixels are fused into the video frame can be as follows:

[0118]

[0119] To present the virtual item animation video in a transparent form on the video, the electronic device can use the transparent processing technology of video frames to achieve a transparent animation effect and solve the occlusion problem. For example, the electronic device can specifically obtain the non-duck image fusion area in the fireworks animation video and set each pixel point in the non-duck image fusion area as a transparent pixel point. As Figure 2e shown, set each pixel point in the non-solid color block area of the animation fusion area as a transparent pixel point.

[0120] 209. The electronic device sends the virtual item animation video to the terminal of the target object.

[0121] For example, in order to make the obtained virtual item animation video reusable in similar usage scenarios and improve efficiency, the electronic device can save the virtual item animation video in its own memory, or save the virtual item animation video in the server so that the server sends the virtual item animation video to the terminal of the target object for presenting the animation of the virtual item in the terminal of the target object, or it can also be presented simultaneously on the user's terminal while sending, and so on. For example, after the user clicks "Send", the duck gift can not only be presented as a transparent animation on the video, but also be combined with the background animation fireworks effect to form a new animation effect and presented on the video. As Figure 2g shown, the duck sprays and scatters upwards with the fireworks, and the duck itself also moves upwards and gradually enlarges, just like the effect of spraying a dynamic duck from the fireworks.

[0122] As can be seen from the above, this embodiment can receive a virtual item sending instruction, which carries a virtual item identifier. Then, based on the virtual item identifier, it obtains the item image and the target animation video that make up the virtual item. The target animation video includes at least one video frame. Next, it determines the position information of each pixel point in the item image fusion area within the video frame. Then, according to the position information, it obtains the pixel information at the corresponding position in the item image, and fuses the pixel information with the pixel information at the corresponding position in the target animation video to obtain a virtual item animation video. Then, it sends the virtual item animation video to the terminal of the target object for the animation display of the virtual item. Since this solution can use pixel recognition and fusion to achieve the combination of animation effects, provide rich animation effects, enable the elements in the video frame to be replaced and synthesized, and can be reused in similar usage scenarios, it solves the problem of low efficiency in similar scenarios. At the same time, it has customized characteristics, rich and personalized visual effects. It uses the transparent processing technology of the video frame to achieve a transparent animation effect and solve the occlusion problem, improving the user's visual experience. This solution enables the virtual item to not only be presented as a transparent animation on the video after being selected by the user, but also be fused with the background animation effect to form a new animation effect and be presented on the video. For example, the virtual item duck sprays and scatters upwards with the fireworks, and the duck itself also moves upwards and gradually enlarges, just like the effect of a dynamic duck spraying out from the fireworks. When sampling the target texture, a custom filtering algorithm is applied to eliminate the edge jaggedness that appears when pixels are fused into the video frame, effectively improving the richness of the virtual item display and improving the visual effect.

[0123] To better implement the above method, correspondingly, an embodiment of the present application also provides a virtual item display device. The virtual item display device can be specifically integrated in a terminal, and the terminal can include devices such as mobile phones, tablet computers, laptop computers, and personal computers that can implement virtual item display.

[0124] For example, as Figure 3 shown, the virtual item display device can include a receiving unit 301, an obtaining unit 302, a calculating unit 303, a fusing unit 304, and a sending unit 305, as follows:

[0125] (1) Receiving unit 301;

[0126] The receiving unit 301 is configured to receive a virtual item sending instruction, which carries a virtual item identifier.

[0127] Optionally, in some embodiments, the receiving unit 301 may be specifically configured to display a user interaction page, where the user interaction page includes a virtual item selection control; when detecting a trigger operation by the user on the virtual item selection control, display a virtual item selection page; and when the user performs a sending operation on a virtual item on the virtual item selection page, receive a virtual item sending instruction.

[0128] (2) Acquisition unit 302;

[0129] The acquisition unit 302 is configured to obtain an item image and a target animation video that make up the virtual item based on the virtual item identifier, where the target animation video includes at least one video frame.

[0130] Optionally, in some embodiments, the acquisition unit 302 may be specifically configured to, based on the virtual item identifier, use an animation component to load the item image and the target animation video that make up the virtual item, where the animation component includes a decoder; and use the decoder to parse the target animation video to obtain at least one video frame.

[0131] (3) Calculation unit 303;

[0132] The calculation unit 303 is configured to determine the position information of each pixel point in the item image fusion area within the video frame.

[0133] Optionally, in some embodiments, the video frame includes an animation fusion area, the position information includes global position information and relative position information, and the calculation unit 303 may include a determination subunit, a first calculation subunit, and a second calculation subunit, as follows:

[0134] The determination subunit is configured to perform pixel recognition on the animation fusion area to determine the item image fusion area within the animation fusion area;

[0135] The first calculation subunit is configured to calculate the global position information of each pixel point in the item image fusion area within the animation fusion area;

[0136] The second calculation subunit is configured to calculate the relative position information of each pixel point in the item image fusion area within the item image fusion area.

[0137] Optionally, in some embodiments, the second calculation subunit may be specifically configured to calculate the percentage of each pixel point in the item image fusion area in the first direction within the item image fusion area; calculate the percentage of each pixel point in the item image fusion area in the second direction within the item image fusion area; and determine the relative position information of the pixel point in the item image fusion area based on the percentage in the first direction and the percentage in the first direction.

[0138] (4) Fusion unit 304;

[0139] The fusion unit 304 is configured to obtain pixel information at a corresponding position in the item image according to the position information, and fuse the pixel information with the pixel information at the corresponding position in the target dynamic effect video to obtain a virtual item dynamic effect video.

[0140] Optionally, in some embodiments, the fusion unit 304 may specifically be configured to determine the position information of the pixel point in the first direction of the item image according to the percentage in the first direction and the length of the item image; determine the position information of the pixel point in the second direction of the item image according to the percentage in the second direction and the width of the item image; and obtain the pixel information at the corresponding position based on the position information in the first direction and the position information in the second direction.

[0141] Optionally, in some embodiments, the video frame includes an animation special effect area, and the fusion unit 304 may specifically be configured to obtain pixel information at a corresponding position in the item image according to the relative position information; map the global position information to the animation special effect area to obtain corresponding pixel points in the animation special effect area; and fuse the pixel information with the pixel information of the corresponding pixel points in the animation special effect area to obtain a virtual item dynamic effect video.

[0142] Optionally, in some embodiments, the fusion unit 304 may include a judgment subunit and a fusion subunit, as follows:

[0143] The judgment subunit is configured to judge whether the pixel point of the item image is located at the edge of the item image;

[0144] The fusion subunit is configured to, if the pixel point is located at the edge of the item image, perform a fusion process on the pixel information of the pixel point to obtain fused pixel information, and use the fused pixel information to replace the pixel information at the corresponding position in the target dynamic effect video to obtain a virtual item dynamic effect video; if the pixel point is not located at the edge of the item image, use the pixel information to replace the pixel information at the corresponding position in the target dynamic effect video to obtain a virtual item dynamic effect video.

[0145] Optionally, in some embodiments, the judgment subunit may specifically be configured to obtain the pixel information and position information of each pixel point in the item image; determine the adjacent pixel points of the pixel point based on the position information; obtain the pixel information of the adjacent pixel points, and judge whether the pixel point is located at the edge of the item image according to the pixel information of the pixel point and the pixel information of the adjacent pixel points.

[0146] Optionally, in some embodiments, the fusion subunit may specifically be configured to determine the pixel value of the pixel point and the adjacent pixel value of the adjacent pixel point according to the pixel information of the pixel point and the pixel information of the adjacent pixel point, respectively; calculate the average value of the pixel value and the adjacent pixel value; and perform a fusion process on the pixel value and the average value to obtain the fused pixel information.

[0147] Optionally, in some embodiments, the determination subunit may specifically be configured to load the item image using the Open Graphics Library to obtain the target texture corresponding to the item image; and sample the target texture to obtain the pixel information and position information of each pixel point.

[0148] Optionally, in some embodiments, the virtual item display device may further include a transparency processing unit 306, which may specifically be configured to obtain the non-item image fusion region in the target animation video; and set each pixel point in the non-item image fusion region as a transparent pixel point.

[0149] (5) Transmission unit 305;

[0150] The transmission unit 305 is configured to send the virtual item animation video to the terminal of the target object for animating the display of the virtual item.

[0151] Specifically in implementation, the above units may be implemented as independent entities, or may be arbitrarily combined and implemented as the same or several entities. For the specific implementation of the above units, reference may be made to the foregoing method embodiments, which will not be elaborated herein.

[0152] As described above, in this embodiment, the receiving unit 301 may receive a virtual item sending instruction, which carries a virtual item identifier. Then, the obtaining unit 302 obtains the item image and the target animation video that make up the virtual item based on the virtual item identifier. The target animation video includes at least one video frame. Next, the calculating unit 303 determines the position information of each pixel point in the item image fusion area within the video frame. Then, the fusion unit 304 obtains the pixel information at the corresponding position in the item image according to the position information, and fuses the pixel information with the pixel information at the corresponding position in the target animation video to obtain a virtual item animation video. Then, the sending unit 305 sends the virtual item animation video to the terminal of the target object for the animation display of the virtual item. Since this solution can use pixel recognition and fusion to achieve the combination of animation effects, provide rich animation effects, enable the elements in the video frame to be replaced and synthesized, and can be reused in similar usage scenarios, it solves the problem of low efficiency in similar scenarios. At the same time, it has customized characteristics, rich and personalized visual effects. The use of the transparent processing technology of the video frame to achieve a transparent animation effect solves the occlusion problem and improves the user's visual experience. This solution enables the virtual item to not only be presented as a transparent animation on the video after being selected by the user, but also be fused with the background animation effect to form a new animation effect and presented on the video. A custom filtering algorithm is applied during the sampling of the target texture to eliminate the edge jaggedness that appears when the pixels are fused into the video frame, effectively improving the richness of the virtual item display and improving the visual effect.

[0153] In addition, an embodiment of the present application further provides an electronic device, as Figure 4 shown, which shows a schematic structural diagram of the electronic device involved in the embodiment of the present application. Specifically:

[0154] The electronic device may include a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input unit 404, and other components. Those skilled in the art can understand that Figure 4 the structural diagram of the electronic device shown in

[0155] The processor 401 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 402, and by invoking the data stored in the memory 402, it executes various functions of the electronic device and processes data, thereby performing an overall detection of the electronic device. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 401 either.

[0156] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, image playback function, etc.); the data storage area can store the data created according to the use of the electronic device. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. Correspondingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0157] The electronic device further includes a power supply 403 for powering each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 403 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0158] The electronic device may further include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0159] Although not shown, the electronic device may further include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 401 in the electronic device will, according to the following instructions, load the executable files corresponding to the processes of one or more application programs into the memory 402, and the processor 401 will run the application programs stored in the memory 402 to achieve various functions as follows:

[0160] Receive a virtual item sending instruction, where the virtual item sending instruction carries a virtual item identifier. Then, based on the virtual item identifier, obtain the item image and the target animation effect video that make up the virtual item. The target animation effect video includes at least one video frame. Next, determine the position information of each pixel point in the item image fusion area within the video frame. Then, according to the position information, obtain the pixel information at the corresponding position in the item image, and fuse the pixel information with the pixel information at the corresponding position in the target animation effect video to obtain a virtual item animation effect video. Then, send the virtual item animation effect video to the terminal of the target object for the animation effect display of the virtual item.

[0161] For the specific implementation of each of the above operations, reference can be made to the previous embodiments and will not be elaborated here.

[0162] As can be seen from the above, in this embodiment, a virtual item sending instruction can be received, where the virtual item sending instruction carries a virtual item identifier. Then, based on the virtual item identifier, obtain the item image and the target animation effect video that make up the virtual item. The target animation effect video includes at least one video frame. Next, determine the position information of each pixel point in the item image fusion area within the video frame. Then, according to the position information, obtain the pixel information at the corresponding position in the item image, and fuse the pixel information with the pixel information at the corresponding position in the target animation effect video to obtain a virtual item animation effect video. Then, send the virtual item animation effect video to the terminal of the target object for the animation effect display of the virtual item. Since this solution can use pixel recognition and fusion to achieve the combination of animation effects, provide rich animation effects, enable the elements in the video frame to be replaced and synthesized, and can be reused in similar usage scenarios, it solves the problem of low efficiency in similar scenarios. At the same time, it has customized characteristics, rich and personalized visual effects. Use the transparent processing technology of the video frame to achieve a transparent animation effect to solve the occlusion problem and improve the user's visual experience. This solution enables the virtual item to not only appear as a transparent animation on the video after being selected by the user, but also fuse with the background animation effect to form a new animation effect and present it on the video. When sampling the target texture, a custom filtering algorithm is applied to eliminate the edge jaggedness that appears when the pixels are fused into the video frame, effectively improving the richness of the virtual item display and improving the visual effect.

[0163] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0164] To this end, the embodiments of the present application further provide a computer-readable storage medium, which stores multiple instructions that can be loaded by a processor to execute the steps in any of the virtual item display methods provided by the embodiments of the present application. For example, the instructions can execute the following steps:

[0165] Receive a virtual item sending instruction, which carries a virtual item identifier. Then, based on the virtual item identifier, obtain the item image and the target animation video that make up the virtual item. The target animation video includes at least one video frame. Next, determine the position information of each pixel point in the item image fusion area within the video frame. Then, according to the position information, obtain the pixel information at the corresponding position in the item image, and fuse the pixel information with the pixel information at the corresponding position in the target animation video to obtain a virtual item animation video. Then, send the virtual item animation video to the terminal of the target object for the animation display of the virtual item.

[0166] For the specific implementation of each of the above operations, reference can be made to the previous embodiments, which will not be elaborated here.

[0167] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.

[0168] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the virtual item display methods provided by the embodiments of the present application, the beneficial effects that can be achieved by any of the virtual item display methods provided by the embodiments of the present application can be realized. For details, refer to the previous embodiments, which will not be elaborated here.

[0169] The above has introduced in detail a virtual item display method, device, and computer-readable storage medium provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, based on the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A method for displaying virtual items, characterized in that, Including: Receiving a virtual item sending instruction, where the virtual item sending instruction carries a virtual item identifier; Obtaining an item image and a target dynamic effect video that composes the virtual item based on the virtual item identifier, where the target dynamic effect video includes at least one video frame; wherein, the video frame includes an animation fusion area and an animation special effect area; Determining the position information of each pixel point in the item image fusion area within the video frame, including: performing pixel recognition on the animation fusion area to determine the item image fusion area within the animation fusion area; calculating the global position information of each pixel point in the item image fusion area within the animation fusion area; calculating the relative position information of each pixel point in the item image fusion area within the item image fusion area; Obtaining the pixel information at the corresponding position in the item image according to the position information, and fusing the pixel information with the pixel information at the corresponding position in the target dynamic effect video to obtain a virtual item dynamic effect video, including: obtaining the pixel information at the corresponding position in the item image according to the relative position information; mapping the global position information to the animation special effect area to obtain the corresponding pixel point in the animation special effect area; fusing the pixel information with the pixel information of the corresponding pixel point in the animation special effect area to obtain a virtual item dynamic effect video; Sending the virtual item dynamic effect video to the terminal of the target object for dynamic effect display of the virtual item.

2. The method according to claim 1, characterized in that, The calculating the relative position information of each pixel point in the item image fusion area within the item image fusion area includes: Calculating the percentage of each pixel point in the item image fusion area in the first direction within the item image fusion area; Calculating the percentage of each pixel point in the item image fusion area in the second direction within the item image fusion area; Determining the relative position information of the pixel point in the item image fusion area according to the percentage in the first direction and the percentage in the first direction.

3. The method according to claim 2, characterized in that, The obtaining the pixel information at the corresponding position in the item image according to the position information includes: Determining the position information of the pixel point in the first direction in the item image according to the percentage in the first direction and the length of the item image; Determining the position information of the pixel point in the second direction in the item image according to the percentage in the second direction and the width of the item image; Obtaining the pixel information at the corresponding position based on the position information in the first direction and the position information in the second direction.

4. The method according to claim 1, wherein The fusing the pixel information with the pixel information at the corresponding position in the target dynamic effect video to obtain a virtual item dynamic effect video includes: Judging whether the pixel point of the item image is located at the edge of the item image; If the pixel point is located at the edge of the item image, performing fusion processing on the pixel information of the pixel point to obtain fused pixel information, and using the fused pixel information to replace the pixel information at the corresponding position in the target dynamic effect video to obtain a virtual item dynamic effect video; If the pixel is not located at the edge of the item image, the pixel information at the corresponding position in the target dynamic effect video is replaced with the pixel information, and a virtual item dynamic effect video is obtained.

5. The method according to claim 4, wherein The determination of whether a pixel of the item image is located at the edge of the item image includes: Obtaining the pixel information and position information of each pixel in the item image; Determining the adjacent pixels of the pixel based on the position information; Obtaining the pixel information of the adjacent pixels, and determining whether the pixel is located at the edge of the item image according to the pixel information of the pixel and the pixel information of the adjacent pixels.

6. The method according to claim 5, wherein The fusion processing of the pixel information of the pixel to obtain the fused pixel information includes: Respectively determining the pixel value of the pixel and the adjacent pixel value of the adjacent pixel according to the pixel information of the pixel and the pixel information of the adjacent pixel; Calculating the average value of the pixel value and the adjacent pixel value; Performing fusion processing on the pixel value and the average value to obtain the fused pixel information.

7. The method according to claim 5, characterized in that, The obtaining of the pixel information and position information of each pixel in the item image includes: Loading the item image to obtain the target texture corresponding to the item image; Sampling the target texture to obtain the pixel information and position information of each pixel.

8. The method according to claim 1, wherein After the fusion of the pixel information with the pixel information at the corresponding position in the target dynamic effect video, it further includes: Obtaining the non-item image fusion area in the target dynamic effect video; Setting each pixel in the non-item image fusion area as a transparent pixel.

9. The method according to claim 1, wherein The receiving of the virtual item sending instruction includes: Displaying a user interaction page, where the user interaction page includes a virtual item selection control; When a trigger operation on the virtual item selection control by the user is detected, displaying a virtual item selection page; When the user performs a virtual item sending operation on the virtual item selection page, a virtual item sending instruction is received.

10. The method according to claim 1, characterized in that, The obtaining of the item image and the target dynamic effect video constituting the virtual item based on the virtual item identifier, where the target dynamic effect video includes at least one video frame, includes: Based on the virtual item identifier, using an animation component to load the item image and the target dynamic effect video constituting the virtual item, where the animation component includes a decoder; Using the decoder to parse the target dynamic effect video to obtain at least one video frame.

11. A virtual item display device, characterized in that, It includes: A receiving unit for receiving a virtual item sending instruction, where the virtual item sending instruction carries a virtual item identifier; An obtaining unit for obtaining the item image and the target dynamic effect video constituting the virtual item based on the virtual item identifier, where the target dynamic effect video includes at least one video frame; wherein, the video frame includes an animation fusion area and an animation special effect area; A determination unit, configured to determine the position information of each pixel point in the item image fusion region within the video frame, including: performing pixel recognition on the animation fusion region to determine the item image fusion region in the animation fusion region; calculating the global position information of each pixel point in the item image fusion region within the animation fusion region; calculating the relative position information of each pixel point in the item image fusion region within the item image fusion region; A fusion unit, configured to obtain pixel information at corresponding positions in the item image according to the position information, and fuse the pixel information with the pixel information at corresponding positions in the target special effect video to obtain a virtual item special effect video, including: obtaining pixel information at corresponding positions in the item image according to the relative position information; mapping the global position information to the animation special effect region to obtain corresponding pixel points in the animation special effect region; fusing the pixel information with the pixel information of the corresponding pixel points in the animation special effect region to obtain a virtual item special effect video; A sending unit, configured to send the virtual item special effect video to the terminal of the target object for displaying the special effect of the virtual item.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the virtual item display method according to any one of claims 1 to 10.

13. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image processing and live broadcasting method and device, equipment and storage medium

    CN110177287A

  • Virtual gift special effect processing method, virtual gift special effect processing device and live broadcast system

    CN110493630A