Embedded picture conversion method, system and equipment and storage medium

By preprocessing and converting image data on a PC, the watermarking process on embedded devices is simplified, solving the problem of limited resources on embedded devices and achieving efficient, real-time watermark overlay and optimized display effects.

CN121919174APending Publication Date: 2026-04-24RECONOVA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Embedded devices suffer from high CPU load, high memory consumption, low processing efficiency, and poor visual effects when adding image watermarks due to resource constraints.

Method used

On the PC, the source image file is parsed and converted into intermediate format pixel data. The conversion is performed according to the bitmap format supported by the embedded device, and the target format pixel data is saved as a raw data file without a file header. The embedded device directly loads and writes it to the video frame buffer during operation.

Benefits of technology

It significantly reduces the computational load and memory consumption of embedded devices, improves watermarking efficiency and system real-time performance, optimizes display effects, reduces system maintenance complexity, and has broad platform adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121919174A_ABST
    Figure CN121919174A_ABST
Patent Text Reader

Abstract

The invention discloses an embedded picture conversion method, system and device and a storage medium. The method comprises the steps that a source image file is analyzed and converted into pixel data in a first intermediate format at a PC end through a writing tool; converting the first intermediate format pixel data into corresponding target format pixel data according to a bitmap format supported by the target embedded device; storing the target format pixel data as an original data file without a file header, and importing the original data file into an embedded device storage system; and during the operation of the embedded device, loading the original data file to the memory, and in response to a watermark adding instruction, directly writing the target format pixel data in the memory into a specified position of a video frame buffer area. According to the method, the format conversion work with dense calculation is preposed to the PC end for processing, so that the CPU and memory resource consumption of embedded equipment is remarkably reduced, the watermark adding efficiency and real-time performance are improved, and meanwhile, the display quality of the image is ensured by optimizing the conversion algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image conversion technology, specifically to an embedded image conversion method, system, device, and storage medium. Background Technology

[0002] With the rapid development of embedded technology, embedded devices are increasingly widely used in fields such as security monitoring, smart vehicles, and smart homes. In these applications, it is often necessary to overlay image watermarks (such as status icons, warning messages, trademarks, etc.) onto video streams in real time to provide additional visual information or to indicate copyright. However, because embedded devices are typically limited by cost, their memory capacity and CPU processing power are often relatively limited, posing a significant challenge to the efficiency and effectiveness of image watermarking.

[0003] Currently, a common practice for implementing image watermark overlay on embedded devices is to first store the source image (such as PNG format) with an alpha channel in the device's non-volatile memory (such as NAND Flash). When a watermark needs to be added, the following steps are performed: First, the image file is read into memory; then, it is decoded in memory into an intermediate format (such as ARGB8888) containing complete color and transparency information; next, according to the bitmap format actually supported by the embedded device's frame buffer (such as ARGB1555, RGB565, etc.), the pixel data of the intermediate format is converted again. This process usually involves the selection or compression of the alpha channel and the reduction of color depth; finally, the converted data is written to a specified location in the frame buffer.

[0004] However, the aforementioned existing technical solutions have significant drawbacks: First, performing multiple image format conversion operations on resource-constrained embedded devices significantly consumes valuable CPU computing cycles, potentially leading to decreased video processing performance or delayed watermark addition, thus affecting system real-time performance. Second, the conversion process (especially decoding and color space conversion) requires storing both raw and intermediate data in memory simultaneously, resulting in high peak memory usage, which is an excessive burden for memory-constrained embedded systems. Furthermore, the complex conversion process increases the implementation complexity and maintenance cost of the embedded software. Additionally, during the conversion process, particularly when handling alpha channels, simple processing methods may result in jagged edges on irregular graphics, affecting the visual effect of the watermark.

[0005] In view of this, the present invention proposes an embedded image conversion method, system, device and storage medium, which can significantly reduce the computational load and memory consumption of embedded devices in the process of adding watermarks to images, while ensuring good display effect. Summary of the Invention

