Image processing methods and apparatus

By obtaining the transparency parameters of the image sequence and using layered rendering and frame switching control, the rendering efficiency and video memory usage issues in browser-side image sequence previews were resolved, achieving efficient and accurate image display effects.

CN123123631APending Publication Date: 2026-11-17GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610921906.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-24
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies for previewing image sequences containing transparency channels in browsers suffer from problems such as limited rendering frame rate, significant data processing latency, high video memory bandwidth consumption, heavy memory management pressure, and difficulty in ensuring the consistency of transparency information display.

Method used

By obtaining transparency parameters from image sequences, and employing layered rendering and frame switching control methods, image processing overhead is reduced, rendering efficiency and display accuracy are improved, and memory usage and interactive response latency are reduced.

Benefits of technology

It enables efficient image sequence preview on the browser side, reduces image processing overhead, improves the rendering efficiency and display accuracy of transparency frames, and reduces video memory usage and interactive response latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123631A_ABST
    Figure CN123123631A_ABST
Patent Text Reader

Abstract

One embodiment of this disclosure provides an image processing method, including: acquiring an image sequence containing multiple frame images and a transparency parameter corresponding to each pixel in the frame images; performing frame switching control on the image sequence based on a time interval parameter to determine the current frame image; and rendering background layer content and foreground layer content sequentially on a rendering canvas based on the current frame image and its corresponding transparency parameter to obtain a target preview image, wherein the foreground layer content includes the current frame image, and the transparency display of the foreground layer content is controlled based on the transparency parameter. In this way, during the image sequence preview process on the browser side, layered rendering and frame switching control reduce image processing overhead, improve the rendering efficiency and display accuracy of frames with transparency, help improve video memory resource usage, and reduce interactive response latency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to image processing methods, apparatus, computer-readable storage media, and electronic devices. Background Technology

[0002] In image sequence preview technologies, real-time preview of dynamic frame sequences is a crucial step in verifying image quality. These technologies typically rely on local viewing tools to browse frame by frame, playback of encoded video streams, or simulating animation by periodically switching image elements on a webpage. These solutions often rely on the central processing unit (CPU) for image decoding and rendering, or involve frequent disk file read / write operations, resulting in limited rendering frame rates and significant data processing latency in browser environments.

[0003] Furthermore, when previewing image sequences containing alpha channels in a browser, the above solutions typically lack graphics processor acceleration support. Loading independent texture data frame by frame can easily lead to high video memory bandwidth usage and memory management pressure. Moreover, the display consistency of alpha information is difficult to guarantee, the feedback delay of interactive operations is long, and the system resource utilization is insufficient. Summary of the Invention

[0004] This disclosure provides an image processing method, apparatus, computer-readable storage medium, and electronic device to at least partially solve the aforementioned problems existing in the related art.

[0005] According to one aspect of this disclosure, an image processing method is provided, the method comprising: acquiring an image sequence containing multiple frame images and a transparency parameter corresponding to each pixel in the frame images; performing frame switching control on the image sequence based on a time interval parameter to determine the current frame image; and rendering background layer content and foreground layer content sequentially on a rendering canvas based on the current frame image and its corresponding transparency parameter to obtain a target preview image, wherein the foreground layer content includes the current frame image, and the transparency display of the foreground layer content is controlled based on the transparency parameter.

[0006] According to one aspect of this disclosure, an image processing apparatus is provided, comprising: an acquisition module for acquiring an image sequence containing multiple frame images and a transparency parameter corresponding to each pixel in the frame images; a frame switching module for performing frame switching control on the image sequence based on a time interval parameter to determine the current frame image; and a rendering module for rendering background layer content and foreground layer content sequentially on a rendering canvas based on the current frame image and its corresponding transparency parameter to obtain a target preview image, wherein the foreground layer content includes the current frame image, and the transparency display of the foreground layer content is controlled based on the transparency parameter.

[0007] According to one aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the above methods.

[0008] According to one aspect of this disclosure, an electronic device is provided, including a processor and a memory, the memory for storing a computer program and the processor for executing the computer program to implement any of the above methods.

[0009] One embodiment of this disclosure provides an image processing method, including: acquiring an image sequence containing multiple frame images and a transparency parameter corresponding to each pixel in the frame images; performing frame switching control on the image sequence based on a time interval parameter to determine the current frame image; and rendering background layer content and foreground layer content sequentially on a rendering canvas based on the current frame image and its corresponding transparency parameter to obtain a target preview image, wherein the foreground layer content includes the current frame image, and the transparency display of the foreground layer content is controlled based on the transparency parameter. In this way, during the image sequence preview process on the browser side, layered rendering and frame switching control reduce image processing overhead, improve the rendering efficiency and display accuracy of frames with transparency, help improve video memory resource usage, and reduce interactive response latency. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 A schematic diagram of a system architecture is shown in one exemplary embodiment of this disclosure;

[0012] Figure 2 A flowchart illustrating a method in one exemplary embodiment of this disclosure is shown; Figure 3 This diagram illustrates the background mode switching effect in one exemplary embodiment of the present disclosure. Figure 4 This diagram illustrates an apparatus configuration in one exemplary embodiment of the present disclosure. Figure 5 A schematic diagram of the structure of an electronic device is shown in one exemplary embodiment of the present disclosure. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0014] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0015] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise expressly specified.

[0016] It should be noted that the information (including but not limited to: user input information, such as information entered by the user into an input box), data (including but not limited to data used for analysis, stored data, and displayed data, such as context code, all code of the current project, service pressure corresponding to operations performed on all code of the current project, and code development status of the current project), and signals involved in the embodiments of this disclosure are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, the context code, operations performed on all code of the current project, and the service pressure and code development status involved in the operations in the embodiments of this disclosure are all obtained under full authorization.

[0017] An image processing method according to one embodiment of the present disclosure, such as Figure 2 As shown, the method may include: Step S210: Obtain an image sequence containing multiple frame images and the transparency parameter corresponding to each pixel in the frame images; Step S230: Based on the time interval parameter, perform frame switching control on the image sequence to determine the current frame image; Step S250: Based on the current frame image and its corresponding transparency parameters, render the background layer content and the foreground layer content sequentially on the rendering canvas to obtain the target preview image. The foreground layer content includes the current frame image, and the transparency display of the foreground layer content is controlled based on the transparency parameters.

[0018] According to one embodiment of this disclosure, during the image sequence preview process on the browser side, the image processing overhead is reduced by layered rendering and frame switching control, which improves the rendering efficiency and display accuracy of images with transparency, helps to improve the utilization of video memory resources and reduce interactive response latency.

[0019] The embodiments of this disclosure will now be further described.

[0020] In step S210, an image sequence containing multiple frame images and the transparency parameter corresponding to each pixel in the frame images are obtained. By pre-acquiring the image sequence containing transparency parameters, a complete data source can be provided for subsequent dual-scene layered rendering, ensuring that the transparency channel information is accurately transmitted to the rendering pipeline, laying the data foundation for precise transparency overlay and multi-background mode preview. For example, the system can scan and obtain multiple frame image files named sequentially from the file directory of a specified workspace, and organize these files into an image sequence in chronological order. Simultaneously, the system reads the transparency channel data corresponding to each pixel in each frame image file, loading the aforementioned color value information and transparency parameters together as a texture resource usable by the graphics processor, so that subsequent rendering processes can directly call upon it.

[0021] Optionally, the image sequence comprises multiple frame images arranged in chronological order, used to form a continuous animation and provide the data basis for frame-by-frame editing. Optionally, the image sequence may comprise multiple frame images arranged sequentially in chronological order, which are used to create a continuous visual animation effect during playback. In one implementation, the image sequence may be an independent image file exported through frame-by-frame rendering, or an intermediate result file generated by an image processing pipeline, and its file format may include, but is not limited to, portable network graphics formats. It should be noted that the number of frame images in the image sequence can be dynamically determined based on the actual animation duration and the preset frame rate. For example, a 2-second animation corresponding to 30 frames per second contains 60 frame images, or it may be any number of frame images acquired according to specific processing requirements. After loading, the aforementioned frame images can be organized into a preset frame array or directly combined into a composite image to adapt to different playback mode requirements. Specific implementations can be adaptively adjusted according to scene requirements.

[0022] Optionally, the transparency parameter is used to characterize the opacity of each pixel area to support accurate transparency blending calculations between the foreground and background layers during rendering.

[0023] Optionally, the transparency parameter can be stored in a texture format along with the color value data of the frame image, for example, recording the transparency value corresponding to each pixel using a pass-through transparency mode. During processing, this parameter will be passed to a custom shader to determine the visibility and blending weight of pixels during foreground layer rendering. Considering that visual effects sequence frames typically contain a large number of semi-transparent edge pixels, accurate acquisition of the transparency parameter can avoid black edge artifacts or incorrect background occlusion during subsequent rendering. For example, the transparency parameter can be stored in the alpha channel of the image file with 8-bit or 16-bit precision, or it can be mask data provided separately through an external configuration file, or it can be transparency information calculated by an algorithm during the image processing flow; this disclosure does not limit this.

[0024] In an optional implementation, the method further includes: in response to a frame editing instruction, adding the corresponding frame number to a deletion marker set and updating the current frame number to a neighboring valid frame number; wherein the frame editing instruction includes at least one or more of the following: a trim start region instruction, a delete single frame instruction, and a trim end region instruction. In this way, by combining frame editing instructions with a deletion marker set, frame deletion markers are implemented in memory instead of directly modifying disk files, making the editing effect immediately visible and supporting multi-level undo, effectively improving the flexibility and operational fault tolerance of frame-level interactive editing.

[0025] In one implementation, a user clicks the current frame thumbnail on the frame timeline at the bottom of the graphical user interface and triggers a delete single frame command. In response, the system adds the frame number corresponding to the current frame to the deletion mark set and updates the current frame number to the next valid frame number to its right, automatically shifting the focus to the unmarked subsequent frame. Further, if the user triggers a cropping start area command, the system adds the numbers corresponding to the current frame and all frames to its left to the deletion mark set and updates the current frame number to the first valid frame number to its right that has not yet been added to the deletion mark set. Similarly, if a cropping end area command is triggered, the system adds the numbers corresponding to the current frame and all frames to its right to the deletion mark set and updates the current frame number to the first valid frame number to its left that has not yet been added to the deletion mark set. Thus, through differentiated frame editing commands and an automatic jump mechanism to adjacent valid frames, the system achieves rapid location and flexible marking of the beginning, middle, and end segments of a visual effects sequence.

[0026] Optionally, the frame editing command is designed to receive different ranges of deletion operations from the user on the visual effects sequence frames in order to trigger the corresponding frame culling mark mechanism.

[0027] Optionally, frame editing commands may include, but are not limited to, the start-of-region trimming command, the delete-a-frame command, and the end-of-region trimming command. The start-of-region trimming command adds the frame numbers of the current frame and all frames to its left to the deletion marker set in batches, enabling rapid trimming of the beginning portion of the visual effects animation. The end-of-region trimming command adds the frame numbers of the current frame and all frames to its right to the deletion marker set in batches, enabling trimming of the end portion of the animation. The delete-a-frame command adds the number of the currently selected frame to the deletion marker set individually, removing isolated abnormal frames from the sequence. It should be noted that the above frame editing commands can be triggered via specific function buttons at the bottom of the user interface, keyboard shortcuts, or context menu options; this disclosure is not intended to limit this. These commands can be triggered independently or combined within an editing session; for example, the start-of-region trimming command can be executed first to remove redundant starting frames, followed by the delete-a-frame command to remove intermediate flickering frames. In this way, operators can flexibly choose strategies of local removal or batch cropping based on the quality distribution characteristics of the visual effects sequence frames, effectively enhancing the coverage and granular control capabilities of frame-level editing.

