Heating pulse determination method and printing chip
By converting the grayscale value into binary numerical values and matching the corresponding heating pulses, the problem of excessive pulse count or long heating time in the prior art is solved, efficient grayscale printing is achieved, and printing speed is improved.
Patent Information
- Application Number
- CN202411667656.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2044-11-20
AI Technical Summary
When the existing grayscale printing technology achieves efficient printing, it faces the problem of excessive pulse number or long heating time, which leads to an increase in current and affects the printing speed.
By converting the grayscale value of the pixel point into a binary value, it is divided into a first significant bit and a second significant bit, and matching the corresponding heating pulse for each bit, the first significant bit matches the first heating pulse with the same pulse width, The second significant bit matches the second heating pulse with different pulse widths, thereby reducing the maximum pulse width, reducing the current pressure, and avoiding excessive pulse counts.
Efficient heating of the grayscale value of pixel points is achieved, the maximum pulse width is reduced, the current pressure is reduced, and the excessive number of pulses is avoided, thereby increasing the printing speed.
Smart Images

Figure CN119489628A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of grayscale printing, and in particular to a method for determining a heating pulse and a printing chip. Background Art
[0002] At present, grayscale printing can be achieved through thermal printing, which is a printing technology that produces images or text by heating. Thermal printing mainly controls the heating time according to the size of the grayscale value.
[0003] Currently, heating corresponding to the grayscale value can be achieved by using a plurality of heating pulses with the same pulse width and the number of heating pulses, or heating corresponding to the grayscale value can be achieved by using a plurality of heating pulses with different pulse widths and the combination of heating pulses.
[0004] However, either the number of pulses is too large or the heating time is too long, requiring a larger current, which will affect the printing speed. Summary of the invention
[0005] The embodiments of the present application provide a method for determining a heating pulse and a printing chip to increase the printing speed.
[0006] In a first aspect, an embodiment of the present application provides a method for determining a heating pulse, comprising:
[0007] Obtaining a grayscale value of a pixel in a grayscale image, and converting the grayscale value into a binary value, wherein the binary value includes a first significant bit and a second significant bit;
[0008] matching a first heating pulse for the first effective bit, the pulse widths of the first heating pulses being the same;
[0009] A second heating pulse is matched to each of the second significant bits.
[0010] In a possible implementation, the method further includes:
[0011] A heating pulse combination of the pixel point is determined based on the heating pulses corresponding to the first valid bit and the second valid bit in the binary value, so as to achieve heating corresponding to the grayscale value of the pixel point.
[0012] In this embodiment, the first heating pulse with the same pulse width is matched for each bit in the first valid bit, and the second heating pulse with different pulse widths is matched for each bit in the second valid bit. After the heating pulse combination of the pixel point is determined according to the heating pulses corresponding to the first valid bit and the second valid bit of the binary value, the heating corresponding to the grayscale value of the pixel point can be achieved, and the maximum pulse width can be reduced, the current pressure can be reduced, and an excessive number of pulses can be avoided, thereby increasing the printing speed.
[0013] In a possible implementation manner, matching each bit in the second significant bit with a second pulse width includes:
[0014] Each bit in the second significant bit is matched with a second heating pulse with gradually increasing pulse width in order from low bit to high bit; the pulse width of the first heating pulse is greater than the maximum pulse width of the second heating pulse corresponding to the second significant bit.
[0015] In this embodiment, each bit in the second significant bit is matched with a second heating pulse with gradually increasing pulse width in the order from low bit to high bit, so that each bit in the second significant bit corresponds to a second heating pulse with different pulse widths, so that different grayscale representations can be achieved. And the pulse width of the first heating pulse can be twice the maximum pulse width of the second heating pulse corresponding to the second significant bit, thereby reducing the maximum pulse width.
[0016] In a possible implementation, the method further includes:
[0017] The binary value is divided into a first significant bit and a second significant bit according to the width of the print head.
[0018] In this embodiment, the binary value is divided into a first significant bit and a second significant bit according to the width of the print head, so that the printing speed can be improved while meeting the printing requirements of the print head.
[0019] In a possible implementation, when the width of the print head is within a preset width range, the first number of valid digits is equal to the second number of valid digits;
[0020] When the width of the print head is greater than the maximum value of the preset width range, the first number of valid digits is greater than the second number of valid digits;
[0021] When the width of the print head is smaller than the minimum value of the preset width range, the first number of valid bits is smaller than the second number of valid bits.
[0022] In this embodiment, when the width of the print head is within a preset width range, the first number of valid bits is equal to the second number of valid bits; when the width of the print head is greater than the maximum value of the preset width range, the first number of valid bits is greater than the second number of valid bits; when the width of the print head is less than the minimum value of the preset width range, the first number of valid bits is less than the second number of valid bits, thereby meeting printing requirements.
[0023] In a possible implementation manner, before matching each of the second valid bits with a second heating pulse, the method further includes:
[0024] Part of the low-order bits in the second significant bit is removed.
[0025] In this embodiment, before dividing the binary value into the first significant bit and the second significant bit, part of the low bits in the second significant bit are removed, thereby increasing the printing speed by discarding the binary data with lower weight.
[0026] In a possible implementation manner, after determining the heating pulse combination of the pixel point based on the heating pulses corresponding to the first significant bit and the second significant bit of the binary value, the method further includes:
[0027] The heating sequence of each heating pulse in the heating pulse combination is determined according to the heat dissipation effect of the print head.
[0028] In this embodiment, the heating sequence of each pulse in the heating pulse combination can be determined according to the heat dissipation effect of the print head to improve the printing effect.
[0029] In a possible implementation manner, determining the heating sequence of each heating pulse in the heating pulse combination according to the heat dissipation effect of the print head includes:
[0030] When the heat dissipation efficiency of the print head is greater than a preset threshold range, a heating pulse corresponding to the first effective bit is output to the print head first, and then a heating pulse corresponding to the second effective bit is output to the print head;
[0031] The heat dissipation efficiency of the print head is less than a preset threshold range, and a heating pulse corresponding to the first effective bit and a heating pulse corresponding to the second effective bit are alternately output to the print head.
[0032] In the present embodiment, when the heat dissipation efficiency of the print head is greater than a preset threshold interval, the heating pulse corresponding to the first valid bit is output to the print head first, and then the heating pulse corresponding to the second valid bit is output to the print head; when the heat dissipation efficiency of the print head is less than the preset threshold interval, the heating pulse corresponding to the first valid bit and the heating pulse corresponding to the second valid bit are output alternately to the print head to improve the printing effect.
[0033] In a possible implementation, the method further includes:
[0034] When the heat dissipation efficiency of the print head is less than a preset threshold range, preheating the print head before outputting each heating pulse;
[0035] When the heat dissipation efficiency of the print head is greater than or equal to a preset threshold range, the cooling time between two heating pulses is extended.
[0036] In this embodiment, preheating or cooling is added according to the heat dissipation performance of the print head to improve the heat accumulation or heat dissipation effect, thereby further improving the printing effect.
[0037] In a second aspect, the present application provides a printing chip for executing the above first aspect and / or various possible implementations of the first aspect.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0039] The memory stores computer-executable instructions;
[0040] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.
[0042] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.
[0043] The heating pulse determination method and printing chip provided in the embodiments of the present application convert the grayscale value of the pixel into a binary value, wherein the binary value includes a first valid bit and a second valid bit, matches a first heating pulse with the same pulse width to each bit of the first valid bit, and matches a second heating pulse to each bit of the second valid bit, thereby reducing the maximum pulse width, reducing the current pressure, avoiding an excessive number of pulses, and improving the printing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] Figure 1 A schematic diagram of grayscale printing;
[0046] Figure 2 This is another schematic diagram of grayscale printing;
[0047] Figure 3 A schematic flow chart of a method for determining a heating pulse provided in the present application;
[0048] Figure 4 A schematic flow chart of another method for determining a heating pulse provided in the present application;
[0049] Figure 5 A schematic diagram of a grayscale printing method provided in this application;
[0050] Figure 6 A schematic diagram of the structure of the electronic device provided in this application.
[0051] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0052] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.
[0053] Grayscale printing is a printing technology that uses different shades of gray to show image details. Instead of using color ink, it produces different gray levels by adjusting the concentration of black ink or the density of dots. Grayscale printing can show the subtle details and layering of the image, and uses less ink or color, reducing printing costs. It is suitable for document printing, black and white photography, engineering drawings, medical imaging and other scenarios.
[0054] Currently, grayscale printing can be achieved through thermal printing, which is a printing technology that produces images or text by heating. Thermal printing can be done in the following ways:
[0055] S1: receiving the original image;
[0056] S2: Extract the gray value of each point in the original image;
[0057] S3: According to the gray value of each point, the heating time of the corresponding point is controlled. The larger the gray value, the longer the heating time and the darker the color. The smaller the gray value, the shorter the heating time and the lighter the gray value.
[0058] Among them, step S3 can be implemented in the following two ways:
[0059] Method 1: There are multiple heating pulses with the same pulse width, and the heating corresponding to the gray value is achieved by the number of heating pulses, such as Figure 1 As shown, the larger the gray value, the more the number of heating pulses, and the smaller the gray value, the fewer the number of heating pulses;
[0060] Method 2: There are multiple heating pulses with different pulse widths, and the heating of corresponding grayscale values is achieved through the combination of heating pulses, such as Figure 2 As shown, multiple heating pulses with different pulse widths may include eight pulses of T1, T2, T4, T8, T16, T32, T64, and T128, where T1=T, T2=2T, T4=4T, T8=8T, T16=16T, T32=32T, T64=64T, and T128=128T, and these eight pulses represent a grayscale of 0-255.
[0061] However, for method 1, the number of pulses may be too many. Since each pulse corresponds to an activation of the print head, frequent pulse activation will cause the print head to generate more heat. In order to avoid overheating, it may be necessary to reduce the printing speed or increase the cooling time, which will affect the overall printing speed.
[0062] For method 2, when the heating time is longer (for example, corresponding to T128), the required current increases. When the heating time is longer and a larger current is required, the thermal load of the print head increases. In order to prevent overheating, it may be necessary to limit the number of printing points activated at the same time to reduce the total heat generation, resulting in a decrease in printing speed and even possible damage to the print head.
[0063] To this end, the present application proposes a method for determining a heating pulse, which converts the grayscale value of a pixel into a binary value, wherein the binary value includes a first significant bit and a second significant bit, and matches each bit in the first significant bit with a first heating pulse with the same pulse width, thereby reducing the maximum pulse width, reducing the current pressure, and avoiding an excessive number of pulses, thereby increasing the printing speed.
[0064] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0065] Figure 3 A flow chart of a method for determining a heating pulse according to an embodiment of the present application is shown as follows: Figure 3 As shown, the method provided in the embodiment of the present application may include:
[0066] S101, obtaining a grayscale value of a pixel in a grayscale image, and converting the grayscale value into a binary value, wherein the binary value includes a first significant bit and a second significant bit.
[0067] In a grayscale image, each pixel has a corresponding grayscale value. The grayscale value represents the brightness of the pixel, usually in the range of 0 to 255, where 0 represents black, 255 represents white, and the values in between represent different shades of gray. Since grayscale images are single-channel, this means that each pixel only needs one value to represent its brightness.
[0068] In this step, after obtaining the grayscale value of the pixel in the grayscale image, the grayscale value of the pixel is converted into a multi-bit binary value, so that the heating pulses of different pixels can be determined based on the binary values corresponding to different grayscales.
[0069] In some embodiments, considering that 8 bits of binary are sufficient to represent the values from 0 to 255, no additional bits are needed to represent these values, so in order to simplify the operation, the grayscale value of the pixel is converted into an eight-bit binary value. For example, when the grayscale value is 163, the corresponding eight-bit binary value is 10100011, and when the grayscale value is 255, the corresponding eight-bit binary value is 11111111. In other embodiments, the grayscale value may also be converted into other binary values, which can be determined according to actual conditions.
[0070] It should be noted that the first significant bit has a greater impact on the value, representing the bits with a greater weight in the value, that is, the bits that are relatively early in the binary value. For example, when the grayscale value is converted into an eight-bit binary value, the first significant bit is the first two, three, four, etc. The second significant bit has a smaller impact on the value, representing the bits with a smaller weight in the value, that is, the bits that are relatively late in the binary value. The sum of the number of first significant bits and the number of second significant bits corresponds to the total number of bits in the binary value.
[0071] For example, the grayscale value is converted into an eight-bit binary value, the first significant bit is the first four bits, the second significant bit is the last four bits, and the sum of the number of the first significant bit and the number of the second significant bit is equal to eight.
[0072] For another example, the grayscale value is converted into an eight-bit binary value, the first significant bit is the first three bits, the second significant bit is the last five bits, and the sum of the first significant bit number and the second significant bit number is equal to eight.
[0073] In some embodiments, the binary value is divided into a first significant bit and a second significant bit according to the width of the print head, so that the printing speed can be improved while meeting the printing requirements of the print head. For example, when the print head width is large, more dots may be printed at the same time, and the maximum pulse width needs to be smaller, so the number of first significant bits can be larger and the number of second significant bits can be smaller; when the print head width is small, fewer dots are printed at the same time, and the maximum pulse width can be larger, so the number of first significant bits can be smaller and the number of second significant bits can be larger. The number of first significant bits and second significant bits can be determined according to the specific width of the print head.
[0074] As an implementation, when the width of the print head is within a preset width range, the first effective digit number is equal to the second effective digit number; when the width of the print head is greater than the maximum value of the preset width range, the first effective digit number is greater than the second effective digit number; when the width of the print head is less than the minimum value of the preset width range, the first effective digit number is less than the second effective digit number, thereby meeting the printing requirements. The preset width range can be determined according to actual conditions.
[0075] S102, matching a first heating pulse to each bit in the first effective bit, the pulse widths of the first heating pulses being the same.
[0076] In this step, in order to reduce the maximum pulse width and lower the current pressure, the first heating pulse with the same pulse width is matched to each bit in the first effective bit, so that different grayscale representations can be achieved by the number of first heating pulses.
[0077] S103, matching a second heating pulse for each bit in the second valid bit.
[0078] In this step, in order to match the corresponding heating pulse for the smaller grayscale, the second heating pulse with different pulse widths is matched to each bit in the second effective bit, which can avoid excessive number of pulses and improve the printing speed.
[0079] In some embodiments, the pulse width of the first heating pulse is greater than the pulse width of each of the second heating pulses, and each bit in the second valid bit is matched with a second heating pulse with gradually increasing pulse width in order from low bit to high bit, so that each bit in the second valid bit corresponds to a second heating pulse with different pulse widths, so that different grayscale representations can be achieved.
[0080] For example, each bit in the second significant bit can be matched with the second heating pulse with gradually increasing pulse width in the order of low bit to high bit in the form of geometric progression, wherein the common ratio of the geometric progression can be 2.
[0081] The pulse width of the first heating pulse may be twice the maximum pulse width of the second heating pulse corresponding to the second significant bit, thereby reducing the maximum pulse width. For example, if the maximum pulse width of the second significant bit is 8T, the pulse width of the first heating pulse is 16T.
[0082] For example, taking an eight-bit binary value as an example, for the convenience of description, the eight-bit binary value is represented as Bit7, Bit6, Bit5, Bit4, Bit3, Bit2, Bit1, Bit0 in order from high to low. The eight-bit binary value is divided into a first significant bit including Bit7, Bit6, Bit5, Bit4 and a second significant bit including Bit3, Bit2, Bit1, Bit0. And for Bit3, Bit2, Bit1, Bit0 in the second significant bit, they can correspond to T, 2T, 4T, 8T in order from low to high, that is, Bit0 = T, Bit1 = 2T, Bit2 = 4T, bit3 = 8T. For Bit7, Bit6, Bit5, Bit4 in the first significant bit, they can all correspond to 16T. Among them, T represents a basic pulse width.
[0083] In some examples, before dividing the binary value into the first significant bit and the second significant bit, part of the low-order bits in the second significant bit are removed, thereby increasing the printing speed by discarding the binary data with lower weight.
[0084] For example, Bit0 corresponds to T, and Bit1 corresponds to 2T, both of which are smaller pulse widths and have little effect on grayscale printed images. In order to increase the printing speed, the heating pulses with lower weights are discarded, such as only executing the grayscale of the six bits Bit2-Bit7. Accordingly, the six bits Bit2-Bit7 can be used in the form of a geometric progression in order from low to high to form a second heating pulse with different pulse widths, such as Bit2=T, Bit3=2T, Bit4=4T, Bit5=8T, Bit6=16T, and Bit7=16T.
[0085] The method for determining the heating pulse provided in the present application converts the grayscale value of the pixel into a binary value, wherein the binary value includes a first valid bit and a second valid bit, wherein each bit in the first valid bit matches a first heating pulse with the same pulse width, and each bit in the second valid bit matches a second heating pulse with different pulse widths, thereby reducing the maximum pulse width, avoiding an excessive number of pulses, and increasing the printing speed.
[0086] Figure 4 A flow chart of a method for determining a heating pulse combination provided in another embodiment of the present application is shown as follows: Figure 4 As shown, after step S103, the method provided in the embodiment of the present application may further include:
[0087] S104, determining a heating pulse combination of the pixel point based on the heating pulses corresponding to the first significant bit and the second significant bit of the binary value, so as to achieve heating corresponding to the grayscale value of the pixel point.
[0088] For example, the heating pulse combination of the pixel point can be determined based on the heating pulse combination corresponding to the first significant bit in the binary value and the heating pulse combination corresponding to the second significant bit in the binary value. The heating pulse combination corresponding to the first significant bit in the binary value can be determined according to the first significant bit matching the corresponding number of heating pulses. For example, the first significant bit is 1010, and the corresponding number of first heating pulses is 10, then the heating pulse combination corresponding to the first significant bit is 10 first heating pulses. The heating pulse combination corresponding to the second significant bit in the binary value can be determined according to the second heating pulse corresponding to the second significant bit, and the second heating pulse corresponding to the second significant bit can be determined according to the bit position of each bit in the second significant bit.
[0089] In some embodiments, the number of heating pulses corresponding to the first effective bit can be determined according to the decimal data corresponding to the first effective bit, and the heating pulse combination corresponding to the first effective bit can be determined based on the number of heating pulses corresponding to the first effective bit and the first heating pulse; the heating pulse combination corresponding to the second effective bit can be determined according to the second heating pulse corresponding to the second effective bit. Then, the heating pulse combination of the pixel point can be determined based on the heating pulse combination corresponding to the first effective bit and the heating pulse combination corresponding to the second effective bit, so that when heating each pixel point based on the heating pulse combination of each pixel point, the maximum pulse width can be reduced, the current pressure can be reduced, and at the same time, an excessive number of pulses will not occur, thereby improving the printing speed.
[0090] For example, Figure 5 As shown, the gray value is converted into an eight-bit binary value as an example, and the first significant bit is the first four bits, and the second significant bit is the last four bits.
[0091] When the gray value is 0, it is represented by an eight-bit binary value of 00000000. At this time, heating is not required, so the heating pulse combination is 0;
[0092] When the gray value is 1, it is represented by an eight-bit binary value of 00000001. At this time, the number of pulses corresponding to the first significant bit is 0000. (2) =0 (10) , then the number of pulses corresponding to the first significant bit is 0, the heating pulse combination corresponding to the first significant bit is 0, and the heating pulse combination corresponding to the second significant bit is 1T. Therefore, when the gray value is 1, the corresponding heating pulse combination is 1T;
[0093] When the gray value is 2, it is represented by an eight-bit binary value of `00000010. At this time, the number of pulses corresponding to the first significant bit is 0000 (2) =0 (10) , then the number of pulses corresponding to the first significant bit is 0, the heating pulse combination corresponding to the first significant bit is 0, and the heating pulse combination corresponding to the second significant bit is 2T. Therefore, when the gray value is 2, the corresponding heating pulse combination is 2T;
[0094] When the gray value is 3, the eight-bit binary value is 00000011, and the number of pulses corresponding to the first significant bit is 0000 (2) =0 (10) , then the number of pulses corresponding to the first significant bit is 0, the heating pulse combination corresponding to the first significant bit is 0, and the heating pulse combination corresponding to the second significant bit is 1T, 2T. Therefore, when the gray value is 3, the corresponding heating pulse combination is 1T, 2T;
[0095] When the gray value is 4, it is represented by an eight-bit binary value of 00000100. At this time, the number of pulses corresponding to the first significant bit is 0000. (2) =0 (10) , then the number of pulses corresponding to the first significant bit is 0, the heating pulse combination corresponding to the first significant bit is 0, and the heating pulse combination corresponding to the second significant bit is 4T. Therefore, when the gray value is 4, the corresponding heating pulse combination is 4T;
[0096] When the gray value is 5, it is represented by an eight-bit binary value of 00000101. At this time, the number of pulses corresponding to the first significant bit is 0000. (2) =0 (10) , then the number of pulses corresponding to the first significant bit is 0, the heating pulse combination corresponding to the first significant bit is 0, and the heating pulse combination corresponding to the second significant bit is 1T, 4T. Therefore, when the gray value is 5, the corresponding heating pulse combination is 1T, 4T;
[0097] By analogy, when the grayscale value is 15, the eight-bit binary value is 00001111, and the number of pulses corresponding to the first significant bit is 0000. (2) =0 (10) , the number of pulses corresponding to the first significant bit is 0, the heating pulse combination corresponding to the first significant bit is 0, and the heating pulse combination corresponding to the second significant bit is 1T, 2T, 4T, 8T. Therefore, when the gray value is 15, the corresponding heating pulse combination is 1T, 2T, 4T, 8T;
[0098] When the grayscale value is 16, it is represented by an eight-bit binary value of 00010000. At this time, the number of pulses corresponding to the first significant bit is 0001. (2) =1 (10), then the number of pulses corresponding to the first significant bit is 1, the heating pulse combination corresponding to the first significant bit is 16T, and the heating pulse combination corresponding to the second significant bit is 0. Therefore, when the gray value is 16, the corresponding heating pulse combination is 16T;
[0099] When the gray value is 17, it is represented by an eight-bit binary value of 00010001. At this time, the number of pulses corresponding to the first significant bit is 0001. (2) =1 (10) , then the number of pulses corresponding to the first significant bit is 1, the heating pulse combination corresponding to the first significant bit is 16T, and the heating pulse combination corresponding to the second significant bit is 1T. Therefore, when the gray value is 17, the corresponding heating pulse combination is 1T and 16T;
[0100] By analogy, when the grayscale value is 253, it is represented by an eight-bit binary value of 11111101. At this time, the number of pulses corresponding to the first significant bit is 1111 (2) =15 (10) , then the number of pulses corresponding to the first significant bit is 15, the heating pulse combination corresponding to the first significant bit is 15 16T, and the heating pulse combination corresponding to the second significant bit is 1T, 4T, 8T. Therefore, when the gray value is 253, the corresponding heating pulse combination is 1T, 4T, 8T, 15 16T;
[0101] When the grayscale value is 254, it is represented by an eight-bit binary value of 11111110. At this time, the number of pulses corresponding to the first significant bit is 1111 (2) =15 (10) , then the number of pulses corresponding to the first significant bit is 15, the heating pulse combination corresponding to the first significant bit is 15 16T, and the heating pulse combination corresponding to the second significant bit is 2T, 4T, 8T. Therefore, when the gray value is 254, the corresponding heating pulse combination is 2T, 4T, 8T, and 15 16T;
[0102] When the grayscale value is 255, it is represented by an eight-bit binary value of 11111111. At this time, the number of pulses corresponding to the first significant bit is 1111 (2) =15 (10) , the number of pulses corresponding to the first significant bit is 15, the heating pulse combination corresponding to the first significant bit is 15 16T, and the heating pulse combination corresponding to the second significant bit is 1T, 2T, 4T, and 8T. Therefore, when the grayscale value is 255, the corresponding heating pulse combination is 1T, 2T, 4T, 8T, and 15 16T.
[0103] In some examples, the heating time of each pixel can also be determined based on the heating pulse combination of each pixel. Although the pulse combination determines the preliminary heating mode, fine-tuning of the heating time can ensure that each pixel reaches the desired grayscale level and improve the printing quality of the grayscale image.
[0104] For example, when the gray value is 1, the corresponding heating pulse combination is 1T, and the heating time when the gray value is 1 is 1T; when the gray value is 2, the corresponding heating pulse combination is 2T, and the heating time when the gray value is 2 is 2T; when the gray value is 3, the corresponding heating pulse combination is 1T and 2T, and the heating time when the gray value is 3 is 3T; when the gray value is 4, the corresponding heating pulse combination is 4T, and the heating time when the gray value is 4 is 4T; when the gray value is 5, the corresponding heating pulse combination is 1T and 4T, and the heating time when the gray value is 5 is 5T; and so on, when the gray value is 15, the corresponding heating pulse combination is 1T, 2T, 4T, and 8T, and the heating time when the gray value is 15 is 15T; when the gray value is 16, the corresponding heating pulse combination is 1T, 2T, 4T, and 8T, and the heating time when the gray value is 15 is 15T; The heating pulse combination is 16T, so the heating time when the grayscale value is 16 is 16T; when the grayscale value is 17, the corresponding heating pulse combination is 1T and 16T, so the heating time when the grayscale value is 17 is 17T; and so on, when the grayscale value is 253, the corresponding heating pulse combination is 1T, 4T, 8T, and 15 16Ts, so the heating time when the grayscale value is 253 is 253T; when the grayscale value is 254, the corresponding heating pulse combination is 2T, 4T, 8T, and 151 16Ts, so the heating time when the grayscale value is 254 is 254T; when the grayscale value is 255, the corresponding heating pulse combination is 1T, 2T, 4T, 8T, and 15 16Ts, so the heating time when the grayscale value is 255 is 255T.
[0105] In some examples, after determining the heating pulse combination, a corresponding pulse can be output to the heating element in the print head based on the heating pulse combination. The heating element in the print head will quickly heat up when receiving the pulse signal, and transfer the heat to the printing paper in contact with it. When the layer on the printing paper is heated, a chemical reaction will occur and change color, thereby forming a printed drawing or text.
[0106] In some embodiments, the heating sequence of each pulse in the heating pulse combination can be determined according to the heat dissipation effect of the print head to improve the printing effect.
[0107] It should be noted that the pulse is not to make the temperature continue to rise, but to keep the temperature within a certain range. Too high a temperature may burn the print head or printing paper. For a print head with better heat dissipation effect, the first heating pulse corresponding to the first valid bit can be sent first, and then the second heating pulse corresponding to the second valid bit can be sent in sequence. For example, the second heating pulse corresponding to the second valid bit can be sent in order from large to small. For a print head with poor heat dissipation effect, the first heating pulse corresponding to the first valid bit and the second heating pulse corresponding to the second valid bit can be sent alternately. There may also be other pulse sending orders, which are not limited here.
[0108] Therefore, in some examples, when the heat dissipation efficiency of the print head is greater than the preset threshold interval, the heating pulse corresponding to the first effective bit is output to the print head first, and then the heating pulse corresponding to the second effective bit is output to the print head; when the heat dissipation efficiency of the print head is less than the preset threshold interval, the heating pulse corresponding to the first effective bit and the heating pulse corresponding to the second effective bit are output alternately to the print head to improve the printing effect. The preset time can be determined according to actual conditions. Among them, the preset pre-threshold interval can be determined according to actual conditions.
[0109] In some examples, preheating or cooling can be added according to the heat dissipation performance of the print head to improve heat accumulation or heat dissipation effect, thereby further improving the printing effect. Specifically, when the heat dissipation efficiency of the print head is less than a preset threshold interval, the print head can be preheated before each heating pulse is output to improve heat accumulation. For example, a preheating command can be sent to the heating element in the print head to heat the heating element to a certain temperature. It is also possible to extend the cooling time between two heating pulses to improve the heat dissipation effect when the heat dissipation efficiency of the print head is greater than or equal to the preset threshold interval. The extended cooling time can be determined based on the heat dissipation time of the print head.
[0110] The method for determining the heating pulse provided in this embodiment is to match the first heating pulse with the same pulse width as the first valid bit, and to match the second heating pulse with different pulse widths for each bit in the second valid bit. After determining the heating pulse combination of the pixel point according to the heating pulses corresponding to the first valid bit and the second valid bit of the binary value, the heating corresponding to the grayscale value of the pixel point can be achieved, and the maximum pulse width can be reduced, the current pressure can be reduced, and an excessive number of pulses can be avoided, thereby increasing the printing speed.
[0111] The embodiment of the present application also provides a printing chip for executing the above-mentioned method for determining the heating pulse.
[0112] For example, the printing chip can be a microprocessor chip, which can be, for example, an MCU (MicroController Unit), a DSP (Digital Signal Processing), an MPU (MicroProcessor Unit), a micro CPU (Central Processing Unit), or the like, which can process digital signals, analog signals, or perform signal functions, instruction processing, and calculation functions, or a micro central control chip, a system-on-chip chip, or the like.
[0113] Figure 6 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 5As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.
[0114] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.
[0115] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0116] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0117] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0118] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0119] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0120] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0121] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0122] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0123] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0124] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0125] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0126] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0127] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0128] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for determining a heating pulse, characterized in that: include: Obtaining a grayscale value of a pixel in a grayscale image, and converting the grayscale value into a binary value, wherein the binary value includes a first significant bit and a second significant bit; matching a first heating pulse for the first effective bit, the pulse widths of the first heating pulses being the same; A second heating pulse is matched to each of the second significant bits.
2. The method according to claim 1, characterized in that The method further comprises: A heating pulse combination of the pixel point is determined based on the heating pulses corresponding to the first valid bit and the second valid bit in the binary value, so as to achieve heating corresponding to the grayscale value of the pixel point.
3. The method according to claim 1, characterized in that The step of matching each bit in the second effective bit with a second pulse width comprises: Each bit in the second significant bit is matched with a second heating pulse with gradually increasing pulse width in order from low bit to high bit; the pulse width of the first heating pulse is greater than the maximum pulse width of the second heating pulse corresponding to the second significant bit.
4. The method according to claim 1, characterized in that: The method further comprises: The binary value is divided into a first significant bit and a second significant bit according to the width of the print head.
5. The method according to claim 4, characterized in that When the width of the print head is within a preset width range, the first number of valid digits is equal to the second number of valid digits; When the width of the print head is greater than the maximum value of the preset width range, the first number of valid digits is greater than the second number of valid digits; When the width of the print head is smaller than the minimum value of the preset width range, the first number of valid bits is smaller than the second number of valid bits.
6. The method according to any one of claims 1 to 5, characterized in that: Before matching the second heating pulse to each of the second valid bits, the method further includes: Part of the low-order bits in the second significant bit is removed.
7. The method according to claim 2, characterized in that After determining the heating pulse combination of the pixel point based on the heating pulses corresponding to the first and second significant bits of the binary value, the method further includes: The heating sequence of each heating pulse in the heating pulse combination is determined according to the heat dissipation effect of the print head.
8. The method according to claim 7, characterized in that The step of determining the heating sequence of each heating pulse in the heating pulse combination according to the heat dissipation effect of the print head comprises: When the heat dissipation efficiency of the print head is greater than a preset threshold range, a heating pulse corresponding to the first effective bit is output to the print head first, and then a heating pulse corresponding to the second effective bit is output to the print head; The heat dissipation efficiency of the print head is less than a preset threshold range, and a heating pulse corresponding to the first effective bit and a heating pulse corresponding to the second effective bit are output alternately to the print head.
9. The method according to claim 8, characterized in that The method further comprises: When the heat dissipation efficiency of the print head is less than a preset threshold range, preheating the print head before outputting each heating pulse; When the heat dissipation efficiency of the print head is greater than or equal to a preset threshold range, the cooling time between two heating pulses is extended.
10. A printing chip, characterized in that: Used to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Gray level print control method and device
CN101549591A
Print image output method and device and electronic equipment
CN113821182A
Heating pulse generating method in thermal transfer printer
JP1992035961A
Printer and driver program
JP2012187826A
Printer using thermal print head
US6384854B1