[0006] To address the problems of high CPU and memory resource consumption, low processing efficiency, and increased system complexity caused by real-time image format conversion in existing embedded devices, this invention provides an embedded image conversion method, system, device, and storage medium to solve the aforementioned technical defects.

[0007] In a first aspect, the present invention proposes an embedded image conversion method, comprising the following steps:

[0008] S1. Use the PC-based editing tool to parse the source image file and convert it into pixel data in the first intermediate format;

[0009] S2. Based on the bitmap format supported by the target embedded device, convert the pixel data of the first intermediate format into the corresponding target format pixel data;

[0010] S3. Save the converted target format pixel data as a raw data file without a file header, and import it into the storage system of the embedded device;

[0011] S4. During the operation of the embedded device, the original data file is loaded into memory, and in response to the watermark addition instruction, the target format pixel data in memory is written to the specified position of the video frame buffer.

[0012] Preferably, in step S2, the pixel data of the first intermediate format is converted into the corresponding target format pixel data according to the bitmap format supported by the target embedded device, specifically including the following sub-steps:

[0013] S21. Identify whether the bitmap format supported by the target embedded device supports alpha channels. If alpha channels are supported, proceed to steps S22-S25; otherwise, only perform color channel bit width compression.

[0014] S22. If a transparency channel is supported, perform anti-aliasing preprocessing on the transparency channel data in the pixel data of the first intermediate format.

[0015] S23. Perform binarization on the preprocessed transparent channel data;

[0016] S24. Perform bit-width compression on the color channel data in the pixel data of the first intermediate format;

[0017] S25. Combine the processed alpha channel data and color channel data according to the bit field specification of the target format to generate pixel data in the target format.

[0018] More preferably, in step S23, the binarization conversion adopts a threshold comparison method, specifically including: comparing the 8-bit transparency channel value in the pixel data of the first intermediate format with a preset threshold; when the transparency channel value is greater than the preset threshold, setting the 1-bit transparency channel value in the target format to 1, otherwise setting it to 0; wherein, the preset threshold is the hexadecimal value 0x7F.

[0019] More preferably, in step S24, the bit width compression adopts an error diffusion dithering algorithm, which specifically includes: calculating the quantization error of the current pixel color channel value, and diffusing the quantization error to the adjacent unprocessed pixels according to a predetermined ratio.

[0020] Preferably, in step S2, the target format is ARGB1555 format, RGB565 format, or RGBA4444 format;

[0021] When the target format is ARGB1555, step S2 specifically includes:

[0022] Convert the 8-bit alpha channel value in the pixel data of the first intermediate format to a 1-bit alpha channel value;

[0023] The 8-bit R, G, and B color channel values ​​of the pixel data in the first intermediate format are shifted 3 bits to the right to obtain 5-bit R values, 5-bit G values, and 5-bit B values.

[0024] Combine the 1-bit alpha channel value, 5-bit R value, 5-bit G value, and 5-bit B value into 16-bit pixel data according to the ARGB1555 bit field specification.

[0025] Preferably, in step S4, for a target format that supports a transparent channel, the write operation specifically involves writing only the data corresponding to pixels marked as opaque into the video frame buffer.

[0026] Preferably, step S3 further includes: generating a format description file to be imported into the embedded device; the format description file includes at least image width, image height, color space information and target format type.

[0027] Secondly, the present invention proposes an embedded image conversion system for implementing any of the above-mentioned embedded image conversion methods, the system comprising:

[0028] The image parsing module is used to parse the source image file and convert it into pixel data in a first intermediate format using the PC-side writing tools;

[0029] The format conversion module is used to convert the pixel data of the first intermediate format into the corresponding target format pixel data according to the bitmap format supported by the target embedded device;

[0030] The file generation module is used to save the converted target format pixel data as a raw data file without a file header and import it into the storage system of the embedded device.