[0028] Optionally, in addition to commands for cropping the start area, deleting a single frame, and cropping the end area, frame editing commands can also include range marking commands triggered by the user dragging a selection box on the timeline to select a range of consecutive frames, shortcut marking commands triggered by key combinations, or batch marking commands triggered by selecting multiple non-consecutive frames on the timeline. Furthermore, when the user triggers the cropping start area or cropping end area command, the system can display the affected frame thumbnails on the graphical user interface with different visual states, such as reducing transparency or overlaying a highlight color, to intuitively reflect the range of frames about to be added to the deletion mark set, thereby reducing the risk of accidental operation.

[0029] Optionally, the deletion mark set is used to record the sequence number of the frame to be deleted specified by the frame editing instruction in memory, so as to temporarily store the marking results of the editing operation.

[0030] Optionally, the deletion marker set is used to temporarily store the sequence number of the frame to be deleted specified by the frame editing instruction in memory. Its data structure can be a set data structure, a bitmap index array, or a Boolean marker array, etc. In one embodiment, the deletion marker set uses a set data structure. Whenever a frame editing instruction is triggered, the corresponding sequence number of the operated frame is written into this set. Due to the uniqueness of elements in the set data structure, redundant records are not generated when the same frame is marked repeatedly. In another embodiment, the deletion marker set uses a Boolean marker array. The length of the array is consistent with the total number of frames in the image sequence. The array index value corresponds to the frame sequence number. When a specific frame is marked for deletion, its corresponding array element is set to true. It should be noted that the deletion marker set only records index identifiers in memory and does not involve any modification to the original frame image file itself, thus ensuring that the marking operation remains only at the logical level. Furthermore, the deletion marker set can be synchronized with the display status of the timeline. For example, frames that have been added to the deletion marker set are presented on the timeline in a gray semi-transparent or deleted marker form, so that operators can intuitively identify the range of frames currently in the deletion state. In this way, by establishing a lightweight memory marking intermediate layer, coupled with graphical status feedback, the visibility and determinism of frame editing operations are effectively enhanced.

[0031] Optionally, the nearest valid frame number is used to automatically jump the focus to the next unmarked frame after a frame is deleted, in order to maintain the continuity of sequence browsing.

[0032] Optionally, the operation of updating the current frame number to a neighboring valid frame number can be performed immediately after the user triggers a frame editing command. As one possible implementation, when the user triggers a single-frame deletion command, the system can first search for the next frame number not added to the deletion mark set to the right of the current frame as the new current frame; if no valid frame exists to the right, it searches for the previous valid frame to the left. In another implementation, when a trimming start area command is triggered, since the current frame and its left-hand frames have already been added to the deletion mark set, the system can search for the first unmarked valid frame to the right as the new current frame; when a trimming end area command is triggered, it searches for the first unmarked valid frame to the left. It should be noted that the aforementioned neighboring valid frame number refers to the frame number logically adjacent to the current operation position and not added to the deletion mark set; their physical index interval may be greater than one due to the presence of multiple marked frames in between. Furthermore, if no valid frames exist in either direction before or after the current frame number, the system can reset the current frame number to its initial number or keep it null, and wait for the user to trigger a new frame editing command or switch to an unmarked area. In this way, the automated playback focus correction mechanism effectively avoids the abnormal state of having no valid frames to choose from after a frame deletion operation.

[0033] In an optional implementation, in response to a frame editing command, before adding the corresponding frame number to the deletion marker set, the method further includes: creating a state snapshot containing the current frame array, the deletion marker set, and the current frame number, and pushing the state snapshot onto a preset undo stack. The state snapshot is generated based on a shallow copy of the current frame array and the deletion marker set to share the underlying data storage space. When the number of snapshots in the undo stack exceeds a preset threshold, the earliest snapshot data is removed, and the video memory resources occupied by texture objects no longer referenced in the earliest snapshot data are released. Thus, by using shallow copy snapshots and undo stack capacity management, multi-level undo of frame editing is achieved with extremely low memory overhead, and redundant texture video memory is automatically cleaned up, avoiding browser memory overflow and preview stuttering.

[0034] In one implementation, when a user triggers the deletion of the current frame through the interactive interface, the system first extracts the current frame array reference, the deletion mark set reference, and the current frame number value before moving the frame number into the deletion mark set, constructing a state snapshot object, and pushing this object onto an undo stack with a depth of 50. Since snapshots are generated using a shallow copy method, the frame array and the deletion mark set share the reference address of the underlying texture object, and the memory usage of a single snapshot is controlled to the tens of bytes level. As the editing operation continues, when the number of snapshots in the undo stack reaches the preset capacity limit, the system removes the earliest snapshot record pushed onto the stack and iterates through the frame array in that snapshot, destroying texture objects that are no longer referenced by the current state or other snapshots, thereby releasing the graphics processor memory resources they occupy and ensuring memory stability during long-term editing processes.

[0035] Optionally, a state snapshot is used to capture the memory state before frame editing, including at least the frame array, deletion marker set, and current frame number, supporting operation rollback. Optionally, as a lightweight historical state recording mechanism, the state snapshot's data structure can be flexibly configured according to the type of editing operation. In one implementation, when a user triggers different types of frame editing commands such as trimming the start area, deleting a single frame, or trimming the end area, the system will collect key state variables in the current working environment to generate a snapshot before executing the actual deletion action. This snapshot includes at least a reference to the current frame array, a reference to the deletion marker set, and a numerical copy of the current frame number. The current frame array records the access handles of all loaded texture objects, the deletion marker set records the frame numbers that have been logically removed, and the current frame number indicates the real-time position of the playhead in the sequence. By encapsulating these three types of information into a unified state snapshot and pushing it onto the undo stack, the system can completely restore the editing state before the operation when the user triggers an undo command, including re-establishing the display eligibility of the deleted frame and restoring the original docking position of the playhead, thereby achieving precise rollback support for erroneous operations or repeated adjustments. Furthermore, the timing of snapshot generation can be extended to key interactive nodes such as adjusting frame playback order, modifying transparency blending parameters, or switching background rendering modes, to provide more comprehensive context protection.

[0036] Optionally, the breadth of content in the state snapshot can be adaptively expanded based on system memory policies or the complexity of the editing scenario. Besides forcibly generating a snapshot before making changes to the deletion marker set, snapshot recording can also be automatically triggered before key interaction nodes such as user adjustments to frame playback order, modification of transparency blending parameters, or switching of background rendering modes. The snapshot can also include non-texture configuration information such as the current playback mode identifier, frame rate setting, and the uniform variable state of the background shader, restoring the previous visual presentation settings when an undo operation is performed, avoiding preview flickering or context loss due to parameter jumps. It should be noted that the specific field composition of the snapshot is not limited to the above examples; developers can add or remove fields according to actual pipeline needs, and this disclosure does not impose any limitations on this.

[0037] Optionally, a shallow copy is used to generate reference-level copies of complex data structures in the snapshot, sharing the underlying storage space to reduce memory usage. Optionally, considering that the resolution of a single frame in a VFX sequence is often high, the raw storage overhead of each frame's texture in the graphics processor's video memory can reach several megabytes. If a deep copy is used to generate state snapshots, each level of undo requires copying the entire frame array and all the texture objects it references. Taking a 60-frame sequence as an example, a single snapshot could occupy hundreds of megabytes of memory, and the accumulated overhead would quickly exceed the browser's memory capacity. To avoid this risk of memory crashes due to the retention of historical state, this embodiment uses a shallow copy strategy for both the current frame array and the deletion marker set when generating state snapshots. A shallow copy only copies the reference addresses and metadata of the array container, while the texture objects encapsulated inside the array share the same underlying data storage space, and their size does not increase with the number of snapshots. In this way, the memory usage of a single state snapshot can be compressed to the tens of bytes level, allowing 50 or even more levels of undo history to reside safely in the browser's memory without crowding out already strained graphics rendering resources. In other words, shallow copying establishes a scalable balance between memory efficiency and undo depth.

[0038] Optionally, while shallow copying offers memory advantages, it also requires appropriate assignment semantic management strategies to ensure the correctness of undo / rollback. In one implementation, after a shallow copy, the current frame array and the deletion marker set are stored in the snapshot as reference pointers to the same set of texture object instances. When the user performs an undo operation and pops the snapshot from the stack, the system directly reassigns the references from the snapshot to the current working state variable, thus instantly reverting the current frame array to the object set pointed to by the previous version. It should be noted that since the snapshots in the undo stack share texture instances with the actual working state, when the system performs a commit operation and resets the undo stack, it should ensure that the texture objects in the popped snapshot can still be correctly referenced by the current working state or subsequent snapshots, avoiding premature release of still-used video memory resources. Furthermore, if subsequent implementations introduce add, delete, or modify operations on frame array elements, a write-on-write copy or deep copy isolation of the array is required before modification to prevent unexpected state changes from being observed in historical snapshots, thereby ensuring the rigor of the undo chain.

[0039] Optionally, a preset undo stack is used to cache snapshots in order, and the stack depth is controlled based on a preset threshold to balance backtracking capability and memory overhead.

[0040] Optionally, the undo stack is configured as a last-in-first-out (LIFO) cache container, storing state snapshots sequentially according to the order in which edit operations occur. In one implementation, the undo stack can be implemented using a linear array or a doubly linked list data structure, with the top pointer always pointing to the latest snapshot record. When a user performs multiple frame deletion operations consecutively in the graphical user interface, the snapshot triggered before each deletion is pushed onto the top of the stack, forming a traceable operation history chain. Simultaneously, the system continuously monitors the cumulative number of snapshots in the stack. Once this number reaches a system-preset capacity threshold, the earliest snapshot record stored at the bottom of the stack is automatically removed to maintain a relatively constant stack depth. This threshold can be dynamically adjusted based on the current browser's available memory capacity, the total number of frame sequences, and the reference size of a single snapshot. The purpose is to prevent unlimited historical accumulation from exhausting the terminal device's memory resources, thereby ensuring that users have sufficient undo steps while maintaining the long-term stability of system operation. If a memory shortage alarm occurs, the threshold can also be temporarily lowered to prioritize the smoothness of real-time preview.

[0041] Optionally, the texture object, as a memory mapping entity of the frame image in the graphics processor, releases memory resources during snapshot cleanup based on the reference status.

[0042] Optionally, a texture object is the specific unit carrying frame image data in the graphics processor's video memory. Whether it's an independent texture in sequence frame mode or a composite texture in sprite sheet mode, hardware-accelerated rendering requires video memory allocation. Since historical snapshots in the undo stack share texture references within the frame array through shallow copies, when a historical snapshot is removed from the stack due to reaching a capacity threshold, some texture objects referenced by that snapshot may no longer be needed by the current working state or other remaining snapshots. To prevent these texture objects that have lost their reference support from continuing to meaninglessly occupy scarce video memory resources, the system performs a reference check after removing the earliest snapshot: traversing the frame array in that snapshot and checking whether each texture object still appears in the current frame array or other uncleaned snapshots. If a texture object has no living references, its dedicated video memory release logic is called to immediately destroy the bound video memory buffer and return the released capacity to the browser's graphics rendering context. Through this reference-counting automatic cleanup mechanism, the system can effectively reclaim video memory during continuous frame editing, preventing video memory leaks or preview frame rate drops caused by long-term accumulated historical state remnants.

[0043] In an optional implementation, the method further includes: in response to an undo command, popping the latest state snapshot from a preset undo stack; and restoring the corresponding frame array, deletion marker set, and current frame number based on the popped state snapshot. Thus, by triggering the popping of a snapshot from the undo stack and restoring the editing state via an undo command, not only can a quick rollback to the previous state be achieved after accidental deletion or trimming, but it also avoids reloading texture data, significantly improving the fault tolerance efficiency of frame sequence editing. In one implementation, when an operator accidentally deletes a key transition frame while editing using the frame timeline, and then presses a preset undo shortcut key, the system, in response to this undo command, immediately pops the most recently pushed state snapshot from the top of the undo stack in memory. Based on this snapshot, the frame array references, deletion marker set, and current frame number are instantly restored to the records before the operation. The thumbnail corresponding to the deleted frame is restored from semi-transparent gray to normal display on the timeline, and the preview screen synchronously jumps back to the target frame before the operation. The entire restoration process does not require disk access and the response time is less than a single rendering frame cycle.

