Printing control method based on thermal printing, thermal printer and electronic equipment
By dynamically controlling the heating time of the thermal printhead, selecting the target point set according to the grayscale level set, and sending the data group within the latching time interval, the problem of slow grayscale printing speed in the prior art is solved, and the printing speed is improved while ensuring quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-04-03
AI Technical Summary
Existing thermal printing technology slows down the printing speed during grayscale printing due to the increased number of heating cycles, making it impossible to increase speed while maintaining quality.
By determining the grayscale level of each pixel within the current print row, selecting the target point set based on different grayscale level sets, and sequentially sending data groups to the print head within the latching time interval, the heating duration is dynamically controlled, and grayscale printing is performed using a combination of latching time interval and color development time interval.
While maintaining print quality, the overall heating time was reduced, significantly improving printing speed.
Smart Images

Figure CN121777579A_ABST
Abstract
Description
Technical Field
[0001] This application relates primarily to the field of printing control technology, and in particular to a printing control method based on thermal printing, a thermal printer, and electronic equipment. Background Technology
[0002] Thermal printing utilizes heating elements arranged in a row within the printhead to generate heat, causing corresponding dots on the surface coating of thermal paper to rapidly develop color, forming a visible row of pixels. The longer the heating time, the higher the heat output and the higher the color density. Therefore, by controlling the heating time, different density levels, or grayscale levels, can be achieved. Chinese patent (publication number CN114274692A), entitled "A Grayscale Printing Method for a Thermal Printer," discloses a grayscale printing method that decomposes the grayscale value of each pixel within a row and then heats points with different grayscale values sequentially to accurately restore the pixel's grayscale information. However, this method increases the number of heating cycles, lengthening the overall heating time and significantly impacting printing speed. Summary of the Invention
[0003] The purpose of this invention is to provide a printing control method, a thermal printer, and an electronic device based on thermal printing, in order to solve the above-mentioned technical problems.
[0004] Firstly, a printing control method based on thermal printing is provided, including:
[0005] Determine the grayscale level of each pixel within the current print line;
[0006] A predetermined number of target point sets are selected based on different gray level sets. The heating state of each pixel in each target point set is grouped into a data group. The number of gray levels in different gray level sets is different. The predetermined number is at least 3. Each gray level set corresponds to a predetermined sending order.
[0007] The latching time interval between each pair of data groups is determined based on the color development time interval between the first color development time and the second color development time, wherein the first color development time is the heating time required for the thermal paper to reach the temperature for full color development, and the second color development time is the heating time required for the thermal paper to reach the temperature for initial color development.
[0008] Each data group is sent to the print head in the predetermined sending order and at the latching time interval, and the print head completes printing within the enable time period corresponding to the current print point line.
[0009] In one feasible approach, the latching time interval is calculated using the following formula:
[0010]
[0011] in, The latch time interval is... These are the first color development time and the second color development time, respectively, and k is the specified number.
[0012] In one feasible approach, determining the grayscale level of each point within the current print line includes:
[0013] Obtain the grayscale canvas;
[0014] The initial grayscale values of each pixel within the current print point row are read from the grayscale canvas. Each time a pixel is read, a heat-up tracing algorithm is used to calculate the grayscale value compensation value for the current pixel. The initial grayscale value of the current pixel is then adjusted using the grayscale value compensation value to obtain the actual grayscale value of the current pixel.
[0015] The gray level of each pixel in the current print line is determined based on the actual gray value of each pixel in the current print line.
[0016] In one implementable manner, acquiring the grayscale canvas includes:
[0017] Obtain the grayscale pixel data of the characters that need to be printed in gray from the vector font library;
[0018] The grayscale pixel data is filled into the initial canvas, and the grayscale values of other characters that do not need to be printed as gray are configured, and then rendered to form a grayscale canvas.
[0019] In one implementable manner, the step of calculating the grayscale compensation value of the current pixel using a heating history algorithm includes:
[0020] The grayscale compensation value of the current pixel is calculated using the following formula:
[0021] ,
[0022] in, This is the grayscale compensation value for the current pixel. The initial grayscale value of the current pixel. The initial grayscale value is the first pixel corresponding to the current pixel, where the first pixel is located in the same column as the current pixel and in the row preceding the current print row. The initial grayscale value is the value of the second pixel corresponding to the current pixel. The second pixel is located in the same column as the current pixel and two rows above the current print row. , is a coefficient, where .
[0023] In one implementable manner, adjusting the initial grayscale value of the current pixel using the grayscale compensation value to obtain the actual grayscale value of the current pixel includes:
[0024] The actual grayscale value of the current pixel is calculated using the following formula:
[0025] ,
[0026] in, The actual grayscale value of the current pixel. This is the grayscale compensation value for the current pixel.
[0027] In one implementable manner, the printing by the printhead within the enabled time period corresponding to the current print dot line includes:
[0028] The printhead immediately performs the following steps whenever it receives the current data group:
[0029] The current data group is received bit by bit through a shift register, and the current data group is held in the latch register using a latch signal; and,
[0030] Each heating element is selectively driven using an enable signal and the current data group, wherein each heating element is used to heat each pixel point corresponding to the same row.
[0031] Secondly, a thermal printer is provided, including a print driver and a print head;
[0032] The print driver is used to determine the grayscale level of each pixel within the current print row; select a predetermined number of target point sets based on different grayscale level sets, and group the heating states of each pixel within each target point set into data groups, wherein different grayscale level sets have different numbers of grayscale levels, and the predetermined number is at least 3, with each grayscale level set corresponding to a predetermined sending order; determine the latching time interval between every two data groups based on the color development time interval between the first color development time and the second color development time, wherein the first color development time is the heating time required for the thermal paper to reach the temperature for full color development, and the second color development time is the heating time required for the thermal paper to reach the temperature for initial color development; and send each data group sequentially to the print head in ascending order according to the predetermined sending order, with the latching time interval specified.
[0033] The print head is used to complete printing within the enabled time period corresponding to the current print point row.
[0034] Thirdly, an electronic device is provided, comprising: one or more processors; and,
[0035] One or more memories coupled to the one or more processors and storing instructions thereon, which, when executed individually or jointly by the one or more processors, cause the electronic device to perform any of the methods in the first aspect.
[0036] Fourthly, a non-transitory computer-readable storage medium is provided that stores machine-executable instructions, which, when executed by one or more processors of a machine, cause the machine to perform the method described in any one of the first aspects.
[0037] The above solution selects a specified number of target point sets based on different grayscale levels, groups the heating status of each pixel in each target point set into a data group, and sends each data group to the print head sequentially at latching time intervals. It also sends and latches the data multiple times to the print head within the enable time period of the current print row. This allows for dynamic control of the heating duration of pixels at different grayscale levels, achieving grayscale printing. Compared with related technologies, this solution maintains print quality while keeping the overall heating time constant, significantly improving printing speed.
[0038] It should be understood that the summary section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0039] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of some embodiments thereof in the accompanying drawings, in which:
[0040] Figure 1 This is a flowchart of a printing control method based on thermal printing provided in an embodiment of this application;
[0041] Figure 2 This is a schematic diagram of the timing signals inside the printhead;
[0042] Figure 3 This is a schematic diagram showing the heating time for each gray level within the enabling time period;
[0043] Figure 4 This is a schematic diagram of a thermal printer provided in this application;
[0044] Figure 5 This is a schematic diagram of an electronic device provided in this application. Detailed Implementation
[0045] The principles of this disclosure will now be described with reference to some embodiments. It should be understood that these embodiments are described for illustrative purposes only and to assist those skilled in the art in understanding and implementing this disclosure, and do not impose any limitation on the scope of this disclosure. The disclosure described herein may be implemented in ways other than those described below.
[0046] In the following description and claims, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains.
[0047] References to "an embodiment," "embodiment," "exemplary embodiment," etc., in this disclosure indicate that the described embodiments may include specific features, structures, or characteristics, but not every embodiment needs to include specific features, structures, or characteristics. Furthermore, such phrases do not necessarily refer to the same embodiment. Moreover, when a specific feature, structure, or characteristic is described in connection with an exemplary embodiment, whether explicitly described or not, those skilled in the art will recognize that such a feature, structure, or characteristic affects its connection to other embodiments.
[0048] First, the terminology used in the embodiments of this application will be introduced as follows:
[0049] Vector fonts are collections of font data that describe character outlines using mathematical formulas (such as Bézier curves and straight lines), allowing for lossless scaling and flexible style adjustments. Characters rendered from vector fonts are bitmap data with grayscale information.
[0050] Grayscale value: refers to the depth of a color; the higher the grayscale value, the darker the color. The grayscale value of a pixel can typically be 0~255, where 0 is white (no color is displayed on thermal paper), 255 is black (the color is fully displayed on thermal paper), and 1~254 is gray, with larger values being closer to black.
[0051] Grayscale levels: The grayscale differences that a printer can reproduce, typically including... Here, n represents the number of gray levels the printer supports. Thermal printers typically offer 4 gray levels (2-level grayscale printing) or 8 gray levels (3-level grayscale printing).
[0052] To enable those skilled in the art to better understand the technical solutions of the embodiments of this application, vector characters are used as the objects to be printed and described in detail below in conjunction with the accompanying drawings and embodiments.
[0053] Figure 1 This is a flowchart of a printing control method based on thermal printing proposed in this application. Figure 1 The method includes:
[0054] S101, determine the grayscale level of each pixel in the current print line.
[0055] To improve the printing effect of vector characters, in one feasible method, the grayscale level of each point within the current print line is determined, including: acquiring a grayscale canvas; reading the initial grayscale value of each pixel within the current print line from the grayscale canvas, wherein each time it is read, a grayscale value compensation value for the current pixel is calculated using a heating history algorithm, and the initial grayscale value of the current pixel is adjusted using the grayscale value compensation value to obtain the actual grayscale value of the current pixel; and determining the grayscale level of each pixel within the current print line based on the actual grayscale value of each pixel within the current print line.
[0056] A grayscale canvas is obtained by filling an initial canvas with vector characters or other patterns to be printed and then rendering it. In one feasible approach, obtaining a grayscale canvas includes:
[0057] Obtain the grayscale pixel data of the characters that need to be printed in gray from the vector font library;
[0058] The grayscale pixel data is filled into the initial canvas, and the grayscale values of other characters that do not need to be printed as gray are configured, and then rendered to form a grayscale canvas.
[0059] Assuming the grayscale value of a single pixel is 0~255, where 0 is white, 1~254 is gray, and 255 is black, if other characters that do not need to be printed in gray are black, then their grayscale value is set to 255.
[0060] The heating history algorithm is used to compensate for the grayscale value of the current print row based on the heating status of the previous few heated rows. Specifically, the heating history algorithm can be fixed, or a suitable heating history algorithm can be selected according to the characteristics of the print head.
[0061] Assuming the print head speed is below 200 mm / s, in one feasible approach, the grayscale compensation value of the current pixel is calculated using a heating history algorithm, including: calculating the grayscale compensation value of the current pixel using the following formula (1):
[0062] (1)
[0063] in, This is the grayscale compensation value for the current pixel. This is the initial grayscale value of the current pixel. This is the initial grayscale value of the first pixel corresponding to the current pixel. The first pixel is located in the same column as the current pixel and in the row above the current print row. This is the initial grayscale value of the second pixel corresponding to the current pixel. The second pixel is located in the same column as the current pixel and two rows above the current print row. , is a coefficient, where .
[0064] For example, .
[0065] The process involves adjusting the initial grayscale value of the current pixel using a grayscale compensation value to obtain the actual grayscale value of the current pixel, including:
[0066] The actual grayscale value of the current pixel is calculated using the following formula (2):
[0067] (2)
[0068] in, This represents the actual grayscale value of the current pixel. This is the grayscale compensation value for the current pixel.
[0069] Using the above method, the actual grayscale value of each pixel in the current print row can be calculated, and then the actual grayscale value can be mapped to the corresponding grayscale level.
[0070] Assuming a pixel's grayscale value is between 0 and 255, the entire grayscale value range of 0 to 255 can be evenly divided according to the number of grayscale levels currently set, so that each grayscale level corresponds to a grayscale value range. The corresponding grayscale level is determined based on the grayscale value range that each pixel falls into.
[0071] For example, suppose there are gray levels If the gray level is 0~3, then the pixels in the gray value range [0,63] can be mapped to gray level 0, and so on to determine the gray level of each pixel.
[0072] S102, select a specified number of target point sets according to different gray level sets, and form a data group by combining the heating state of each pixel in each target point set.
[0073] Different grayscale level sets have different numbers of grayscale levels, with a minimum of 3. Each grayscale level set corresponds to a predetermined sending order.
[0074] Specifically, corresponding to each gray level, when actually setting multiple gray level sets, you can start from the set containing all gray levels and subtract the smallest gray level from each set one by one.
[0075] Assuming there are gray levels If the gray levels are 0 to 3, then the following sets of gray levels are possible: {1,2,3}, {2,3}, and {3}.
[0076] For each grayscale level set, a specified number of target point sets are determined in the current print row. The specified number can be... For example, grayscale levels have At level 3, the specified number is 3.
[0077] Assuming the gray level of the first pixel a1 in the current print row is 3, the gray level of the second pixel a2 is 2, the gray level of the third pixel a3 is 1, and the gray level of the remaining pixels is 0, then the target point set selected according to the gray level set {1,2,3} is {a1,a2,a3}, the target point set selected according to the gray level set {2,3} is {a1,a2}, and the target point set selected according to the gray level set {3} is {a1}.
[0078] Furthermore, the heating status of each pixel within each target point set is grouped into data sets. Heating status can be represented as "0" and "1", where "0" indicates no heating is needed and "1" indicates heating is required. The three data sets are shown in the table below:
[0079] hexadecimal binary Group 1 E0 00 00 … 1110 0000 0000 0000 0000 0000 … Group 2 C0 00 00 … 1100 0000 0000 0000 0000 0000 … Group 3 80 00 00 … 1000 0000 0000 0000 0000 0000 …
[0080] Furthermore, within the time period corresponding to the current print line, the predetermined sending order for each grayscale level set is set.
[0081] For example, if the sending order is set according to the number of gray levels from largest to smallest, then the above gray level sets {1,2,3}, {2,3}, and {3} correspond to the following predetermined sending order: 1-2-3.
[0082] S103, determine the latching time interval between every two data groups based on the color development time interval between the first color development time and the second color development time.
[0083] The first color development time is the heating time required for the thermal paper to reach the temperature for full color development, and the second color development time is the heating time required for the thermal paper to reach the temperature at which color development begins.
[0084] Once the thermal paper reaches a stable state where it begins to develop color, the degree of color development will continue to increase as the temperature rises.
[0085] In one feasible approach, the latching time interval is calculated using the following formula (3):
[0086] (3)
[0087] in, The latching time interval, These are the first and second color development times, respectively, and k is a specified number.
[0088] Taking 2-level grayscale printing as an example, the time interval between the first color development time and the second color development time is divided into 3 equal parts, and one of them is set as the latching time interval.
[0089] S104, each data group is sent to the print head in a predetermined sending order with a latching time interval, and the print head completes printing within the enable time period corresponding to the current print point line.
[0090] In one feasible approach, printing is completed by the printhead within the enabled time period corresponding to the current print point line, including:
[0091] The print head immediately performs the following steps whenever it receives the current data group:
[0092] The current data group is received bit by bit through a shift register, and the current data group is held in the latch register using a latch signal; and,
[0093] Each heating element is selectively driven using an enable signal and the current data set, wherein the enable signal is used to indicate the target enable time, and each heating element is used to heat the pixels corresponding to the same row.
[0094] Figure 2 The timing signals inside the printhead are shown. For example... Figure 2 The timing signals include CLK, DI, LAT, and STB. The clock pulses generated by CLK and DI are used to indicate that one bit of the current data group is stored in the shift register. The clock pulse generated by LAT is used to latch the current data group in the shift register into the latch register. The clock pulse generated by STB is used to indicate the enable time period corresponding to the current print line. During the enable time period, the corresponding bit in the current data group is used to control whether the heating element is powered on. For example, when the current bit is "1", it is powered on, otherwise it is powered off when it is "0". Corresponding to each pixel in the current print line, the pixels with a heating state of "1" in the latch register are heated, while the pixels with a heating state of "0" are not heated.
[0095] Specifically, when the latch register receives a new data group, it overwrites the original data group, thus allowing continued control of the heating element without power interruption. Therefore, it is not necessary to set multiple enable time periods, but it is necessary to ensure that the duration of the enable time period is greater than the heating time required for the pixel with the highest grayscale level.
[0096] like Figure 3 As shown, taking 2-level grayscale printing as an example, the first set of data is sent to the print head, the print head latches the first set of data, and at the same time heats the corresponding pixels in the first set of data. When the grayscale level reaches a certain value... + At this moment, the second set of data is sent to the print head, which latches it. Simultaneously, each pixel within the second set of data is heated. Since the second set of data only includes pixels with gray levels 2 and 3, from this point onward, pixels with gray level 1 are no longer heated, while pixels with gray levels 2 and 3 continue to be heated. This process continues until the desired gray level is reached. + At this moment, the third set of data is sent to the print head, the print head latches the third set of data, and at the same time heats each pixel corresponding to the third set of data. Since the third set of data only includes pixels with a gray level of 3, from this moment on, the pixels with a gray level of 2 are no longer heated, but the pixels with a gray level of 3 continue to be heated.
[0097] Based on the above method, the heating time for a pixel with a grayscale level of 1 is | + The heating time for a pixel with a grayscale level of 2 is | + The heating time for a pixel with a grayscale level of 3 is | + Therefore, by sending data groups to the print head multiple times and latching the data during the current print row's enable period, the heating time of different pixels can be dynamically controlled. This ensures that the overall heating time does not increase while maintaining print quality, thus significantly improving printing speed.
[0098] like Figure 4 This application provides a thermal printer, including a print driver 401 and a print head 402; wherein,
[0099] Print driver 401 is used to determine the grayscale level of each pixel within the current print row; select a specified number of target point sets based on different grayscale level sets, and group the heating state of each pixel within each target point set into a data group. Different grayscale level sets have different numbers of grayscale levels, with a specified number of at least 3. Each grayscale level set corresponds to a predetermined sending order. Based on the color development time interval between the first and second color development times, a latching time interval between every two data groups is determined. The first color development time is the heating time required for the thermal paper to reach a sufficiently developed temperature, and the second color development time is the heating time required for the thermal paper to reach a temperature where color development begins. Each data group is sent sequentially to the print head according to the predetermined sending order and the latching time interval.
[0100] Print head 402 is used to complete printing within the enabled time period corresponding to the current print point line.
[0101] In this solution, a thermal printer can be used to perform all the steps of the thermal printing-based printing control method described above.
[0102] like Figure 5 This application also provides an electronic device, including: one or more processors 501; and one or more memories 502 coupled to the one or more processors 501 and storing instructions thereon, which cause the electronic device to perform the above-described thermal printing-based printing control method when the instructions are executed individually or jointly by the one or more processors 501.
[0103] This application also provides a non-transitory computer-readable storage medium storing machine-executable instructions that can be executed by one or more processors of a machine. The machine may include the charging device mentioned above. When the computer-executable instructions are executed by one or more processors, they cause the machine to perform any of the methods mentioned above.
[0104] Computer-readable storage media may contain a propagated data signal containing computer program code, for example, on baseband or as part of a carrier wave. This propagated signal may take various forms, including electromagnetic, optical, and so on, or suitable combinations thereof. The computer-readable storage medium can be connected to an instruction execution system, apparatus, or device to enable communication, propagation, or transmission of a program for use. The program code located on the computer-readable storage medium can be propagated through any suitable medium, including radio, cable, fiber optic cable, radio frequency signals, or similar media, or any combination of the above media.
[0105] The basic concepts have been described above. Obviously, for those skilled in the art, the above disclosure is merely illustrative and does not constitute a limitation of this application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and corrections to this application. Such modifications, improvements, and corrections are suggested in this application, and therefore remain within the spirit and scope of the exemplary embodiments of this application.
[0106] Furthermore, this application uses specific terms to describe embodiments of the application. For example, "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic related to at least one embodiment of the application. Therefore, it should be emphasized and noted that "an embodiment," "one embodiment," or "an alternative embodiment" mentioned twice or more in different locations in this specification do not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of the application can be appropriately combined.
[0107] Some aspects of this application can be executed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The aforementioned hardware or software may be referred to as a "data block," "module," "engine," "unit," "component," or "system." The processor may be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or combinations thereof. Furthermore, aspects of this application may manifest as computer products residing in one or more computer-readable media, including computer-readable program code. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, magnetic tapes, etc.), optical discs (e.g., compressed CDs, digital multifunction DVDs, etc.), smart cards, and flash memory devices (e.g., cards, sticks, key drives, etc.).
[0108] Similarly, it should be noted that, in order to simplify the description of the present application and thus aid in the understanding of one or more embodiments of the invention, the foregoing description of the embodiments of the present application sometimes combines multiple features into a single embodiment, drawing, or description thereof. However, this disclosure method does not imply that the subject matter of the application requires more features than those mentioned in the claims. In fact, the embodiments contain fewer features than all the features of the single embodiments disclosed above.
[0109] In some embodiments, numbers describing the quantity of components and attributes are used. It should be understood that such numbers used in the description of embodiments are modified in some examples with the terms "approximately," "approximately," or "generally." Unless otherwise stated, "approximately," "approximately," or "generally" indicates that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may be changed depending on the characteristics required by individual embodiments. In some embodiments, numerical parameters should take into account specified significant digits and employ a general method of digit reservation. Although the numerical ranges and parameters used to confirm their breadth of scope in some embodiments of this application are approximate values, in specific embodiments, such values are set as precisely as feasible.
[0110] Although this application has been described with reference to specific embodiments, those skilled in the art should recognize that the above embodiments are only used to illustrate this application, and various equivalent changes or substitutions can be made without departing from the spirit of this application. Therefore, any changes or modifications to the above embodiments within the essential spirit of this application will fall within the scope of the claims of this application.
Claims
1. A printing control method based on thermal printing, characterized in that, include: Determine the grayscale level of each pixel within the current print line; A predetermined number of target point sets are selected based on different gray level sets. The heating state of each pixel in each target point set is grouped into a data group. The number of gray levels in different gray level sets is different. The predetermined number is at least 3. Each gray level set corresponds to a predetermined sending order. The latching time interval between each pair of data groups is determined based on the color development time interval between the first color development time and the second color development time, wherein the first color development time is the heating time required for the thermal paper to reach the temperature for full color development, and the second color development time is the heating time required for the thermal paper to reach the temperature for initial color development. Each data group is sent to the print head in the predetermined sending order and at the latching time interval, and the print head completes printing within the enable time period corresponding to the current print point line.
2. The printing control method as described in claim 1, characterized in that, The latch time interval is calculated using the following formula: in, The latch time interval is... These are the first color development time and the second color development time, respectively, and k is the specified number.
3. The printing control method as described in claim 1 or 2, characterized in that, Determining the grayscale level of each point within the current print line includes: Obtain the grayscale canvas; The initial grayscale values of each pixel within the current print point row are read from the grayscale canvas. Each time a pixel is read, a heat-up tracing algorithm is used to calculate the grayscale value compensation value for the current pixel. The initial grayscale value of the current pixel is then adjusted using the grayscale value compensation value to obtain the actual grayscale value of the current pixel. The gray level of each pixel in the current print line is determined based on the actual gray value of each pixel in the current print line.
4. The printing control method as described in claim 3, characterized in that, The process of obtaining the grayscale canvas includes: Obtain the grayscale pixel data of the characters that need to be printed in gray from the vector font library; The grayscale pixel data is filled into the initial canvas, and the grayscale values of other characters that do not need to be printed as gray are configured, and then rendered to form a grayscale canvas.
5. The printing control method as described in claim 3, characterized in that, The step of calculating the grayscale compensation value of the current pixel using the heating history algorithm includes: The grayscale compensation value of the current pixel is calculated using the following formula: , in, This is the grayscale compensation value for the current pixel. The initial grayscale value of the current pixel. The initial grayscale value is the first pixel corresponding to the current pixel, where the first pixel is located in the same column as the current pixel and in the row preceding the current print row. The initial grayscale value is the value of the second pixel corresponding to the current pixel. The second pixel is located in the same column as the current pixel and two rows above the current print row. , is a coefficient, where .
6. The printing control method as described in claim 5, characterized in that, The step of adjusting the initial grayscale value of the current pixel using the grayscale compensation value to obtain the actual grayscale value of the current pixel includes: The actual grayscale value of the current pixel is calculated using the following formula: , in, The actual grayscale value of the current pixel. This is the grayscale compensation value for the current pixel.
7. The printing control method as described in claim 1, characterized in that, The process of printing by the print head within the enabled time period corresponding to the current print point row includes: The printhead immediately performs the following steps whenever it receives the current data group: The current data group is received bit by bit through a shift register, and the current data group is held in the latch register using a latch signal; and, Each heating element is selectively driven using an enable signal and the current data group, wherein each heating element is used to heat each pixel corresponding to the same row.
8. A thermal printer, characterized in that, Including the print driver and print head; The print driver is used to determine the grayscale level of each pixel within the current print row; select a predetermined number of target point sets based on different grayscale level sets, and group the heating states of each pixel within each target point set into data groups, wherein different grayscale level sets have different numbers of grayscale levels, and the predetermined number is at least 3, with each grayscale level set corresponding to a predetermined sending order; determine the latching time interval between every two data groups based on the color development time interval between the first color development time and the second color development time, wherein the first color development time is the heating time required for the thermal paper to reach the temperature for full color development, and the second color development time is the heating time required for the thermal paper to reach the temperature for initial color development; and send each data group sequentially to the print head according to the predetermined sending order and the latching time interval. The print head is used to complete printing within the enabled time period corresponding to the current print point row.
9. An electronic device, characterized in that, include: One or more processors; as well as, One or more memories coupled to the one or more processors and storing instructions thereon, which, when executed individually or jointly by the one or more processors, cause the electronic device to perform the method of any one of claims 1-7.
10. A non-transitory computer-readable storage medium storing machine-executable instructions, characterized in that, When executed by one or more processors of the machine, the machine-executable instructions cause the machine to perform the method of any one of claims 1-7.
Citation Information
Patent Citations
Grayscale printing method of thermal printer
CN114274692A