[0031] The watermark compositing module is used to load the original data file into memory during the operation of the embedded device, and in response to the watermark addition instruction, write the target format pixel data in memory to the specified position of the video frame buffer.

[0032] Thirdly, the present invention proposes a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the steps of the embedded image conversion method as described above.

[0033] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the embedded image conversion method as described above.

[0034] Compared with the prior art, the beneficial results of the present invention are as follows:

[0035] (1) Significantly Reduced Resource Consumption of Embedded Devices: By moving the computationally intensive image format conversion operation from the resource-constrained embedded device to a powerful PC, this invention fundamentally avoids the high CPU load and memory consumption caused by real-time decoding and format conversion during embedded device operation. The embedded device only needs to perform efficient memory data transfer operations, allowing it to concentrate its valuable computing resources on core business logic (such as video encoding / decoding, AI inference, etc.), greatly improving the overall system performance and response speed.

[0036] (2) Improved watermarking efficiency and system real-time performance: Since the embedded device loads target format pixel data that can be directly written to the frame buffer, the complex real-time conversion process is eliminated, and the watermarking process is simplified to a fast memory copy operation (such as memcpy or DMA transfer). This greatly shortens the latency of watermark overlay and can better meet the stringent real-time requirements of video processing in fields such as security and automotive.

[0037] (3) Optimized display effect and processing accuracy: In the PC-side preprocessing stage, this invention employs a refined conversion algorithm. For example, anti-aliasing preprocessing smooths the edges of the transparent channel, effectively reducing the jagged edges of irregular graphics caused by binarization conversion; error diffusion dithering algorithm processes the color channel, reducing color bit depth while maintaining a visually smooth transition. These measures are difficult to implement in real time on resource-constrained embedded devices, thus achieving a visual effect superior to traditional direct conversion on embedded devices while ensuring processing efficiency.

[0038] (4) Enhanced System Maintainability and Flexibility: This invention decouples the format conversion logic from the embedded application. When new bitmap formats need to be supported or the conversion algorithm needs to be updated, only the PC-side programming tools need to be updated, without modifying and redeploying the firmware on the embedded device, thus reducing the complexity and cost of system maintenance. At the same time, the introduction of the format description file enables the embedded device to automatically adapt to image data of different specifications, improving the system's flexibility and scalability.

[0039] (5) Broad platform adaptability: This invention defines and supports conversion rules for various common bitmap formats on embedded platforms (such as ARGB1555, RGB565, RGBA4444, etc.) and provides configurable conversion strategies. This design enables the solution to flexibly adapt to embedded devices with different hardware configurations and performance requirements, thus having broad applicability. Attached Figure Description

[0040] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments, taken with reference to the accompanying drawings:

[0041] Figure 1 This is a flowchart of the embedded image conversion method according to the present invention;

[0042] Figure 2 This is a schematic diagram of the embedded image conversion system according to the present invention;

[0043] Figure 3 This is a schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present invention. Detailed Implementation

[0044] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0045] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0046] This invention proposes an embedded image conversion method. Figure 1 A flowchart of the embedded image conversion method of the present invention is shown, as follows: Figure 1 As shown, the method includes the following steps:

[0047] S1. Use the PC-based editing tool to parse the source image file and convert it into pixel data in the first intermediate format.

[0048] In step S1, the source image file is parsed and converted into pixel data in a first intermediate format using a programming tool running on a development host (such as a personal computer). The first intermediate format is preferably ARGB8888 format, where each pixel consists of 32 bits of data, including an 8-bit Alpha (transparency) channel, an 8-bit Red channel, an 8-bit Green channel, and an 8-bit Blue channel. This format fully preserves the color and transparency information of the source image, providing a unified and lossless intermediate data foundation for subsequent format conversions.

[0049] In practice, the writing tool receives user input parameters, including the source image file path and the specified target resolution (e.g., 200 pixels × 200 pixels). Source image files include, but are not limited to, vector graphics files (such as SVG and AI formats) or bitmap files with alpha channels (such as PNG format). The writing tool employs different parsing strategies depending on the source image type.