[0044] Optionally, the undo command is used to receive a user's rollback request to trigger the popping of the latest state snapshot from the undo stack and the restoration of the frame editing state.

[0045] Optionally, the undo command can be a combination key signal sent by the operator via a keyboard input device, such as a system-level shortcut formed by pressing the Ctrl key and the Z key simultaneously; the undo command can also be a touch event generated by the operator clicking a virtual undo button in the graphical user interface, which can be represented as a left-pointing arrow icon located in the upper left corner of the timeline panel or the bottom toolbar, with a semi-transparent background and a hover highlight effect; the undo command can also be a specific gesture trajectory captured by an external touch screen or gesture recognition device, such as a light swipe to the right in the editing panel area being interpreted as an undo request. It should be noted that the above-mentioned triggering forms of undo commands are only examples, and this disclosure is not intended to limit the input method of undo commands. In actual hardware environments, adaptation can be made according to the specific interactive device attributes or software environment. Considering that frequent frame deletion and cropping operations during frame-level editing can easily lead to accidental touches, and that operators have high expectations for the response speed of rollback operations, as a possible implementation method, the aforementioned undo command, after being responded to by the system, does not directly operate on disk files or rebuild disk directories. Instead, it only acts on the undo stack data structure residing in memory, prioritizing the extraction of the most recently pushed state snapshot from the top of the stack. This snapshot retains the frame array references previously generated through shallow copying, the copy of the deletion mark set, and the current frame sequence number at the time of the operation. Based on this snapshot, the system replaces the entire running state in memory with the previously recorded state, thereby eliminating the impact of accidental operations immediately without triggering any input / output overhead.

[0046] Optionally, after a successful undo command, the system pops the undo stack in a last-in-first-out (LIFO) order to ensure that the most recent edit is undone first. In the state snapshot retrieved from the stack, the frame array references directly point to the texture objects previously loaded into the graphics processor's memory. Therefore, during restoration, there's no need to re-execute disk reads and texture uploads; the texture object references in memory and memory usage remain unchanged. After the deletion marker set is replaced with a historical copy from the snapshot, the playback engine automatically re-filters valid frame indices in the next frame's progression logic. The thumbnails corresponding to the frames whose deletion operations have been undone revert from semi-transparent gray to normal display in the timeline panel, and the current frame number is synchronously rolled back to the value recorded in the snapshot, causing the preview in the foreground rendering scene to jump directly back to its pre-operation display position. Furthermore, if multiple erroneous operations occur consecutively or the user wishes to revert to an earlier state, the operator can continuously trigger undo commands. The system will then sequentially revert to earlier state snapshots from the undo stack until the stack is empty or a preset level limit is reached. For undo commands triggered again when the undo stack is already empty, the system can either silently ignore the request or output visual or auditory boundary prompts. This embodiment of the present disclosure does not limit the scope of the request.

[0047] In an optional implementation, the method further includes: in response to a commit command, deleting the frame image files corresponding to the frame sequence numbers in the deletion mark set, and renaming the remaining frame image files to obtain a set of consecutively numbered files; reconstructing the composite image based on the consecutively numbered file set and saving it to a preset directory; clearing the deletion mark set and the preset undo stack, and resetting the current frame sequence number to its initial value. In this way, by using a delayed commit mechanism to batch persist memory editing marks to disk and automatically reconstruct the composite image, redundant operations caused by frame-by-frame modification are avoided, significantly improving the editing efficiency and data consistency of the frame sequence.

[0048] In one implementation, after the user completes a series of frame deletion operations and confirms the effect, they click the submit button on the interface to trigger a submit instruction. The system then reads the set of frame numbers to be deleted from memory, locates the corresponding frame image file in the workspace directory, and performs physical deletion. Subsequently, the remaining files are renamed in batches according to the consecutive numbering rule to obtain a frame sequence without gaps. Then, the synthetic image reconstruction module is called to regenerate the texture based on the renamed consecutive numbered file set and write it to the target directory. Finally, the editing mark and undo stack are cleared, the current frame is reset to the first frame, the preview window is automatically refreshed, and the editing loop is completed.

[0049] Optionally, the commit command is used to batch implement the delayed edit marks in memory as disk file changes and trigger the subsequent rebuild process.

[0050] Optionally, the submit command can be a button event triggered by the user clicking the mouse in the graphical user interface, such as clicking a graphical button marked as submit or apply; it can also be a system-level input signal triggered by a keyboard shortcut (such as the Ctrl+Enter key combination); or it can be a remote call command issued by an external automated processing flow through a standard application programming interface. The timing of this command is strictly configured to occur only after the user has confirmed that all editing operations are correct, thus ensuring that the system maintains the original state of the disk files during the initial deletion and undo phases, guaranteeing the safety of the original materials. After the submit command is responded to, the system enters a transaction-locked state, rejecting re-entrant editing requests until the disk read / write and reconstruction processes are complete, preventing inconsistencies between the file system state and the memory state caused by concurrent operations. It should be noted that the specific form of the submit command can be adaptively set according to different application scenarios. For example, in a local standalone preview tool, it could be a confirmation button at the bottom of the interface, while in an integrated intelligent processing pipeline, it could be a callback signal automatically issued after the completion of an external enhanced processing node. This disclosure does not limit its specific trigger source and interaction form.

[0051] Optionally, the submit command can carry additional verification parameters after being triggered, such as a user identity token or operation timestamp, to trace editing responsibility and prevent duplicate submissions in multi-user collaborative scenarios. The system can perform a preliminary validity check on the received submit command. If an incomplete undo stack rollback operation is detected, the response to the submit command is delayed until the stack state stabilizes, thereby avoiding disk synchronization conflicts during state recovery. Furthermore, the response process for the submit command can be configured in asynchronous mode, meaning that the user can continue browsing the preview screen after triggering the command, while a background thread sequentially completes the file deletion, renaming, and reconstruction tasks, and informs the user of the results through interface prompts or event notifications after processing, thereby improving the smoothness of human-computer interaction when submitting large frame sequences.

[0052] Optionally, the frame image file deletion operation aims to physically remove the corresponding numbered frame image files from the disk based on the set of markers in memory. Optionally, the specific execution method of the frame image file deletion operation can be: the system traverses each frame number recorded in the deletion marker set in memory, locates the corresponding frame image file in the preset path of the workspace based on the number, and calls the underlying interface of the operating system to directly remove it; to avoid irreversible loss due to accidental deletion, in another possible implementation, the above operation can also first copy the marked frame image files to a preset backup directory, wait for the user to confirm again within a set time window, and then perform the actual physical removal. When performing deletion, the system usually processes them sequentially in descending order of frame number to avoid misaligning the index positions of subsequent files in the directory due to deleting the preceding files first, thus ensuring the consistency of the order in the subsequent renaming stage. This deletion operation only occurs in response to the submission command; all previous deletion markers only reside in the memory data structure and do not touch the original disk data, thus ensuring the integrity of the original visual effects materials is not damaged throughout the preview and editing stages.

[0053] Optionally, the renaming operation aims to perform batch number correction on the remaining frame image files to restore a continuous and ordered naming structure.

[0054] Optionally, the renaming operation includes: scanning all remaining frame image files in the current frame directory, reading the original sequence number field in their filenames and sorting them in ascending order of value, then assigning new consecutive numbers starting from the initial number, and synchronously updating the naming records and internal reference handles in the file system. This operation can be completed using the operating system's native batch naming interface or by calling a cross-platform file operation library; this disclosure does not limit this. Through the above renaming operation, the set of frame images that originally had gaps in the numbering sequence due to deletion operations is restored to a continuous sequence without gaps. This not only facilitates the subsequent playback module to directly index and read the corresponding texture by sequence number, but also allows the reconstruction and synthesis image module to directly perform simple integer division and modulo operations based on the file sequence number when calculating the mapping relationship between frames and texture meshes, thereby reducing the logical complexity and error probability in the reconstruction stage.

[0055] Optionally, the consecutively numbered file set contains all remaining frame image files after sequencing, serving as the input source for the reconstructed composite image. Optionally, the filenames of each frame image file in the consecutively numbered file set can be organized in a format of a fixed prefix followed by a four-digit decimal number, or in a format of a sequence name followed by a three-digit number followed by an extension. Alternatively, a combination of timestamp and sequence number encoding can be used. This disclosure does not limit the specific naming template or number system rules. This file set serves as the sole input source for the reconstructed composite image, requiring its internal numbering to start from an initial value without any skipped numbers. This ensures that the reconstruction algorithm can directly use the file sequence number as the basis for integer division and modulo operations on the row and column coordinates when calculating the row and column positions of each frame image in the composite texture. If the system detects discontinuous numbering during scanning, it can automatically perform a verification step before entering the reconstruction stage, logging missing number intervals or automatically filling in blank placeholder frames of a preset size, thereby preventing image misalignment or temporal breaks in the subsequent texture coordinate sampling stage after reconstruction.

[0056] Optionally, the reconstructed composite image aims to regenerate the composite texture based on a sequentially numbered set of files to synchronously update the display data source of the preview system. Optionally, the process of reconstructing the composite image may include: sequentially reading all frame image files in the sequentially numbered set, rearranging each frame image according to preset row and column layout parameters and writing them to a new texture buffer object, finally outputting a single Sprite Sheet texture image and saving it to a preset directory in the workspace; in scenarios where the original sizes of the frame images are inconsistent, the reconstruction process may also first call a rectangular filling algorithm to normalize the size of each frame or add transparent boundary padding. After reconstruction, the system will automatically call the texture release interface to destroy the video memory resources occupied by the old Sprite Sheet texture object in memory, load the newly generated texture object as the data source for the current playback sequence, and simultaneously reset the texture coordinate scaling ratio and offset. Through the above mechanism, after the user performs deletion and submission operations, there is no need to manually switch to external tools to re-export or offline generate the Sprite Sheet; the preview system can complete texture updates and first frame playback within milliseconds, forming an instant closed loop from editing to preview.

[0057] Optionally, when reconstructing the composite image, if the number of frame images exceeds the preset capacity threshold of a single composite texture (e.g., when the maximum size of a single texture is limited to 4096×4096 pixels and the resolution of a single frame is 512×512 pixels, the theoretical maximum per page is 64 frames), the system can store the frame images in batches as multiple paged composite images, maintaining row and column grid alignment within each page. In this case, in addition to calculating the row and column arrangement within each page, the reconstruction module also needs to dynamically determine the corresponding target page number and page sampling parameters based on the current logical frame number, thereby enabling the texture coordinate animation logic to support dynamic switching based on the page index during playback. The paging strategy can be evenly divided according to the time sequence or non-evenly divided based on a memory optimization strategy. This disclosure does not limit the specific settings of the paging algorithm and capacity threshold. This paging reconstruction mechanism ensures that large-scale sequences of hundreds or even thousands of frames can still be organized in a graphics processor-friendly single-page texture manner after editing and cropping, avoiding hardware sampling limitations, memory fragmentation, or rendering pipeline anomalies caused by excessively large single texture sizes.

[0058] In step S230, frame switching control is performed on the image sequence based on the time interval parameter to determine the current frame image. This introduces time increment and timing control during playback, ensuring that each frame changes accurately at a preset rate and allowing the rendering engine to adaptively adjust the progression rhythm. This effectively avoids frame skipping issues caused by frame rate fluctuations, ensuring a smooth and continuous preview.

[0059] For example, in one implementation, the animation engine obtains the time difference between two adjacent callbacks as a time interval parameter through the browser animation frame request interface, and compares it with the reciprocal of the preset frame rate. When the accumulated time reaches or exceeds the threshold, the frame switching control logic is triggered to advance the current frame number. If the current playback is in a back-and-forth swing mode from forward to the end, the playback direction is reversed and the last frame is taken as the current frame image. In the standard loop mode, the modulo operation is used to wrap back to the first frame to determine the frame content that needs to be displayed on the rendering canvas.