[0050] For vector graphics files, the tool uses open-source graphics libraries (such as Skia, Cairo, or NanoVG) for parsing and rasterization. First, it parses the geometric description data of the vector file, including path coordinates, curve control points, fill color, stroke attributes, and transparency effects. Then, at the specified target resolution, it performs rasterization using anti-aliasing rendering algorithms (such as grayscale-based region sampling or multi-sampling-based edge smoothing) to generate ARGB8888 data for each pixel. This process ensures that vector graphics have smooth edges and clear details when converted to pixel data, avoiding jagged edges.

[0051] For bitmap files with alpha channels (such as PNG), the tool extracts the image's width, height, color type, and pixel data by parsing the file header structure. If the source bitmap is already in ARGB8888 format, the pixel data is read directly; if it is in other formats (such as indexed color or RGB format), the format is first decoded and converted to the standard ARGB8888 format to ensure the integrity of the alpha and color channels.

[0052] After parsing, the tool organizes the generated pixel data into a contiguous memory array with a length of width × height × 4 bytes. Each pixel stores the 8-bit values ​​of its four channels (A, R, G, B) sequentially. This array can be used directly for subsequent processing or temporarily stored as an intermediate file.

[0053] This step simplifies the complexity of subsequent conversion processes by uniformly converting heterogeneous source images into a standardized intermediate format, while ensuring the accuracy and consistency of image data, laying a solid foundation for efficient processing on embedded devices.

[0054] Continue to refer to Figure 1 The embedded image conversion method proposed in this invention further includes the following steps:

[0055] S2. Based on the bitmap format supported by the target embedded device, convert the pixel data of the first intermediate format into the corresponding target format pixel data (the target format is BITMAP format, such as: ARGB1555 format, RGB565 format, or RGBA4444 format), specifically including the following sub-steps:

[0056] S21. Identify whether the bitmap format supported by the target embedded device supports alpha channels. If alpha channels are supported, execute S22-S25; otherwise, only perform color channel bit width compression. That is, if alpha channels are not supported, directly compress the color channel data in the pixel data of the first intermediate format, and combine the compressed color channel data according to the bit field specification of the target format to generate the target format pixel data.

[0057] Specifically, the development tool first reads the configuration information of the target embedded platform and identifies the bitmap format characteristics it supports. If the target format supports alpha channels (such as ARGB1555, RGBA4444), the subsequent alpha channel processing is executed; if the target format does not support alpha channels (such as RGB565), the alpha channel processing is skipped, and the bit width of the color channels is compressed directly.

[0058] S22. If a transparency channel is supported, perform anti-aliasing preprocessing on the transparency channel data in the pixel data of the first intermediate format, specifically including:

[0059] When the target format supports alpha channels, to avoid jagged edges in the image due to subsequent binarization processing, anti-aliasing preprocessing is first performed on the 8-bit alpha channel in the ARGB8888 format. Specifically, an edge smoothing algorithm based on Gaussian blur is used: taking the current pixel as the center, a 3×3 neighborhood window is taken, and the weighted average of the alpha values ​​of each neighboring pixel is calculated as the new alpha value of the current pixel.

[0060] S23. Perform binarization transformation on the preprocessed transparent channel data, specifically including:

[0061] The preprocessed 8-bit alpha channel values ​​(range 0x00-0xFF) are converted to 1-bit transparency values ​​supported by the target format. A threshold comparison method is used, with the threshold set to hexadecimal value 0x7F (i.e., decimal 127).

[0062] When the Alpha value is greater than 0x7F, the pixel is considered opaque, and the 1-bit transparency channel value in the target format is set to 1.

[0063] When the Alpha value is ≤ 0x7F, the pixel is considered transparent, and the 1-bit transparency channel value in the target format is set to 0.

[0064] This threshold is an empirical value based on the characteristics of human vision and the needs of embedded displays. While ensuring visual effects in most scenarios, it achieves maximum compression of transparency information.

[0065] S24. Perform bit-width compression on the color channel data in the pixel data of the first intermediate format, specifically including:

[0066] Bit width compression was applied to the three 8-bit color channels (Red, Green, and Blue) in the ARGB8888 format. To improve the visual quality after compression, the Floyd-Steinberg error diffusion dithering algorithm was used.

[0067] 1. Traverse each pixel in scanline order;

[0068] 2. For each color channel value of the current pixel, quantize according to the target bit width (e.g., quantize from 8 bits to 5 bits);

[0069] 3. Calculate the quantization error: Error = Original channel value - (Quantized channel value * (255 / (2^n-1))), where n is the target bit width;

[0070] 4. The error is spread to the four adjacent unprocessed pixels on the right, lower left, lower right, and lower right sides according to a predetermined ratio, with the spread ratios being 7 / 16, 3 / 16, 5 / 16, and 1 / 16, respectively.

[0071] This algorithm effectively reduces color banding artifacts by spatially dispersing quantization errors, maintaining a visually smooth transition while reducing bit depth.

[0072] S25. Combine the processed alpha channel data and color channel data according to the bit field specification of the target format to generate pixel data in the target format. To explain the conversion rules for different formats in detail, the following uses three typical formats—ARGB1555, RGB565, and RGBA4444—as examples. Their core conversion rules are shown in the table below:

[0073] Table 1: ARGB8888 to Target Embedded Bitmap Format Conversion Rules Reference Table

[0074]

[0075] Based on the above general rules, the following is a specific calculation example using the ARGB1555 format:

[0076] Suppose an embedded device needs to support watermark display in 10 states, each with a PNG image (with alpha channel, 32-bit) and a resolution of 200×200 pixels. The tool first converts this image to ARGB8888 data, with a data length of 200×200×4 = 160,000 bytes. Then, it converts the image to ARGB1555 as the target format.

[0077] Transparency conversion: For ARGB8888 pixels (A=0xA0, R=0xB4, G=0xC8, B=0xDC), since the Alpha channel value 0xA0 (decimal 160) is greater than the threshold 127, the 1-bit Alpha value in the target ARGB1555 format is set to 1.

[0078] Color channel conversion: Shifting the red channel 0xB4 right by 3 bits results in 0x16 (decimal 22); shifting the green channel 0xC8 right by 3 bits results in 0x19 (decimal 25); shifting the blue channel 0xDC right by 3 bits results in 0x1B (decimal 27).

[0079] Data combination: Combine the converted channel values ​​according to the ARGB1555 bit field specification: (1<<15)|(22<<10)|(25<<5)|27 to obtain the final 16-bit pixel value 0xDB3B (where << is the left shift operator and | is the bitwise OR operator).

[0080] File size: After completing the conversion of all pixels, the resulting ARGB1555 format BITMAP data file size becomes 200×200×2=80,000 bytes, which is 50% smaller than the original ARGB8888 data. This significant reduction in data volume directly reduces the storage space occupied by embedded devices and the bandwidth requirements during subsequent memory loading.

[0081] Subsequently, these converted BITMAP files in the specified format are imported into the embedded device's file system. The embedded device loads these files into memory during system startup. When the video pipeline needs to add a watermark, the system directly copies the loaded BITMAP data from memory to the specified location in the video frame buffer, thus efficiently completing the watermark addition operation. This entire process avoids time-consuming real-time format conversion on resource-constrained embedded devices, achieving fast and low-overhead watermark overlay.

[0082] Continue to refer to Figure 1 The embedded image conversion method proposed in this invention further includes the following steps:

[0083] S3. Save the converted target format pixel data as a headerless raw data file and import it into the embedded device's storage system. Additionally, generate a format description file to be imported into the embedded device; this file must contain at least the image width, image height, color space information, and target format type. This format description file uses a lightweight text format (such as JSON or INI).