[0060] Optionally, the time interval parameter is used to control the display interval between two adjacent frames, which can be dynamically adjusted according to the target frame rate.

[0061] Optionally, the time interval parameter can be a numerical measure of the actual elapsed time between two adjacent screen refreshes, such as the difference between the callback timestamps of two consecutive frames obtained through a high-precision time interface provided by the browser. Considering that the preview system needs to maintain consistent playback timing on devices with different performance levels, as a possible implementation, the aforementioned time interval parameter can be accumulated and compared with the standard duration of a single frame corresponding to a preset frame rate. When the accumulated amount reaches or exceeds the standard duration, a frame advance operation is triggered, and the accumulated amount is deducted accordingly. This ensures that a relatively stable playback speed is maintained even when the frame rate fluctuates, avoiding frame skipping or fast-forwarding due to device stuttering. It should be noted that the above method for obtaining and comparing the time interval parameter is only one example. In actual implementation, fixed step sizes or other timing strategies based on video synchronization signals can also be used, and this disclosure is not limited to this.

[0062] Optionally, frame switching control is used to iterate frames in an image sequence in an orderly manner according to time interval parameters and playback modes to determine the content of the next frame to be rendered. Optionally, frame switching control can be a logical processing procedure for performing orderly iterations between frames in an image sequence, supporting at least two different playback strategies: standard loop mode and back-and-forth swing mode. In standard loop mode, the current frame number continuously increments according to the time interval parameter, and automatically wraps back to the starting position when it reaches the end of the image sequence. In back-and-forth swing mode, when the frame number reaches the boundary, the playback direction is reversed, performing forward and reverse playback operations sequentially, thereby eliminating the abrupt changes caused by inconsistencies between the first and last frames. Furthermore, frame switching control can also be used in conjunction with a deletion marker set, automatically checking whether the next frame is marked for deletion each time the sequence is advanced. If so, it continues to advance until a valid neighboring frame is located, and this valid frame is determined as the current frame image to be rendered, thus ensuring the continuity of the edited preview.

[0063] Optionally, the current frame image refers to the target frame content that needs to be sent to the rendering pipeline for foreground layer overlay display after the frame switching control is completed. Optionally, the current frame image can refer to the target frame content that needs to be sent to the rendering engine for foreground layer overlay display after each frame switching control is completed; its specific representation depends on the current playback mode of the system. In sequence frame mode, the current frame image is represented as an independent texture object extracted from a preset frame array. This texture object is bound to a foreground material and sent to the graphics processor for rendering. In sprite graph mode, the current frame image is represented as a local sampling window on a single composite texture. The texture scaling ratio and offset are pre-calculated to locate the corresponding frame's grid area. It should be understood that the current frame image in the above two modes is organized differently in video memory, but both carry the same target pixel data. The system can dynamically switch according to the user's different needs for detail or memory usage. This disclosure is not limited to a specific frame storage format.

[0064] In an optional implementation, frame switching control is performed on the image sequence based on a time interval parameter to determine the current frame image. This includes: acquiring frame images from the image sequence and determining a playback mode; in a first playback mode, loading each frame image as an independent texture object and switching the currently displayed texture object frame by frame based on the time interval parameter to determine the current frame image; in a second playback mode, merging multiple frame images into a single composite image and determining the current frame image by modifying the sampling position of the composite image based on the time interval parameter and a preset sampling parameter. Thus, by switching independent textures frame by frame in the first playback mode and modifying the sampling position based on a single composite image in the second playback mode, both frame-by-frame editing precision and memory overhead control are balanced, effectively improving the response speed and smoothness of real-time previewing of large-scale sequence frames on the browser side.

[0065] In one implementation, after acquiring an image sequence containing sixty frames, the system determines to adopt a first playback mode, loading each frame image as an independent texture object into the graphics processor. During playback, the currently displayed texture object is switched frame by frame based on a time interval parameter to determine the current frame image. In another implementation, for the same sequence, the system determines to adopt a second playback mode, merging the sixty frame images into a single composite image and loading it into the graphics processor. By modifying the sampling position of the composite image based on the time interval parameter and a preset sampling parameter, the current frame image is determined, achieving frame content switching within the same texture.

[0066] Optionally, the playback mode is used to distinguish the loading and switching methods of frame images, so as to dynamically select between the first playback mode and the second playback mode according to the needs of the scene.

[0067] Optionally, the above playback modes are designed to differentiate and select the loading method and switching mechanism of frame images based on different needs during real-time preview. This playback mode can include two forms: a first playback mode and a second playback mode. The first playback mode is suitable for editing scenarios with a relatively small number of frames and requiring frame-by-frame precision control, while the second playback mode is suitable for smooth preview scenarios with a large number of frames. It should be noted that the above classification of playback modes is only one example. In actual implementation, mode switching can be automatically triggered based on the size and total number of frame images or the current browser's video memory usage, or it can be manually specified by the user through interface controls. The purpose is to improve the overall efficiency and user experience of real-time preview of sequential frames on the browser side by flexibly selecting appropriate frame switching strategies at different stages. This ensures the granularity and responsiveness of frame-by-frame parameter tuning during the editing stage, while significantly reducing the frequency of texture binding and video memory pressure on the graphics processor during the preview stage.

[0068] Optionally, the first playback mode loads each frame image as an independent texture object and switches the currently displayed texture object frame by frame based on a time interval parameter to determine the current frame image. Optionally, the first playback mode is suitable for processing stages where the total number of frame images is relatively small and the accuracy requirements for single-frame content are high. In this mode, each frame image is loaded as a corresponding independent texture object, and the currently displayed texture object can be switched frame by frame according to the sequence number based on the time interval parameter, thereby determining the current frame image to be rendered to the foreground layer. It should be noted that the above-mentioned method of loading each frame independently not only ensures the integrity and accuracy of single-frame texture data, facilitating frame-by-frame interactive editing operations, but also avoids pixel edge compression or color information loss that may occur during image merging. Furthermore, the texture objects in this mode can be stored in a preset data structure for quick indexing after loading, and the corresponding texture object can be directly assigned to the foreground material during switching, thereby ensuring accurate sampling and color restoration of the rendering pipeline at frame boundaries. In one possible implementation, when the total number of frames in the sequence is less than a preset threshold, the system can automatically select the first playback mode to provide users with frame-by-frame precise control capabilities during the editing stage.

[0069] Optionally, the second playback mode aims to merge multiple frames into a single composite image and determine the current frame image by modifying the sampling position of the composite image based on the time interval parameter and preset sampling parameters.

[0070] Optionally, the second playback mode can pre-merge multiple frame images into a single composite image, and achieve zero-overhead switching between different frames by modifying the texture sampling position of the composite image. In one specific implementation, the single composite image can be a multi-frame stitched texture organized in a row-column grid manner, where each grid unit corresponds to one frame image; the system can load the single composite image as a unified texture object, and calculate the corresponding row and column position information based on the current frame number and the number of rows and columns, thereby determining the texture scaling ratio and texture offset in the preset sampling parameters. The texture scaling ratio can represent the aspect ratio of a single frame image in the composite image, and the texture offset can locate the starting coordinates of the target frame image in the texture coordinate system. Furthermore, the vertical axis of the texture coordinate system can be opposite to the vertical axis of the image coordinate system to achieve automatic correction of the difference between the image storage direction and the texture sampling direction. In this way, the graphics processor only needs to update a set of sampling parameter values ​​each time a frame needs to be switched without rebinding the texture object, thus avoiding frequent graphics processor texture switching overhead.

[0071] Optionally, the row and column arrangement of a single composite image in the second playback mode can be flexibly determined based on the total number of frame images and the size of a single frame. For example, for a sequence of sixty frames with a single frame size of 1024×1024 pixels, they can be stitched together into a single composite image using a 6-column, 10-row grid; for a sequence of 24 frames, they can be stitched together using different grid arrangements such as 4 columns and 6 rows or 6 columns and 4 rows. This disclosure does not limit the specific row and column ratio. During runtime, the system obtains a horizontal index by taking the modulo of the column number based on the current frame number, and a vertical index by dividing the column number by the integer part of the column number. It then calculates the texture offset and texture scaling ratio to locate the target mesh cell. To avoid sampled pixels crossing the boundaries of adjacent mesh cells due to floating-point precision errors, boundary constraints can be used during shader sampling, or the sampling range of a single mesh cell can be appropriately reduced. This not only ensures the accuracy and stability of frame switching but also enables smooth previewing of large-scale sequence frames with near-zero latency on the browser side.

[0072] Optionally, the preset sampling parameters are determined based on the row and column layout parameters of the frame images in the image sequence, including at least the texture scaling ratio and texture offset, used to locate the sampling position of the current frame image in a single synthesized image. Optionally, the preset sampling parameters may include the texture scaling ratio and texture offset. The texture scaling ratio can be determined based on the number of columns and rows in a single synthesized image. For example, dividing the horizontal and vertical unit lengths in the texture coordinate system by the number of columns and rows respectively yields the relative width and height ratio occupied by a single frame image in the synthesized texture. The texture offset can be calculated based on the current frame number and the number of rows and columns. The horizontal offset can be obtained by taking the modulo of the current frame number and dividing by the number of columns, and the vertical offset can be obtained by dividing the current frame number by the number of columns, rounding down, subtracting the integer value from the total number of rows, and then dividing by the number of rows. Thus, by multiplying the original texture coordinates by the texture scaling ratio and adding the texture offset, the pixel region of the corresponding frame image in a single synthesized image can be accurately mapped. It should be noted that the above formula for calculating the preset sampling parameters is only an example. In actual implementation, it can be adaptively adjusted according to the arrangement direction of the synthesized image, the pixel alignment method, or the boundary filling strategy to ensure the accuracy of the sampling position and the integrity of the frame content display.

[0073] In an optional implementation, in the first playback mode, each frame image is loaded as an independent texture object, including: loading each frame image as an independent texture object sequentially according to its number based on the image sequence, and storing it in a preset frame array; configuring the sampling filtering method of each texture object to the nearest neighbor sampling mode; and extracting the corresponding texture object from the preset frame array as the current foreground content based on the current frame number. In this way, by establishing a preset frame array and loading independent texture objects sequentially, combined with the nearest neighbor sampling mode, it can be ensured that the visual effects sequence maintains clear pixel edges during frame-by-frame preview, avoiding interpolation blurring and facilitating precise verification of single-frame details during the editing stage.

[0074] For example, in one implementation, after receiving a visual effects sequence containing sixty frames, the system loads each frame sequentially as an independent texture object and stores them in a preset frame array named `frames`. Then, the sampling filtering method for each texture object is uniformly configured to nearest neighbor sampling mode to disable interpolation calculations. When the animation controller advances the current frame number to frame 25, the system extracts the texture object with index 24 from the preset frame array and sends it as the current foreground content to the foreground scene for rendering. Optionally, the preset frame array is used to store the independent texture objects of each frame sequentially to support fast extraction based on frame number.

[0075] Optionally, the aforementioned preset frame array can be a contiguous linear array structure or a hash table structure that supports fast indexing. Each array slot corresponds one-to-one with the sequence number of the image sequence, and the texture object stored in the slot is independent of the pixel data of the corresponding frame image; that is, the slots do not share texture storage space. Considering the frequent random jumps and frame-by-frame stepping requirements during sequence frame preview, using a preset frame array mapped by sequence number allows the system to directly use the current frame number as the index to complete the addressing, thereby keeping the time complexity of texture lookup at a constant level. Furthermore, the texture objects in this array can adopt a lazy loading strategy, that is, the texture upload operation is only performed when the corresponding frame is accessed for the first time, thereby reducing the video memory usage and bandwidth pressure during the initial loading stage; or, if video memory is sufficient, the texture upload of all frame images can be completed at once during the front-end initialization stage, thereby eliminating asynchronous loading delays during playback and ensuring the continuity of high frame rate preview. It should be noted that the aforementioned preset frame array is not only applicable to storing texture objects in frame-by-frame sequence mode, but in other embodiments, it can also be used as a container for temporarily storing paged composite images or multi-resolution texture sets, and this disclosure does not limit it in this regard.

[0076] Optionally, the nearest neighbor sampling mode disables texture sampling interpolation, allowing pixel colors to be directly taken from the nearest target pixel to maintain sharp image edges. Optionally, the aforementioned nearest neighbor sampling mode corresponds to the processing method in the graphics processor's texture sampling process that selects the source pixel closest to the target sampling point as the output color. Since visual effects sequence frames typically contain a large number of semi-transparent edges that need to be accurately displayed, as well as subtle pixel-level lighting effects, if linear interpolation sampling mode is used, the boundary pixels of the semi-transparent areas will mix with adjacent pixels, resulting in ghosting or blurry visual artifacts during animation playback, making it difficult for artists to accurately judge the quality of transparency cutout. By configuring the sampling filtering method of texture objects to nearest neighbor sampling mode, the system can strictly maintain the original color value of each pixel in the input image when processing non-integer scaling or playback based on the original resolution, avoiding the introduction of additional color mixing, thereby ensuring that high-detail areas such as hair strands and particle edges present clear and sharp geometric contours in the preview image. Furthermore, in some implementations, this mode can also work in conjunction with the pixel transparency threshold judgment logic, so that pixels with transparency values ​​lower than a preset threshold are accurately discarded, thereby preventing unexpected semi-transparent pixels generated by interpolation from erroneously obscuring the background layer content.

[0077] Optionally, the current foreground content is a texture object extracted from a preset frame array based on the frame number, used as the image content of the current frame in the foreground scene. Optionally, the aforementioned current foreground content can be a single-frame texture object directly indexed from the preset frame array based on the current frame number, or it can be a texture reference remapped from the remaining valid frames after performing frame editing operations. In a specific implementation, when the playback controller maintains the standard loop mode, the current frame number increments with the accumulation of the time interval parameter, and the system extracts the corresponding texture object from the preset frame array accordingly and passes it to the planar mesh material of the foreground scene for rendering; when the playback controller is in a frame-by-frame stepping state or responds to the user's jump command by clicking the timeline thumbnail, the current frame number undergoes a step change, and the above extraction process also uses the updated frame number as an index to complete the texture switching in real time. It should be noted that the current foreground content plays the role of the only texture input in the rendering pipeline as the foreground layer scene. Its resolution, number of color channels, and transparency parameters directly determine the visual performance of the visual effects frame in the target preview. Therefore, this texture object is usually kept in its raw, unscaled and uncompressed state before being passed to the renderer in order to preserve the image details to the greatest extent for review during the editing stage.

[0078] In an optional implementation, in the second playback mode, multiple frame images are merged into a single composite image, including: obtaining the row and column layout parameters of the frame images in the image sequence; arranging and merging the frame images into a single composite image according to the row and column layout parameters; determining the current frame number based on the time interval parameter, and calculating the row and column position information of the frame image corresponding to the current frame number in the composite image according to the number of rows and columns in the row and column layout parameters; and calculating the texture scaling ratio and texture offset in the preset sampling parameters based on the row and column position information, so as to display the content corresponding to the current frame image based on the updated sampling parameters. In this way, by merging multiple frame images into a single composite texture according to the row and column grid, and dynamically calculating the texture scaling ratio and offset based on the row and column positions, high-performance frame animation preview with zero texture switching overhead is achieved, significantly reducing video memory usage and improving rendering efficiency.

[0079] In one implementation, the visual effects sequence to be previewed comprises 60 frames, each 256×256 pixels in size. The system arranges and combines these frames into a composite texture of 2560×1536 pixels according to row and column layout parameters (e.g., 10 columns and 6 rows). When the time interval parameter advances to the 14th frame, the system calculates a column index of 4 and a row index of 1, thereby determining a texture scaling ratio of 0.1 horizontally and approximately 0.1667 vertically, and a texture offset of 0.4 horizontally and approximately 0.6667 vertically. During the rendering stage, the base texture coordinates, after the above scaling and offset, are accurately positioned to the mesh area corresponding to the 14th frame in the composite texture, thus completing the sampling and display of the current frame content without switching texture bindings.

[0080] Optionally, the row and column grid arrangement aims to organize multiple frames of images into a single composite texture according to a preset number of rows and columns, so as to reduce the graphics processor's memory usage and texture switching overhead.

[0081] Optionally, the row and column grid arrangement and stitching can refer to the process of seamlessly stitching multiple frames of uniform size into a single large-size texture according to a preset number of columns and rows. As one possible implementation, before stitching, the system can read user-configured or automatically calculated row and column layout parameters, which include at least the number of frames per column and per row. For example, for an image sequence of 60 frames with a single frame size of 512×512 pixels, if the row and column layout parameters are set to 10 columns and 6 rows, the width of the composite image will be 5120 pixels and the height will be 3072 pixels. All frames will be filled into the grid sequentially from left to right and from top to bottom. It should be noted that the above number of rows and columns can be determined not only by a fixed configuration but also dynamically calculated based on the single frame size and the maximum size limit of a single texture on the graphics processor, to avoid rendering errors caused by exceeding these limits. During the arrangement and stitching process, no gaps may be retained between each frame of image, thereby saving a large amount of video memory space; in other implementations, a transparent gap of several pixels may be retained between frames to reduce the risk of color overflow during linear filtering sampling.

[0082] Optionally, besides pre-stacking multiple frames of images offline into a single composite texture, multiple independent textures can also be loaded on the browser side and dynamically stitched by drawing them onto the same target texture. This disclosure does not limit the timing or the subject of the stitching operation. Furthermore, in some embodiments, when the sizes of the frames are not completely consistent, the system can calculate the optimal placement position of each frame in the composite texture based on a rectangle filling algorithm, thereby ensuring a compact composite result while leaving adaptive margins. This rectangle filling algorithm can be a simple row-by-row descending order arrangement, or a heuristic algorithm based on maximum rectangle gap detection. Regardless of the stitching strategy used, the final generated composite texture can carry metadata describing the original frame arrangement, so that the corresponding row and column position information and sampling parameters can be accurately deduced in the shader based on the current frame number.

[0083] Optionally, row and column position information is used to characterize the two-dimensional coordinate index of the target frame image in the row and column grid corresponding to the synthetic texture, so as to support subsequent sampling parameter calculation and precise positioning.

[0084] Optionally, the row and column position information can be two-dimensional integer coordinates obtained by inversely solving the current frame number and the total number of rows and columns of the composite texture. The column coordinates can be obtained by taking the modulo of the current frame number with the total number of columns, and the row coordinates can be obtained by dividing the current frame number by the total number of columns and then rounding down. For example, assuming the current frame number is 23 and the composite texture has a row and column layout of 8 columns and 5 rows, the column coordinate is 7 (23 modulo 8), and the row coordinate is 2 (23 divided by 8 and rounded down), indicating that the frame is located in the 7th column and 2nd row of the composite texture. It should be noted that the above calculation method for row and column position information is only one example. In actual implementation, the starting index direction of the row and column can be adaptively adjusted according to the origin definition of the texture coordinate system. For example, in some graphics interfaces, the vertical axis direction of the texture coordinates may be opposite to that of traditional image coordinates. In this case, the calculation of the row coordinates can further introduce an offset correction term related to the total number of rows to ensure that it is ultimately mapped to the correct texture region. In addition, if there are frame numbers that have been marked for deletion, they can be mapped to the corresponding numbers in the valid frame sequence before calculating the row and column position information to ensure that the sampling window always falls on the still valid frame image.

[0085] Optionally, the texture scaling factor and texture offset are used to locate the sampling window of the current frame in the composite texture within the graphics processor shader, achieving accurate extraction of frame content with zero switching overhead. Optionally, the texture scaling factor can be a scaling factor that normalizes the base texture coordinates to the local area occupied by a single frame, and the texture offset can be the offset value that translates the scaled coordinates to the starting position of the local area where the target frame is located. Specifically, the horizontal component of the texture scaling factor can be the reciprocal of the number of frames in a single column, and the vertical component can be the reciprocal of the number of frames in a single row; the horizontal component of the texture offset can be the product of the column coordinate and the reciprocal of the number of frames in a single column, while the vertical component can be comprehensively determined based on the row coordinate, the total number of rows, and the vertical direction of the texture coordinate system. For example, continuing the previous example, if the composite texture contains 8 columns and 5 rows, and the column coordinate of the target frame is 7 and the row coordinate is 2, then the texture scaling factor is (0.125, 0.2), and the horizontal component of the texture offset is 0.875. In the vertical direction, considering that the origin of texture coordinates in the graphics processor is located at the bottom left corner by default and the image data is usually stored from top to bottom, the vertical offset can be set to 1.0 minus the product of (row coordinate + 1) and the inverse of the number of frames per row, thus avoiding image inversion. It should be noted that the above description of texture scaling and offset is not intended to limit the calculation method. In actual implementation, additional transformation matrices can be introduced according to the packing direction, rotation state, or mirroring requirements of the synthesized texture to adapt to different coordinate conventions.

[0086] Optionally, in addition to directly passing the texture scaling ratio and texture offset to the vertex shader or fragment shader as two-dimensional vectors, they can also be packaged into four-dimensional vectors or matrices to save constant parameter slots passed to the graphics processor shader. Furthermore, before the graphics processor performs sampling, the system can first perform a threshold judgment on the transparency value. If the transparency of the sampled result is lower than a preset threshold, the fragment is directly discarded, thereby avoiding invalid writing of transparent pixels to the depth buffer. To avoid color leakage between adjacent frames caused by linear filtering at frame boundaries, the sampling filtering method of the composite texture can be configured as a nearest neighbor sampling mode, so that any sampling point reads the color of the nearest single pixel without mixing adjacent pixels. It should be understood that in scaling scenarios where the resolution of the composite texture does not perfectly match the display resolution, multi-level progressive texture technology combined with a reasonable boundary filling strategy can also be used to balance display clarity and margin anti-aliasing requirements; this disclosure does not limit this aspect.

[0087] In an optional implementation, merging multiple frame images into a single composite image further includes: when the frame images in the image sequence have inconsistent sizes, arranging and merging frame images of different sizes into a single composite image based on a rectangular filling algorithm; or, when the number of frames in the image sequence exceeds a preset capacity threshold for a single composite image, storing the frame images in batches as multiple paged composite images, and dynamically determining the corresponding page number and in-page sampling parameters based on the current frame number. In this way, the rectangular filling algorithm is compatible with the merging requirements of frame images of different sizes, and the paging mechanism overcomes the capacity limitation of a single image, effectively expanding the adaptability of the composite image to complex frame sequences.

[0088] As one possible implementation, when the image sequence contains frame images of different sizes, the system calculates the optimal arrangement position of each frame image based on a rectangle filling algorithm, compactly arranging and stitching the frame images of different lengths and widths into a single composite image. As another implementation, when the number of frames in the image sequence exceeds a preset capacity threshold for a single composite image, the system stores the frame image in batches as multiple paged composite images. In this case, the system dynamically calculates the corresponding page number based on the current frame number and locates the specific frame image content in the target paged composite image based on the in-page sampling parameters.

[0089] Optionally, the above-mentioned rectangle filling algorithm is used to compactly stitch the frames into a single synthetic image when the frame image sizes are inconsistent, so as to improve the utilization of texture space.

[0090] Optionally, the aforementioned rectangular filling algorithm aims to address the problem of merging and arranging images when their dimensions differ. When some frames in an image sequence have inconsistent dimensions due to cropping or region selection operations, forcibly scaling them proportionally or filling them with blanks to a uniform size would not only waste texture space but also introduce unnecessary image stretching and deformation. As a possible implementation, the rectangular filling algorithm can be based on a compact arrangement strategy using minimum bounding rectangles. The system sequentially obtains the original width and height parameters of each frame image, performs two-dimensional space occupancy calculations in descending area or width-aligned order, tightly arranges each frame image in the texture coordinate system of a single composite image, and records the offset starting point and occupied range of each frame image within the composite image. Furthermore, the algorithm can also be based on a greedy strategy or a rectangular packing scheme using binary space segmentation, recursively dividing large texture regions into several sub-rectangles to adapt to frame images of different proportions, thereby maximizing the pixel utilization of a single composite image. It should be noted that after the stitching is completed, the texture offset in the above sampling parameters will be dynamically calculated based on the actual starting point of each frame image, rather than simply being evenly distributed, so as to ensure that each frame image can be accurately sampled and restored during the final rendering.