[0084] Specifically, the writing tool saves the converted target format pixel data in raw binary format without a file header. The pixel data is arranged in line-major order, and each pixel is stored tightly according to the bit width of the target format, without containing any file header information, file identifiers, or compressed data.

[0085] For ARGB1555 format: each pixel occupies 2 bytes (16 bits), and the file size is width × height × 2 bytes.

[0086] For RGB565 format: each pixel also occupies 2 bytes, and the file size is width × height × 2 bytes.

[0087] For RGBA4444 format: each pixel occupies 2 bytes, and the file size is width × height × 2 bytes.

[0088] For example, for a 200×200 resolution ARGB1555 bitmap, the generated raw data file size is precisely 200×200×2=80,000 bytes. This headerless design allows embedded devices to directly map file content into memory without complex file parsing, greatly simplifying the data loading process.

[0089] Continue to refer to Figure 1 The embedded image conversion method proposed in this invention further includes the following steps:

[0090] S4. During the operation of the embedded device, the original data file is loaded into memory, and in response to the watermark addition instruction, the target format pixel data in memory is written to the specified location in the video frame buffer. It should be understood that for target formats that support alpha channels, the write operation specifically involves writing only the data corresponding to pixels marked as opaque (i.e., pixel data with the alpha channel flag set to 1) to the video frame buffer.

[0091] Specifically, the embedded device employs a preloading mechanism. During system startup or watermark function initialization, the BITMAP file stored in non-volatile memory is preloaded into a contiguous buffer in memory. Upon receiving a watermark addition instruction, the system efficiently writes the target format pixel data already loaded in memory to a specified location in the video frame buffer according to the instruction parameters. For target formats supporting alpha channels, the system performs pixel-level transparency judgment during the write operation: by detecting the alpha channel flag in the pixel data, only pixels marked as opaque are written to the frame buffer, while transparent pixels retain their original frame content, thus achieving a perfect overlay of irregular graphics. To improve performance, the system can adopt different optimization strategies based on hardware capabilities, including using memory copy functions for line-by-line copying, utilizing a DMA controller for zero-copy transfer, or configuring hardware overlay layers to automatically handle transparency blending. These measures minimize CPU overhead while ensuring visual effects and guaranteeing real-time video processing. The entire write process also includes robust boundary checks and error handling mechanisms to effectively prevent data overflow and ensure stable system operation.

[0092] Further reference Figure 2 As an implementation of the above method, in a second aspect, the present invention provides an embodiment of the structure of an embedded image conversion system 200, which can be specifically applied to various electronic devices. The embedded image conversion system 200 includes the following modules:

[0093] Image parsing module 210 is used to parse the source image file and convert it into pixel data in a first intermediate format using a writing tool on a PC.

[0094] The format conversion module 220 is used to convert the pixel data of the first intermediate format into the corresponding target format pixel data according to the bitmap format supported by the target embedded device;

[0095] The file generation module 230 is used to save the converted target format pixel data as a raw data file without a file header and import it into the storage system of the embedded device.

[0096] The watermark synthesis module 240 is used to load the original data file into memory during the operation of the embedded device, and in response to the watermark addition instruction, write the target format pixel data in memory to a specified position in the video frame buffer.

[0097] Thirdly, the present invention proposes a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the steps of the embedded image conversion method as described above.

[0098] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the embedded image conversion method as described above.

[0099] The following is for reference. Figure 3 It shows a schematic diagram of the structure of a computer system 300 suitable for implementing terminal devices or servers in the embodiments of this application. Figure 3 The terminal device or server shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0100] like Figure 3 As shown, the computer system 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 302 or programs loaded from storage section 308 into random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the computer system 300. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0101] The following components are connected to I / O interface 305: an input section 306 including a keyboard, mouse, etc.; an output section 307 including a liquid crystal display (LCD) and speakers, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card and a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to I / O interface 305 as needed. A removable medium 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 310 as needed so that computer programs read from it can be installed into storage section 308 as needed.