[0091] Optionally, the aforementioned paginated composite image is used for batch storage when the frame sequence exceeds the limit, and the target page and sampling position within the page are dynamically located using the current frame number. Optionally, the aforementioned paginated composite image mechanism is used to maintain the normal operation of the playback system when the total number of frame images exceeds the hardware capacity limit of a single texture. It should be noted that the capacity threshold of a single composite image can be set according to the maximum texture size supported by the current graphics processor. For example, when the pixel limit of a single texture is a preset value, if sixty high-resolution images exceed this limit, the system automatically divides the frame sequence into multiple subsets. As a possible implementation, the system performs uniform segmentation based on the continuity of frame numbers during the pagination stage, and combines the frame images corresponding to each page into an independent paginated composite image, while establishing a page number index table to record the frame number range covered by each page. During playback, the system first calculates the target pagination number based on the current frame number and the single-page capacity, then instructs the graphics processor to load the corresponding paginated composite image into video memory. Subsequently, it recalculates the in-page sampling parameters based on the frame's relative position within the page, specifically including the texture scaling ratio and texture offset. This allows for a smooth preview of a large-scale sequence without having to load all frame textures at once. It should be understood that the pagination method described above can be uniform segmentation or intelligent clustering segmentation based on content relevance; this disclosure does not limit this approach.

[0092] In step S250, based on the current frame image and its corresponding transparency parameters, the background layer content and the foreground layer content are rendered sequentially on the rendering canvas to obtain the target preview image. The foreground layer content includes the current frame image, and the transparency of the foreground layer content is controlled based on the transparency parameters. In this way, by sequentially rendering the underlying background and the upper frame image on a single canvas and using transparency parameters to control the display weight of the upper-layer pixels, not only can the accurate overlay effect of transparent and semi-transparent areas be ensured under different reference backgrounds, but the visual preview feedback is also made more immediate and reliable.

[0093] In one specific approach, when the frame image to be displayed is determined, the rendering engine first performs background layer rendering on the same canvas: if the user selects the checkerboard mode, the graphics processor calculates the gray and white square colors in real time based on the parity of the pixel coordinates and fills the canvas; after the background layer is completed, the engine disables the automatic clearing function, and then performs foreground layer rendering on the same canvas, binding the current frame image to planar geometry and performing transparency blending according to the transparency parameters of each pixel; pixels in the foreground layer with transparency values ​​below the threshold are directly discarded to avoid obscuring the background layer; thus, the checkerboard pattern of the background layer is correctly displayed through the semi-transparent edges of the foreground layer, and the user can intuitively judge the transparency channel quality in the target preview image.

[0094] Optionally, the background layer content is designed to provide the fill pattern for the underlying canvas. Its generation mode can dynamically switch between checkerboard and solid color according to preset background parameters to cooperate with the foreground layer to complete the transparency check.

[0095] Optionally, the background layer content can be a procedural checkerboard pattern, a solid color fill, or other visually distinctive underlying images. The checkerboard pattern is generated in real-time by the graphics processor based on the resolution and grid size parameters of the rendering area, performing modulo operations and parity checks on each pixel. This allows for infinite scaling without distortion, eliminating the need for external textures. Solid color fills generate a uniform background based on preset color values, such as a pure black or pure white scene, to simulate the final composite appearance of the target image under different environments. It should be noted that the generation logic of the background layer content is not limited to a single implementation path. In actual deployment, the background layer content can also be a dynamic gradient pattern or an auxiliary grid with a reference scale, serving as a controllable reference base for the foreground layer. By rendering the background layer content separately from the foreground layer content, the system can instantly switch the display environment by modifying a uniform variable in the background shader without reloading the foreground frame data. This significantly reduces the operational cost of preview verification and allows artists to quickly compare the blending quality of transparent edges under various backgrounds within the same viewport.

[0096] Optionally, the foreground layer content includes the current frame image and its transparency parameters, designed to perform texture sampling and transparency blending via the graphics processor to overlay image elements with precise transparency control on top of the background layer. Optionally, the foreground layer content mainly consists of the current frame image to be previewed and its associated transparency parameters. This frame image can originate from an independent texture object in frame-by-frame sequence mode or from a single large image in sprite sheet mode. During the rendering phase, the graphics processor first calculates the sampling position of the current frame in the texture coordinate system based on the texture scaling ratio and texture offset, and then performs sampling operations on the target texture. After sampling, the system performs a threshold judgment on the transparency values ​​of pixels, discarding pixels with transparency below a preset threshold to avoid invalid writing of fully transparent pixels to the depth buffer, thus occluding the background layer content. Furthermore, for semi-transparent edge areas, the graphics processor performs color blending calculations according to the pass-through transparency mode to ensure that color channels are not incorrectly pre-multiplied by transparency values, thereby preventing dark artifacts at the edges. It should be noted that the rendering parameters of the foreground layer can be dynamically adjusted according to actual preview needs. For example, when a user needs to view the light effect overlay, the blending mode can be switched from standard mode to overlay mode. The above adjustment only involves updating the material uniform variable and can be completed in real time without reloading the frame image data.

[0097] In an optional implementation, the background layer content and foreground layer content are rendered sequentially on the rendering canvas, including: configuring renderer parameters, wherein the renderer parameters include at least: disabling the automatic image clearing function and configuring transparency blending parameters; based on the renderer parameters, the background layer content and foreground layer content are rendered sequentially, so that the foreground layer content is superimposed on the background layer content. In this way, disabling the automatic clearing function in conjunction with configuring the transparency blending parameters not only prevents the background from being erased, but also ensures that the foreground layer's transparency channel blends correctly with the background layer, thereby presenting an accurate transparency preview effect on a single canvas.

[0098] Optionally, the automatic clearing function controls whether the canvas pixel data is cleared before each render. Its off state is intended to preserve the content of the background layer rendered first, providing a basis for the overlay of two scenes.

[0099] Optionally, considering that when rendering two independent scenes consecutively on a single canvas, if automatic clearing is enabled, the canvas will be cleared to the background color before the foreground scene is rendered after the background scene is rendered, resulting in the loss of background layer content and preventing overlay compositing. As a possible implementation, the aforementioned automatic clearing function can be explicitly disabled (e.g., by setting the autoClear property to false), allowing the renderer to retain existing pixel data in the frame buffer during the consecutive calls to the rendering method. Furthermore, with automatic clearing disabled, the system can manually call the clearing method at the beginning of each rendering frame to precisely control the clearing timing, ensuring that the buffer is cleared only before the start of the two scene rendering cycles, thereby preventing the background scene from being accidentally erased after rendering. It should be noted that the aforementioned automatic clearing disabling operation applies not only to overlay scenes of checkerboard backgrounds and VFX frame foregrounds but also to overlay scenes of solid color backgrounds and foregrounds; this disclosure is not limited to this.

[0100] Optionally, the transparency blending parameter is used to configure the transparency channel calculation rules used by the graphics processor when overlaying foreground and background layers, which includes at least two modes: pass-through alpha or pre-multiplied alpha.

[0101] Optionally, considering that VFX sequence frames typically use a straight-through alpha storage method, meaning the RGB channels are not pre-multiplied by an alpha value, if the renderer defaults to enabling premultiplied alpha (premultipliedAlpha is true), the graphics processor will produce incorrect semi-transparent edge colors during blending operations, resulting in black edge artifacts at the edges of lighting effects or smoke. To avoid this, as a possible implementation, the aforementioned transparency blending parameter can be configured to a straight-through alpha mode (e.g., setting premultipliedAlpha to false and using a blending equation that combines the source alpha with a subtracted source alpha), thereby enabling the semi-transparent pixels of the foreground layer to be linearly interpolated and blended with the background layer according to their original alpha values. Besides the straight-through alpha mode, the aforementioned transparency blending parameter can also be dynamically switched to an additive blending mode or other custom blending modes depending on the VFX type, to adapt to the preview requirements of glowing effects or regular transparent textures. In other words, the specific value of this parameter can be determined based on the content attributes of the frame image, the compatibility requirements of the target engine, or explicit user instructions; this disclosure does not limit this.

[0102] In an optional implementation, rendering the background layer content includes: determining a background pattern generation mode based on preset background parameters, wherein the generation mode includes a checkerboard mode and a solid color mode; in checkerboard mode, generating a checkerboard pattern by calculating with a graphics processor; in solid color mode, generating a solid color pattern based on preset color values ​​with a graphics processor; and switching the generation mode between checkerboard mode and solid color mode in response to a background mode switching command. In this way, by procedurally generating multiple background patterns in the graphics processor and supporting instant switching, artists can quickly verify the transparency and compositing quality of visual effects under different background colors in the same preview interface without relying on external image resources.

[0103] In one implementation, after system initialization, a checkerboard pattern is used by default as the background pattern generation mode. At this time, the graphics processor generates an alternating gray-white checkerboard pattern in real time based on the resolution parameters of the rendering canvas and the preset grid size parameters, through pixel-by-pixel coordinate rounding and modulo operations. The two alternating grayscale values ​​are specified by the color field in the preset background parameters. When the operator clicks the mode switching control on the interface to trigger the background mode switching command, the system only updates the identifier value representing the current generation mode and the preset color value corresponding to the target solid color mode in memory. In the next frame rendering cycle, it drives the graphics processor to directly output this color value as the background layer content, thus completing the instantaneous transformation of the background environment without reloading any external textures. This facilitates continuous comparison of the transparency and edge compositing quality of foreground visual effects under different background colors. Figure 3 The image shown illustrates a background mode switching effect, which can switch from a checkerboard pattern (transparent, with visible alpha transition areas on the checkerboard) to a black background and a white background; the black / white background simulates the dark / light scene effects in a game.

[0104] Optionally, the background pattern generation mode is designed to determine the presentation of the background layer content, and it is dynamically selected from at least two modes based on preset background parameters.

[0105] Optionally, the generation mode of the aforementioned background pattern may include, but is not limited to, checkerboard pattern and solid color pattern, and the specific type is determined by the mode identifier field in the preset background parameters. It should be noted that the aforementioned generation mode may also be a gradient mode with an alpha channel, a noise texture mode, or other procedural drawing modes. This disclosure is not intended to exhaustively limit the supported background forms. Considering that a single static background is difficult to meet the preview requirements of visual effects in diverse engine environments, this embodiment configures different shader parameters for the background scene in a dual-scene rendering architecture. This allows the same canvas to generate significantly different environmental bases by simply switching a few parameters without reloading the page or external image resources. On the one hand, this avoids memory fragmentation and transmission delay caused by loading external bitmaps. On the other hand, it provides artists with convenient conditions to instantly compare the transparency overflow and edge blending of the same visual effect under different brightness bases. In actual implementation, this generation mode can work in conjunction with the transparency display parameters of the foreground layer. For example, when the background is switched to pure white mode, if there are unexpected semi-transparent pixels in the foreground visual effects, the above comparison scene will immediately show the rendering abnormality of the pixel against the light background, thereby helping to locate potential defects in the transparency processing flow.

[0106] Optionally, in addition to statically specifying the generation mode through preset background parameters, the system can also dynamically adjust the background pattern generation mode in response to feedback from external processing flows or user-defined scripts. For example, after semantic segmentation processing is completed, the system can automatically switch the background mode to a checkerboard pattern to assist in checking edge accuracy; during the batch adjustment of transparency parameters, it can automatically switch to pure black or pure white to batch evaluate halo effects. Furthermore, the grid size parameters, the two alternating grayscale values, and the preset color values ​​in the solid color mode can all be configured independently as subfields of the preset background parameters to adapt to the visual sensitivity requirements of different resolution canvases and different art styles. When the user specifies a new parameter combination in the interface, the graphics processor can read the updated constant parameters and refill the entire background quadrilateral in the next rendering loop. The entire update process does not involve texture uploading or vertex buffer reconstruction, thus ensuring that mode switching and parameter fine-tuning are completed within milliseconds, significantly improving the smoothness of interactive editing.