[0102] Specifically, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the functions defined in the methods of this application. It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable medium or any combination thereof. The computer-readable medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0103] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0104] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0105] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. An embedded image conversion method, characterized in that, Includes the following steps: S1. Use the PC-based editing tool to parse the source image file and convert it into pixel data in the first intermediate format; S2. Based on the bitmap format supported by the target embedded device, convert the pixel data of the first intermediate format into the corresponding target format pixel data; S3. Save the converted target format pixel data as a raw data file without a file header, and import it into the storage system of the embedded device; S4. During the operation of the embedded device, the original data file is loaded into memory, and in response to the watermark addition instruction, the target format pixel data in memory is written to the specified position of the video frame buffer.

2. The embedded image conversion method according to claim 1, characterized in that, In step S2, the pixel data of the first intermediate format is converted into the corresponding target format pixel data according to the bitmap format supported by the target embedded device. This specifically includes the following sub-steps: S21. Identify whether the bitmap format supported by the target embedded device supports alpha channels. If alpha channels are supported, proceed to steps S22-S25; otherwise, only perform color channel bit width compression. S22. If a transparent channel is supported, anti-aliasing preprocessing is performed on the transparent channel data in the pixel data of the first intermediate format. S23. Perform binarization on the preprocessed transparent channel data; S24. Perform bit-width compression on the color channel data in the pixel data of the first intermediate format; S25. Combine the processed transparency channel data and color channel data according to the bit field specification of the target format to generate target format pixel data.

3. The embedded image conversion method according to claim 2, characterized in that, In step S23, the binarization conversion uses a threshold comparison method, specifically including: comparing the 8-bit transparency channel value in the pixel data of the first intermediate format with a preset threshold; when the transparency channel value is greater than the preset threshold, setting the 1-bit transparency channel value in the target format to 1, otherwise setting it to 0; wherein, the preset threshold is the hexadecimal value 0x7F.

4. The embedded image conversion method according to claim 2, characterized in that, In step S24, the bit width compression adopts an error diffusion dithering algorithm, which specifically includes: calculating the quantization error of the current pixel color channel value, and spreading the quantization error to the adjacent unprocessed pixels according to a predetermined ratio.

5. The embedded image conversion method according to claim 1, characterized in that, In step S2, the target format is ARGB1555, RGB565, or RGBA4444. When the target format is ARGB1555 format, step S2 specifically includes: Convert the 8-bit alpha channel value in the pixel data of the first intermediate format to a 1-bit alpha channel value; The 8-bit R, G, and B color channel values ​​of the pixel data in the first intermediate format are shifted 3 bits to the right to obtain 5-bit R values, 5-bit G values, and 5-bit B values. The 1-bit alpha channel value, 5-bit R value, 5-bit G value, and 5-bit B value are combined into 16-bit pixel data according to the ARGB1555 bit field specification.

6. The embedded image conversion method according to claim 1, characterized in that, In step S4, for a target format that supports alpha channels, the write operation specifically involves writing only the data corresponding to pixels marked as opaque into the video frame buffer.

7. The embedded image conversion method according to claim 1, characterized in that, Step S3 further includes: generating a format description file to be imported into the embedded device; the format description file includes at least image width, image height, color space information and target format type.

8. An embedded image conversion system for implementing the embedded image conversion method according to any one of claims 1 to 7, characterized in that, The system includes: The image parsing module is used to parse the source image file and convert it into pixel data in a first intermediate format using the PC-side writing tools; The format conversion module is used to convert the pixel data of the first intermediate format into the corresponding target format pixel data according to the bitmap format supported by the target embedded device; The file generation module is used to save the converted target format pixel data as a raw data file without a file header and import it into the storage system of the embedded device. The watermark synthesis module is used to load the original data file into memory during the operation of the embedded device, and in response to the watermark addition instruction, write the target format pixel data in memory into a specified position of the video frame buffer.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the embedded image conversion method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the embedded image conversion method as described in any one of claims 1 to 7.