[0107] Optionally, the checkerboard pattern is calculated in real time by the graphics processor based on pixel coordinates, without the need for external textures, and outputs different grayscale values ​​alternately according to the parity of the coordinates.

[0108] Optionally, in checkerboard mode, the fragment shader executed by the graphics processor first receives the world or screen coordinates passed from the vertices and interpolated. Then, it divides the horizontal and vertical components of these coordinates by a preset grid size parameter and rounds the quotient down. The two rounded results are added together, and a modulo operation is performed on the value 2.0. Based on the parity of the remainder, a linear blend is performed between two preset grayscale values ​​to obtain the color output of the current pixel within the checkerboard pattern. It should be noted that the above coordinate calculation can be based on world space units or screen pixel space units. When the canvas size changes, only the resolution parameter needs to be updated in the shader to maintain the visual density consistency of the checkerboard, without regenerating any texture resources. In this way, by generating the background entirely based on the graphics processor's mathematical calculations, not only are network requests and video memory usage caused by loading external checkerboard images eliminated, but the pattern also possesses infinite resolution characteristics. That is, regardless of the zoom level, there will be no mosaic or blurring phenomena as with traditional bitmap magnification, making it particularly suitable for high-precision preview scenarios requiring high-frequency zooming to examine particle edges.

[0109] Optionally, the grid size parameter in the aforementioned checkerboard pattern is not a fixed constant; it can be dynamically adjusted based on the pixel density of the display device, the resolution parameters of the canvas, or explicit user specifications. For example, on ultra-high resolution displays, if the default small grid size is used, individual grid areas may cause visual fatigue due to excessively small size. In this case, the grid size parameter can be increased to a larger pixel value to form a more obvious transparency reference boundary. Similarly, the two alternating grayscale values ​​can be configured independently according to the actual application scenario: in routine inspection scenarios, a low-contrast combination of dark gray and light gray can avoid interference from strong contrast backgrounds on the color interpretation of foreground visual effects; in special quality inspection scenarios, one square can be configured as pure red, while the other square remains neutral gray, thereby using a high-contrast red base to quickly expose whether there is any red channel leakage or semi-transparent overlay color cast problem in the foreground. It should be understood that the above parity judgment logic is not limited to binary alternation; it can also be extended to modulo 3 or higher values ​​to achieve a periodic grid arrangement of three or more colors, which is not limited in this disclosure.

[0110] Optionally, in solid color mode, the graphics processor generates a monochrome background pattern based on preset color values ​​to simulate the background color of a specific environment in the target application scenario. Optionally, in the above solid color mode, the graphics processor can directly determine the mode identifier and color vector carried by the preset background parameters in the fragment shader. When the identifier indicates that the current mode is solid color, it immediately outputs a unified color value composed of RGB three channels and makes the transparency channel completely opaque to form a solid background base. The specific content of the preset color value can include, but is not limited to, pure black, pure white, or pure green. Pure black mode can be used to simulate the visual effect overlay performance in night scenes or dark user interfaces; pure white mode can be used to evaluate the visibility attenuation of light effects in bright sky or snowy environments; and pure green mode is often used for green screen checks in post-production compositing. It should be noted that the above color values ​​can be determined by the user directly specifying them through the color selection control on the interface, or read from a preset environment template library, or automatically recommended by an external processing flow based on scene semantic analysis results. This disclosure does not limit the data source. In actual implementation, the solid color pattern and the checkerboard pattern share the same set of background shader programs. The only difference is whether the color value is returned directly in the branch logic or the checkerboard mathematical operation is performed. This ensures that no additional shader code files or texture resources are introduced when adding a new background mode, which significantly reduces the system maintenance cost and memory usage.

[0111] Optionally, the background mode switching command is used to trigger the conversion between different generation modes, and can be issued through user interface controls or external signal input. Optionally, the aforementioned background mode switching command can take various forms. It can be the direct result of a user clicking a button, drop-down menu option, or sliding control in the graphical user interface; it can be a keyboard shortcut signal received by the system (e.g., pressing a specified key to cycle between checkerboard and solid color); or it can be an asynchronous event notification automatically issued by an external processing flow after a specific processing stage is completed. After the command is responded to, the system does not reconstruct the geometric mesh of the background scene or reload texture resources. Instead, it only modifies the corresponding constant parameter values ​​in the background shader. For example, it updates the mode identifier from the checkerboard identifier to the solid color identifier, and simultaneously updates the color parameter to the target solid color value. In other words, the entire switching process is reflected on the graphics processor side as a small number of constant register value changes. The rendering pipeline can read the new values ​​and generate the corresponding background when executing the next frame, thus achieving immediate effect of the background mode within less than one rendering cycle, avoiding the white screen or loading flickering problems caused by switching background images in traditional solutions.

[0112] Optionally, to prevent users from losing the currently viewed frame position or zoom status due to accidental operation when frequently switching background modes, the response logic of the aforementioned switching command can be decoupled from the playback status control logic. Specifically, during the response to the background mode switching command, the system keeps the frame number, playback or pause status, and camera view parameters unchanged on the current timeline, and only atomically updates the constant parameters of the background layer shader. Furthermore, the aforementioned switching command can also include transition effect parameters, so that the switching between the two background modes is not abrupt, but a smooth transition through one or more frames of color gradation, such as a gradual transition from the grayscale value of the checkerboard pattern to the target solid color value. In the special case where the current foreground visual effect is a completely transparent area, the system can also automatically increase the contrast of the checkerboard mode or enable a highly saturated check color, so as to still provide the operator with a clear spatial reference boundary even when the transparent area accounts for a large proportion.

[0113] In an optional implementation, in checkerboard mode, the checkerboard pattern is generated by the graphics processor, including: obtaining the resolution parameters and grid size parameters of the rendering area; calculating the coordinate position of each pixel based on the resolution parameters and grid size parameters, and determining the color value of the corresponding pixel according to the parity attribute of the coordinate position to generate the checkerboard pattern. In this way, the graphics processor calculates the checkerboard in real time based on the resolution and grid size, without loading external textures. This avoids image scaling distortion, supports dynamic adjustment of grid density, significantly reduces video memory usage, and improves rendering efficiency.

[0114] For example, when the graphics processor performs checkerboard generation, the resolution parameter of the rendering canvas can be obtained as 1920×1080 pixels, and the grid size parameter can be set to 32 pixels. Then, the screen coordinates of each pixel are divided by 32 and rounded down. The sum of the horizontal and vertical rounding results is then divided by 2 and the remainder is taken. Based on the parity of the remainder, the corresponding pixel is assigned dark gray or light gray, thereby forming a uniformly interlaced checkerboard pattern on the entire canvas.

[0115] Optionally, the resolution parameters mentioned above can characterize the width and height of the target area to be rendered, and dynamically determine the spatial boundaries of the chessboard grid based on the canvas pixel size.

[0116] Optionally, the resolution parameter mentioned above can be the physical pixel size of the rendering canvas, such as a width of 1920 and a height of 1080, or it can be the logical pixel size or a normalized device-independent pixel value. It should be noted that the purpose of this resolution parameter is to provide a spatial scale reference for the fragment shader, ensuring that the checkerboard pattern accurately fills the entire rendering area without edge truncation or misalignment. In practice, the resolution parameter can be directly read from the client-side size attribute of the web canvas, manually specified by the user based on the size of the preview window, or dynamically updated by listening for window size changes. In addition to the width and height mentioned above, the resolution parameter can also include device pixel ratio information to maintain visual consistency of the checkerboard grid on high-density displays. For example, when the device pixel ratio is 2, the logical resolution can be multiplied by this ratio before being passed to the shader, thus avoiding problems such as pattern blurring or uneven grid line thickness on high-resolution screens.

[0117] Optionally, the above grid size parameters can be used to control the pixel side length of a single grid cell and can be flexibly set according to the preview accuracy requirements to determine the grid density.

[0118] Optionally, the grid size parameter can be a fixed pixel value, such as 16 pixels, 32 pixels, or 64 pixels, or a relative value dynamically calculated based on the canvas resolution, such as using one-twentieth of the rendering area width as the side length. It should be noted that the selection of the grid size parameter directly affects the visual recognizability of the checkerboard pattern and the sensitivity to detecting alpha channel defects: when the value is too small, the grid lines are too fine, making it difficult for the naked eye to observe the gradient quality of the semi-transparent edges; when the value is too large, the coverage area of ​​a single grid is too wide, which may mask subtle defects in the local alpha channel. As one possible implementation, this parameter can be adjusted in real time via a slider control on the user interface. The minimum scale of the slider can be set to 2 pixels, and the maximum scale can be set to 256 pixels. When the value changes, it is immediately passed to the fragment shader via a uniform variable, so that the adjusted checkerboard density is immediately presented in the next rendering frame. Furthermore, the grid size parameter can be set with different values ​​for different areas. For example, a smaller grid can be used in the center of the image to finely examine local effects, while a larger grid can be used in the edge areas to reduce rendering overhead. This disclosure is not intended to limit its value range or distribution.

[0119] Optionally, the above parity attribute can be obtained by summing the integer values ​​of the horizontal and vertical coordinates of the pixel and then taking the remainder after dividing by two, so as to distinguish the coloring category of adjacent cells.

[0120] Optionally, the logic for determining the parity attribute mentioned above can be as follows: First, divide the pixel's horizontal and vertical coordinates in world space or screen space by the grid size parameter and round down. Then, add the two integers and take the modulo 2. The pixel's classification into the first or second color category is determined by whether the modulo operation result is 0 or 1. It should be noted that this mathematical operation is executed in parallel within the fragment shader of the graphics processor. Each pixel is calculated independently and without interference, thus maintaining extremely high generation efficiency even at very high resolutions. As one possible implementation, the first color category can be set to a dark gray with all color channel values ​​of 38, and the second color category can be set to a light gray with all color channel values ​​of 51. The difference in brightness between the two should ensure that the human eye can clearly distinguish the grid boundaries while avoiding excessive contrast that would interfere with the observation of transparent areas of foreground effects. Furthermore, in addition to determining the parity based on the sum of the horizontal and vertical rounding operations, the same pattern effect can also be achieved by using coordinate-based bitwise operations (e.g., performing bitwise AND operations on the horizontal and vertical coordinates and then performing XOR operations). This disclosure does not limit the specific mathematical expression.

[0121] In an optional implementation, rendering the foreground layer content includes: acquiring the current frame image and sampling parameters, wherein the sampling parameters include at least a texture scaling ratio and a texture offset, and the sampling parameters are determined based on the row and column layout parameters of the frame images in the image sequence; determining the sampling position of the current frame image in the texture coordinate system based on the sampling parameters; performing texture sampling on the current frame image based on the sampling position, and thresholding the transparency value of the sampling result, discarding pixels with transparency values ​​lower than a preset threshold, thereby obtaining the foreground rendering result. In this way, by precisely locating the texture coordinates in the GPU shader in conjunction with transparency threshold filtering, not only can the depth occlusion of the background layer by fully transparent pixels be avoided, but also the flickering artifacts of semi-transparent edges can be eliminated, improving the preview quality of VFX sequence frames under various backgrounds.

[0122] Optionally, the texture sampling location is used to determine the target window of the current frame in the texture coordinate system within the graphics processor to support pixel-by-pixel color extraction.

[0123] Optionally, the specific method for determining the texture sampling position can be applied to both Sprite Sheet mode and sequential frame mode, and this disclosure does not limit its scope of application. In Sprite Sheet mode, the texture sampling position of the current frame image is jointly defined by the texture scaling ratio and the texture offset. The texture scaling ratio is used to set the normalized proportion of the single frame image in the horizontal and vertical coordinate system, while the texture offset is used to translate the sampling window to the corresponding row and column grid area in the synthesized texture. As another implementation, in sequential frame mode, since each frame image has been loaded as an independent texture object, the texture scaling ratio can maintain the default normalized full-image ratio, the texture offset is set to zero, and the sampling position covers the entire texture coordinate range, thus allowing direct extraction of the entire frame's pixel color without additional window offset calculations. It should be noted that the determination of the sampling position in both of the above modes is completed in real time through floating-point operations in the vertex or fragment stage of the GPU, and the calculation result directly drives subsequent texture sampling instructions.

[0124] Optionally, texture sampling aims to extract the color and transparency information of corresponding pixels from the current frame image or synthetic texture based on the determined texture coordinates.

[0125] Optionally, texture sampling is performed at the fragment shader stage of the graphics processor. Its input consists of interpolated texture coordinates and sampling window parameters defined by the texture scaling factor and texture offset. As one implementation, when the system is operating in Sprite Sheet mode, the shader can invoke the texture sampling instruction with a single texture binding. The sampling window slides within a single composite texture based on the row and column position corresponding to the current frame, thereby acquiring pixel data of the target frame without switching texture objects. In another implementation, when the system is operating in frame-by-frame sequence mode, each frame is loaded as an independent texture object. Texture sampling directly applies to the entire area of ​​this independent texture. In this case, the sampling filtering method is configured as nearest neighbor sampling mode to ensure accurate pixel display of VFX effects frames without introducing additional blurring distortion. This sampling mechanism significantly reduces the consumption of graphics processor memory bandwidth while ensuring the clarity of the preview image.

[0126] Optionally, transparency thresholding and pixel discarding are used to perform validity screening on foreground sampled pixels to remove invalid pixels below a preset threshold. Optionally, the core purpose of the aforementioned transparency thresholding is to accurately identify and intercept pixel data that should be considered completely transparent by setting an empirical preset threshold and performing fragment-level comparison operations on the transparency values ​​of pixels obtained after texture sampling. Considering floating-point precision errors and the slight noise that may be introduced by texture compression, the preset threshold is usually set to a value close to zero but not zero, such as 0.005. If zero is used directly as the judgment standard, semi-transparent pixels in the edge region may fluctuate irregularly between transparent and opaque due to floating-point rounding, causing visible flickering artifacts when the checkerboard background is seen through the foreground frame. By introducing this small margin in the thresholding, not only can semi-transparent edge pixels that should be retained be stably distinguished from fully transparent pixels that should be discarded, but the former can also avoid generating invalid depth values ​​in the depth buffer, preventing the checkerboard pattern in the background scene from being accidentally occluded and appearing as an unnatural black area.

[0127] Optionally, the pixel discarding strategy can be flexible and diverse in its implementation, and is not limited to a single conditional expression. In the above judgment logic, if the transparency value of the sampled pixel is lower than a preset threshold, the shader will directly trigger the discarding process, terminating the subsequent depth writing and color blending pipeline operations of that fragment, thereby achieving zero-overhead transparent area removal. Furthermore, as another implementation, this threshold can also be dynamically adjusted based on user input or feedback from the external processing pipeline: for example, after the intelligent processing pipeline completes the matting operation and outputs an updated transparency mask, the system can automatically raise or lower the threshold based on the mask quality score to adapt to VFX sequence frames with different edge sharpness. It should be noted that, in addition to the direct discarding scheme, similar effects can also be achieved through alternative methods such as transparency pre-multiplication blending or stencil testing, but the threshold discarding scheme takes into account both rendering efficiency and visual accuracy.

[0128] An image processing apparatus according to one embodiment of the present disclosure, such as Figure 4 As shown, the device may include: The acquisition module is used to acquire an image sequence containing multiple frame images and the transparency parameter corresponding to each pixel in the frame image; The frame switching module is used to perform frame switching control on the image sequence based on the time interval parameter and determine the current frame image; The rendering module is used to render the background layer content and the foreground layer content sequentially on the rendering canvas based on the current frame image and its corresponding transparency parameters to obtain the target preview image. The foreground layer content includes the current frame image, and the transparency of the foreground layer content is controlled based on the transparency parameters.

[0129] In this way, during the image sequence preview process on the browser side, the image processing overhead is reduced by layered rendering and frame switching control, the rendering efficiency and display accuracy of images with transparency are improved, and the utilization of video memory resources is improved and the interactive response latency is reduced.

[0130] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.

[0131] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0132] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.

[0133] The following is a detailed reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present disclosure. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 1201, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1202 or a program loaded from memory 1208 into random access memory (RAM) 1203. The RAM 1203 also stores various programs and data required for the operation of the electronic device. The processor 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0134] Typically, the following devices can be connected to I / O interface 1205: input devices 1206 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1207 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1208 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1209. Communication device 1209 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0135] In particular, according to one embodiment of this disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, one embodiment of this disclosure includes a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication device 1209, or installed from memory 1208, or installed from ROM 1202. When the computer program is executed by processor 1201, it performs the functions defined in the methods described above in various embodiments of this disclosure.

[0136] Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0137] This disclosure also provides a computer-readable storage medium in which the methods described in this disclosure can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded over a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0138] A portion of this disclosure can be applied to computer program products, such as computer program instructions, which, when executed by a computer, can invoke or provide methods and / or technical solutions according to this disclosure through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, and installation package files. Accordingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions; the computer compiling the instructions and then executing the corresponding compiled program; the computer reading and executing the instructions; or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0139] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. An image processing method, characterized by, The method includes: Obtain an image sequence containing multiple frame images and the transparency parameter corresponding to each pixel in the frame images; Based on the time interval parameter, frame switching control is performed on the image sequence to determine the current frame image; Based on the current frame image and its corresponding transparency parameter, the background layer content and the foreground layer content are rendered sequentially on the rendering canvas to obtain the target preview image. The foreground layer content includes the current frame image, and the transparency display of the foreground layer content is controlled based on the transparency parameter.

2. The image processing method of claim 1, wherein, The step of rendering the background layer content and the foreground layer content sequentially on the rendering canvas includes: Configure renderer parameters, wherein the renderer parameters include at least: disabling the automatic image clearing function and configuring transparency blending parameters; Based on the renderer parameters, the background layer content and the foreground layer content are rendered sequentially, so that the foreground layer content is superimposed on the background layer content.

3. The image processing method of claim 2, wherein, Rendering the background layer content includes: Based on preset background parameters, the generation mode of the background pattern is determined, wherein the generation mode includes checkerboard mode and solid color mode; In the chessboard pattern, the chessboard pattern is generated by a graphics processor. In the solid color mode, a solid color pattern is generated by the graphics processor based on preset color values; In response to a background mode switching command, the generation mode is switched between the checkerboard mode and the solid color mode.

4. The image processing method of claim 3, wherein, The step of generating a checkerboard pattern using a graphics processor in the checkerboard pattern mode includes: Obtain the resolution and grid size parameters of the rendering area; Based on the resolution parameter and the grid size parameter, the coordinate position corresponding to each pixel is calculated, and the color value of the corresponding pixel is determined according to the parity attribute of the coordinate position, thereby generating the checkerboard pattern.

5. The image processing method of claim 2, wherein, Rendering the foreground layer content includes: The current frame image and sampling parameters are obtained, wherein the sampling parameters include at least a texture scaling ratio and a texture offset, and the sampling parameters are determined based on the row and column layout parameters of the frame images in the image sequence; Based on the sampling parameters, the sampling position of the current frame image in the texture coordinate system is determined; Based on the sampling position, texture sampling is performed on the current frame image, and the transparency value of the sampling result is thresholded. Pixels with transparency values ​​lower than the preset threshold are discarded to obtain the foreground rendering result.

6. The image processing method of claim 1, wherein, The step of performing frame switching control on the image sequence based on a time interval parameter to determine the current frame image includes: Acquire frame images from the image sequence and determine the playback mode; In the first playback mode, each frame image is loaded as an independent texture object, and the currently displayed texture object is switched frame by frame based on the time interval parameter to determine the current frame image; In the second playback mode, multiple frames are merged into a single composite image, and the current frame image is determined by modifying the sampling position of the composite image based on the time interval parameter and the preset sampling parameter.

7. The image processing method of claim 6, wherein, In the first playback mode, each frame image is loaded as an independent texture object, including: Based on the image sequence, each frame image is loaded as an independent texture object according to its sequence number and stored in a preset frame array; Configure the sampling filtering method for each texture object to the nearest neighbor sampling mode; Based on the current frame number, the corresponding texture object is extracted from the preset frame array as the current foreground content.

8. The image processing method of claim 6, wherein, In the second playback mode, merging multiple frames into a single composite image includes: Obtain the row and column layout parameters of the frame images in the image sequence; Based on the row and column layout parameters, the frame images are arranged and stitched together into a single composite image according to the row and column grid method; The current frame number is determined based on the time interval parameter, and the row and column position information of the frame image corresponding to the current frame number in the composite image is calculated according to the number of rows and columns in the row and column layout parameter. Based on the row and column position information, the texture scaling ratio and texture offset in the preset sampling parameters are calculated to display the content corresponding to the current frame image based on the updated sampling parameters.

9. The image processing method of claim 1, wherein, The method further includes: In response to a frame editing command, the corresponding frame number is added to the deletion marker set, and the current frame number is updated to the nearest valid frame number; wherein, the frame editing command includes at least one or more of the following: a cropping start region command, a single frame deletion command, and a cropping end region command.

10. The image processing method of claim 9, wherein, Before adding the corresponding frame number to the deletion marker set in response to the frame editing instruction, the method further includes: Create a state snapshot containing the current frame array, the deletion mark set, and the current frame number, and push the state snapshot onto a preset undo stack. The state snapshot is generated based on a shallow copy of the current frame array and the deletion mark set to share the underlying data storage space. When the number of snapshots in the undo stack exceeds a preset threshold, the earliest snapshot data is removed, and the video memory resources occupied by texture objects that are no longer referenced in the earliest snapshot data are released.

11. The image processing method of claim 10, wherein, The method further includes: In response to the undo command, the latest state snapshot is popped from the preset undo stack; Restore the corresponding frame array, deletion mark set, and current frame number based on the pop-up state snapshot.

12. The image processing method of claim 9, wherein, The method further includes: In response to the submission command, the frame image files corresponding to the frame sequence numbers in the deletion mark set are deleted, and the remaining frame image files are renamed to obtain a set of consecutively numbered files. Based on the sequentially numbered file set, the synthesized image is reconstructed and saved to a preset directory; Clear the deletion mark set and the preset undo stack, and reset the current frame number to the initial value.

13. The image processing method of claim 1, wherein, The method further includes: Receive a processing completion event sent by an external processing flow, wherein the processing completion event includes target workspace path parameters; Based on the target workspace path parameters, scan the frame image files in the corresponding directory and load them as a new set of texture objects; Release the video memory resources currently occupied by the collection of old texture objects in memory; The new set of texture objects is set as the current image sequence, and the total number of frames and the current frame number are updated to display the processed frame image in the target preview screen.

14. The image processing method of claim 6, wherein, The process of merging multiple frames of images into a single composite image also includes: When the frame images in the image sequence have inconsistent sizes, the frame images of different sizes are arranged and stitched into a single composite image based on the rectangle filling algorithm; Alternatively, when the number of frames in the image sequence exceeds a preset capacity threshold for a single composite image, the frame images are stored in batches as multiple paged composite images, and the corresponding page number and in-page sampling parameters are dynamically determined based on the current frame number.

15. An image processing apparatus characterized by comprising: The device includes: The acquisition module is used to acquire an image sequence containing multiple frame images and the transparency parameter corresponding to each pixel in the frame images; The frame switching module is used to perform frame switching control on the image sequence based on the time interval parameter and determine the current frame image; The rendering module is used to render the background layer content and the foreground layer content sequentially on the rendering canvas based on the current frame image and its corresponding transparency parameter to obtain the target preview image. The foreground layer content includes the current frame image, and the transparency display of the foreground layer content is controlled based on the transparency parameter.