Methods, apparatus and storage media for printing vertical high-pass-count images

By accurately reading PRN file information and calculating the PASS count using the skipping method, combined with the effective print head height and data row index, the ink droplet distribution is optimized, solving the unevenness problem of inkjet printers in printing high-PASS-count images in the vertical direction, and achieving high-quality and clear printing results.

CN119620968BActive Publication Date: 2025-12-02GUANGZHOU SENYANG ELECTRONIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411676370.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-12-02
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

Existing inkjet printers have problems when printing images with a high number of passes in the vertical direction, such as increased printhead load due to staggered pass picking, difficulty in controlling ink droplet distribution when picking passes randomly, and easy differences in the connection between groups of passes when picking passes in groups, which affect print uniformity and quality.

Method used

By accurately reading PRN file information, calculating the number of passes and using a skipping method, combined with the effective print head height and data line index, the ink droplet distribution is optimized, and the step value is dynamically adjusted to overcome printing unevenness and achieve high-quality vertical printing.

Benefits of technology

It ensures accurate vertical resolution reproduction of images, avoiding blurring or missing parts, with uniform and natural ink droplet distribution, resulting in clear and flawless prints. It is suitable for different paper types and ink combinations, improving printing efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119620968B_ABST
    Figure CN119620968B_ABST
Patent Text Reader

Abstract

A method, apparatus, and storage medium for printing vertically high PASS count images. The method includes the following steps: S1, acquiring print image information by reading basic image information from a print PRN file; S2, calculating the PASS count in the Y direction using the read PRN information; S3, obtaining the index of the data row based on the PASS count obtained in step S2; S4, obtaining the step value of each swath based on the index of the data row in step S3; S5, driving the printing software to send the preprocessed step value data of each swath from steps S1 to S4 to the printer control board to control the printhead to print white and color ink images. This invention solves the shortcomings of various PASS step-taking methods in the prior art. By reading PRN file information and using a skip-step method to calculate the PASS count, it ensures that the vertical resolution of the image can be restored as needed, details are clearly presented, and blurring or missing information is avoided. It is suitable for optimizing ink droplet distribution in different situations, and the color transition is natural and smooth, without color banding, uneven horizontal lines, or other defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of printers, and in particular to methods, apparatus and storage media for printing vertical high-pass-count images. Background Technology

[0002] Currently, inkjet printers all have a baseline resolution (also known as pass resolution, i.e., the resolution when printing 1 pass, Pass DPI) at the factory. Common resolutions include 360x300 DPI and 360x600 DPI. 360 is called the horizontal baseline resolution (XPass DPI), and 300 / 600 are called the vertical baseline resolution (YPass DPI). The baseline resolution is generally related to the physical resolution of the raster / magnetic grid and the printhead. The resolution of the printed image must be an integer multiple of the baseline resolution. When the horizontal resolution of the printed image equals the horizontal baseline resolution of the printer, and the vertical resolution of the printed image is an integer multiple of the vertical baseline resolution of the printer, it is called high-pass vertical printing. In high-pass vertical printing, different pass sequences and stepping methods will have different effects on the uniformity of the final inkjet print.

[0003] (1) Alternating PASS (e.g., alternating between odd and even rows): This method requires sophisticated algorithms and is prone to matching problems. The PASS sequence relies on complex algorithms to precisely control the timing and position of ink droplet ejection between odd and even rows. If the printer's control algorithm is not precise enough, deviations may occur in the vertical alignment or connection of ink droplets between odd and even rows, resulting in localized misalignment in the image and disrupting overall uniformity. For example, when printing a fine grid pattern, the grid lines may appear uneven, affecting print quality and increasing printhead workload and inkjet instability. The printhead needs to frequently switch between odd and even rows, making its operation more complex than sequential PASS. This can increase the printhead's workload, causing fatigue or temporary inkjet instability. Once this instability occurs, the staggered arrangement can cause irregular ink droplet distribution, resulting in uneven ink density in certain areas of the printed image, thus affecting uniformity. This places higher demands on paper and ink compatibility: staggered PASS printing requires stricter requirements on the paper's ink absorption performance and the ink's drying speed. If the paper absorbs ink unevenly or the ink dries too quickly or too slowly, ink smudging and inconsistent penetration are more likely to occur during the alternating spraying of odd and even rows of ink droplets, leading to inconsistent color depth, blurred boundaries, and reduced uniformity in the printed image. When using different brands and types of paper and ink, it may be difficult to consistently achieve ideal uniform printing results.

[0004] (2) The uniformity of randomized PASS (according to a randomly determined row order) is extremely difficult to control: Since the inkjet sequence of each row is random, there is almost no fixed pattern to follow, making the distribution of ink droplets on the paper very difficult to predict and control. It is easy for local ink droplets to be too dense or too sparse. For example, when printing a solid color background, some patches of varying shades of color may appear randomly, seriously damaging the overall uniformity effect. It is difficult to meet the requirements of tasks with certain print quality requirements, and debugging and troubleshooting are complex: Once an uneven printing problem occurs, it is extremely complicated to solve it by adjusting printer parameters or troubleshooting the cause of the problem. Because there is no clear sequential logic, it is difficult to determine whether the problem is caused by the printhead itself, the paper feed, or some part of the random algorithm execution process. This is not conducive to quickly locating and solving the problem, thus affecting printing efficiency and final print quality.

[0005] Not suitable for printing regular images: For printing regular geometric shapes, tables, text, etc., randomly selecting the pass order makes it difficult to ensure that the edges of these elements are neat and the internal fill is uniform. Often, uneven graphic outlines and uneven text stroke thickness will occur, failing to achieve the clear and uniform visual effect expected in regular printing tasks.

[0006] (3) Grouping for PASS (dividing multiple rows into a group, with a specific order within the group and a different order between groups) has the following drawbacks: Differences can easily occur between groups. When switching between groups, different groups may use different inkjet sequences or rhythms, which can easily lead to differences in ink droplet distribution at the junctions. This manifests as unnatural color transitions at the group boundaries, slight variations in shade, or inconsistent textures. For example, when printing large-format continuous-tone images, this problem in group transitions can cause horizontal marks on the screen, disrupting the overall uniformity and visual appeal. Parameter adjustment relies on experience and trial and error: Determining the appropriate number of groups, the number of rows in each group, and the specific PASS order within and between groups requires extensive practical experience and repeated trial and error. Different image content, printer performance, and paper and ink characteristics can all affect the optimal parameter settings. Inappropriate parameter settings can easily lead to uneven printing, and operators will find it difficult to quickly and accurately adjust the direction, increasing the difficulty of achieving ideal, uniform printing results. This places stringent requirements on printhead precision: to ensure uniform ink droplet distribution within and between groups, the requirements for printhead inkjet precision and position control precision are more stringent. When the printhead switches between different groups or performs sequential inkjet printing within a group, any minute positional deviation or ink volume change can be amplified, leading to localized unevenness in the printed image. This impact of printhead precision is even more pronounced when printing high-precision, high-quality images.

[0007] Therefore, there is an urgent need for a method to print vertically high PASS number images that addresses the shortcomings of the three PASS step-taking methods mentioned above. Summary of the Invention

[0008] In order to solve the above-mentioned technical problems, the present invention provides a method for printing vertical high PASS number images.

[0009] The technical solution of this invention is implemented as follows:

[0010] A method for printing vertical high PASS number images includes the following steps:

[0011] S1, Obtain print image information, read the basic information of the image from the print PRN file;

[0012] S2, calculate the number of PASSes in the Y direction by reading the PRN information;

[0013] S3, based on the number of PASSes obtained in step S2, obtain the index of the data row;

[0014] S4, based on the index of the data row in step S3, obtain each swath step;

[0015] S5 drives the printing software to send the step value data of each swath preprocessed in steps S1-S4 to the printer control board, controlling the print head to print white ink and color ink images.

[0016] Preferably, in step S1, information including resolution, number of passes, number of colors, and BytesPerLine of the image is read from the printed PRN file. Specifically, the resolution is read by reading the header information in the PRN file and inputting y_dpi = struct.unpack('I', f.read(4n))[0].

[0017] The specific method for reading the PASS count is: pass_num = ord(f.read(n));

[0018] The specific method for reading the color number is: color_num = ord(f.read(1)). The 1 in the function means reading 1 byte and converting it to an integer to get the color number.

[0019] The specific steps for reading BytesPerLine are as follows:

[0020] bytes_per_line = struct.unpack('I', f.read(4))[0], which parses 4 bytes in unsigned integer format and obtains the BytesPerLine value.

[0021] Preferably, in step S2, the resolution of the image in the Y direction is represented as ImageYDPI, and the printer's reference Y direction resolution is represented as PrintYDPI; the number of PASSes in the printing Y direction is calculated:

[0022] ImageYDPI÷PrintYDPI=YPassNum, where YPassNum is the image's Y-axis resolution divided by the printer's reference Y-axis resolution I.

[0023] Preferably, step S3 specifically involves setting `index` to be the print data line index and `PRNLineSeq` to be the line number of the PRN file data, incrementing line by line. When `PRNLineSeq` is even, `index = PRNLineSeq / 2 + ...`

[0024] YPassNum / 2, when PRNLineSeq is odd, index = (PRNLineSeq-1) / 2.

[0025] Preferably, step S4 specifically involves setting the effective printing height of the printer head to PrintHeight, and when PRNLineSeq is obtained as an even number, calculating the step value of swath using the following formula:

[0026] step=PrintHeight / YPASSNum-(YPASSNum / 2-1);

[0027] When PRNLineSeq is an odd number, the formula for calculating the step value of swath is:

[0028] step=PrintHeight / YPASSNum+(YPASSNum / 2+1).

[0029] Preferably, in step S2, obtaining the index of the data row based on the number of printed PASSes includes: determining the total number of vertical rows of the printed image based on the number of bytes per row of the printed image, the number of colors in the printed image, and the vertical resolution of the printed image, with the specific printed data row index used to indicate which row of the printed image.

[0030] A printing apparatus includes a processor, a memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method described above for printing a vertically high pass count image.

[0031] A storage medium storing computer program instructions that, when executed by a processor, implement the aforementioned method for printing a vertically high pass count image.

[0032] This invention overcomes the shortcomings of various PASS step-taking methods in the prior art. By accurately reading PRN file information and using a skip-step method to calculate the number of PASSes, it ensures that the vertical resolution of the image can be restored as needed, and details are clearly presented, avoiding blurring or missing parts. It is suitable for optimizing ink droplet distribution in different situations, and the color transition is natural and smooth, without color banding, uneven horizontal lines or other defects. Attached Figure Description

[0033] Figure 1 This is a schematic diagram of a method for printing vertically high PASS number images according to the present invention. Detailed Implementation

[0034] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, exemplary embodiments will be described in detail below, examples of which are illustrated in the accompanying drawings. In the following description relating 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 this application. Rather, they are merely examples of methods and systems consistent with some aspects of this application as detailed in the appended claims.

[0035] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0036] Example 1

[0037] The present invention discloses a method for printing vertically high PASS number images, comprising the following steps:

[0038] S1: Obtain print image information by reading basic image information from the print PRN file; parse the print PRN file to extract key image information that supports subsequent printing processes. The PRN file, as the core instruction file for the printer to execute printing tasks, contains information such as resolution, number of passes, number of colors, and BytesPerLine, which are related to the printer's image processing method and the final print effect. Through a specific reading mechanism, this invention can accurately obtain the above information, providing a data foundation for subsequent steps and achieving refined control of the printing process. In step S1, the focus is on parsing the print PRN file to extract key image information. The PRN file carries all the instructions and data required by the printer and is arranged and stored according to a predetermined standard. Among these parameters, resolution information determines the pixel fineness of the image in both the vertical and horizontal dimensions, serving as an indicator of whether the image can be accurately reproduced; the PASS count represents the number of times the printer head repeatedly sprays ink onto the same area in the vertical direction, which is related to printing efficiency and image quality; the color count specifies the types of ink colors that need to be mixed and sprayed during the printing process, playing a crucial role in restoring the original colors of the image; and BytesPerLine describes the number of bytes occupied by each line of image data, reflecting the storage layout of the image data within the file and providing a basis for subsequent line-by-line data processing. The targeted reading algorithm designed in this invention overcomes the limitations of information extraction in existing technologies, accurately acquiring various key information, laying the foundation for subsequent calculations and control operations based on accurate data, and ensuring that the printing process proceeds in an orderly manner as expected.

[0039] In step S1, the image information, including resolution, number of passes, number of colors, and BytesPerLine, is read from the printed PRN file. Specifically, the resolution is read by reading the header information in the PRN file and inputting y_dpi = struct.unpack('I', f.read(4n))[0]. The number of passes is read by passing_num = ord(f.read(n)). The number of colors is read by color_num = ord(f.read(1)), where 1 in the function means reading 1 byte and converting it to an integer to obtain the number of colors. The number of BytesPerLine is read by bytes_per_line = struct.unpack('I', f.read(4))[0], parsing 4 bytes in unsigned integer format to obtain the BytesPerLine value.

[0040] S2, calculate the number of PASSes in the Y direction by reading the PRN information;

[0041] Preferably, in step S2, the resolution of the image in the Y direction is represented as ImageYDPI, and the printer's reference Y direction resolution is represented as PrintYDPI; the number of PASSes in the printing Y direction is calculated:

[0042] ImageYDPI÷PrintYDPI=YPassNum, where YPassNum is the image's Y-axis resolution divided by the printer's reference Y-axis resolution I.

[0043] The number of passes in the Y direction of printing is determined by the formula (YPassNum = ImageYDPI ÷ PrintYDPI). ImageYDPI is determined by factors such as the original image generation format, creative intent, and editing processes, reflecting the desired level of detail in the vertical direction of the image. PrintYDPI is determined by factors such as the printer's printhead physical structure (e.g., nozzle density, minimum ink jet spacing), internal mechanical transmission system (e.g., the precision of the paper feed mechanism in moving the paper vertically), and built-in control algorithms, reflecting the printer's ability to stably and accurately eject ink droplets per inch to form an image in the vertical direction. This calculation formula combines image characteristics with printer hardware capabilities, and the resulting number of passes represents the number of times the printhead needs to repeatedly eject ink to produce a complete and high-quality image in the vertical direction. Since the actual calculation result may not be an integer, while the number of PASSes in actual printing scenarios needs to be an integer, this invention provides rounding strategies such as rounding up, rounding down, and rounding to the nearest integer. It also provides clear selection criteria for different printing needs scenarios (such as using the rounding up strategy to ensure image details in high-precision professional image printing tasks; and using the rounding down strategy to balance quality and efficiency in general document printing, depending on the situation), to ensure that the number of PASSes meets the requirements of printing quality and efficiency in actual applications.

[0044] S3, based on the number of PASSes obtained in step S2, obtain the index of the data row;

[0045] Preferably, step S3 specifically involves setting `index` to be the print data line index and `PRNLineSeq` to be the line number of the PRN file data, incrementing line by line. When `PRNLineSeq` is even, `index = PRNLineSeq / 2 + ...`

[0046] YPassNum / 2, when PRNLineSeq is odd, index = (PRNLineSeq-1) / 2.

[0047] After determining the number of passes (YPassNum) in the Y direction of printing in step S2, step S3 focuses on obtaining the print data line index. The PRN file data is introduced with progressively increasing line numbers (PRNLineSeq), and different calculation formulas are used to determine the index based on its parity. When PRNLineSeq is even, the formula is index = PRNLineSeq / 2 + YPassNum / 2; when PRNLineSeq is odd, the formula is index = (PRNLineSeq-1) / 2. This parity-based index acquisition mechanism abandons the traditional data selection logic and constructs a jump-style data distribution order. In actual printing, printers are affected by factors such as paper feeding errors (e.g., uneven friction between paper and the paper feeding mechanism, and longitudinal displacement deviation caused by differences in the paper's own physical properties) and assembly precision (the assembly tolerance of components such as the printhead and the paper feeding mechanism affects the ink droplet landing point). Conventional data selection modes easily lead to uneven ink droplet distribution on the paper, affecting print quality and causing issues such as shallow and deep horizontal lines and local color deviations. The skip-data distribution sequence of this invention disrupts regular error factors, resulting in a more reasonable ink droplet distribution and overcoming the problem of uneven printing. Simultaneously, in scenarios such as printing artistic abstract patterns or simulating natural textures (e.g., marble patterns, wood grain), it can create unique printing effects, optimize ink droplet distribution patterns, and enhance the visual presentation of printed images.

[0048] S4, based on the index of the data row in step S3, obtain each swath step; specifically, step S4 involves setting the effective printing height of the printer head to PrintHeight, and when PRNLineSeq is an even number, calculating the swath step value using the following formula:

[0049] step=PrintHeight / YPASSNum-(YPASSNum / 2-1);

[0050] When PRNLineSeq is an odd number, the formula for calculating the step value of swath is:

[0051] step=PrintHeight / YPASSNum+(YPASSNum / 2+1).

[0052] In step S4, based on the data row index obtained in step S3, combined with the effective print height of the printer head (PrintHeight), and according to the parity of PRNLineSeq, a specific calculation formula is used to obtain the step value (step) for each swath. "Swath" refers to the area that the printhead can cover and print in one lateral movement. The swath step value (step) controls the vertical distance between two adjacent processing of the same swath area during the printhead's longitudinal movement. In inkjet printing, the printhead's longitudinal movement is closely related to the distribution of ink droplets on the paper. If the step value is set improperly, such as being too large, it may cause gaps in the vertical direction of ink droplets; if it is too small, it may cause ink droplet overlap, leading to print quality problems such as image texture distortion and uneven color. This invention employs a differentiated calculation formula based on the parity of PRNLineSeq. When PRNLineSeq is even, the formula step = PrintHeight / YPASSNum - (YPASSNum / 2 - 1) is used; when PRNLineSeq is odd, the formula step = PrintHeight / YPASSNum + (YPASSNum / 2 + 1) is used. This method organically integrates the data row index with the effective printhead printing height, considering the printhead-paper interaction characteristics corresponding to different data row indices. It ensures that the printhead movement operation coordinates with data acquisition and inkjet operation, guaranteeing uniform and orderly distribution of ink droplets on the paper. This achieves high-quality, flawless printing results, overcoming the problem of poor print quality caused by the inability to accurately control the movement in complex printing scenarios using existing technologies.

[0053] S5 drives the printing software to send the step value data of each swath preprocessed in steps S1-S4 to the printer control board, controlling the print head to print white ink and color ink images.

[0054] In step S5, the connection between data preprocessing and actual printing is completed. After processing in steps S1 to S4, step value data for each swath is obtained. This data carries key information for printing high-quality vertical high-pass-count images. The step value data is sent to the printer control board via the printing software. As the core control hub of the printer hardware architecture, the printer control board integrates a microprocessor and various control circuits, enabling precise control of the printer's printhead movement in the vertical and horizontal directions, as well as the inkjet operation of white and color inks. Upon receiving the step value data, based on its built-in control algorithm, it directs the printhead to move orderly in the vertical and horizontal directions according to predetermined step values, and precisely controls parameters such as the timing of white and color ink jetting, droplet size, and jetting position. This converts digital image information into an actual printed image, achieving seamless integration from data processing to physical printing. This overcomes problems such as incoordination between data and hardware control and unsatisfactory printing results in existing technologies, ensuring that high-pass-count vertical images are presented with high quality and high precision on the printing medium.

[0055] In one preferred embodiment of the present invention, the printed image is precisely divided into swaths based on the actual width of the printhead that can stably and effectively cover the ink during a single lateral movement. First, the effective inkjet width value of the printhead is determined by measurement or by referring to technical parameters provided by the printer manufacturer. For example, the effective inkjet width of a certain printer model's printhead is a specific value; using this value as a benchmark, the printed image is divided into individual swaths laterally according to the principle of equal width. The advantage of this division is that the printhead can completely process and spray ink within a swath area during each lateral movement, avoiding idle printhead inkjet capacity or inkjet edge effects (such as excessive or insufficient ink spraying at swath boundaries) caused by unreasonable swath division. This ensures that ink droplets are evenly and reasonably distributed laterally, maximizing printhead inkjet efficiency, improving printing accuracy and overall quality, and solving the problem of print quality fluctuations caused by inaccurate swath division in the prior art.

[0056] In a preferred embodiment of the present invention, for high-resolution printed images, the swath is finely divided based on factors such as the image's lateral resolution and the printhead's minimum inkjet precision. High-resolution images inherently contain richer details and require more delicate color transitions. By considering its lateral resolution and the printhead's minimum inkjet precision, the width of the swath is reduced. Thus, when the printhead moves laterally, it can process different areas more frequently, processing image details more precisely, such as hair strands in portraits or fine textures in artworks. It also allows for more natural color transitions between different areas, reducing color layering and banding, improving print quality, meeting the high-quality requirements for high-resolution image printing, and overcoming the problem of existing technologies struggling to finely render details and color transitions when processing such images.

[0057] In a preferred embodiment of the present invention, a dynamic error compensation mechanism is introduced when acquiring each swath step value to address unavoidable paper feeding errors (caused by variations in paper tension, mechanical wear of the paper feeding mechanism, etc., resulting in deviations in paper movement speed or position) and inkjet errors (such as printhead clogging, uneven ink droplet size, etc., affecting the accuracy of ink droplet placement). During printer operation, the aforementioned errors are monitored in real time using sensors (such as high-precision paper displacement sensors, ink droplet detection sensors, etc.), and the monitored data is fed back to the control unit. The control unit dynamically adjusts the swath step value according to the magnitude and direction of the error based on a preset error compensation algorithm. For example, if a slight acceleration of the paper in the longitudinal direction is detected, causing a tendency for the longitudinal spacing of ink droplets to decrease, the control unit will appropriately increase the step value to ensure that the ink droplets are evenly distributed; conversely, if local clogging of the printhead is found, resulting in sparse areas of ink droplets, the step value will be reduced accordingly to fill the gaps and ensure complete ink droplet coverage. This dynamic error compensation mechanism ensures that ink droplets are always evenly and accurately distributed on the paper, enhancing the stability of print quality and effectively addressing the problem that existing technologies cannot handle various errors during the printing process in real time, thus affecting print results.

[0058] In this preferred embodiment of the invention, the allocation of the number of passes is optimized by fully considering the grayscale distribution characteristics of the image. During the print preparation stage, an image analysis algorithm is used to scan the image, obtain the grayscale value information of each pixel, and construct statistical data such as a grayscale distribution histogram. This is used to identify areas with complex grayscale variations (such as facial contours in a portrait with rich light and shadow levels, or cloud areas in a landscape photograph with delicate light and shadow transitions) and areas with relatively uniform grayscale (such as solid color backgrounds or large areas filled with simple tones). For areas with complex grayscale variations and rich details, the corresponding number of passes in the Y-direction of printing is appropriately increased, allowing the printhead to reproduce image details more precisely through more repeated inkjet operations in these areas, ensuring that every subtle grayscale change is accurately presented. Conversely, in areas with relatively uniform grayscale, the number of passes is reasonably reduced to decrease unnecessary inkjet operations and accelerate printing speed. By using this differentiated PASS number allocation method based on image grayscale distribution, printing efficiency is effectively improved while ensuring overall printing quality. This overcomes the problem of poor quality or low efficiency caused by using a fixed PASS number for the entire image in existing technologies, and better meets the diverse needs of different image content for printing effect and speed.

[0059] Preferably, in step S2, obtaining the index of the data row based on the number of printed PASSes includes: determining the total number of vertical rows of the printed image based on the number of bytes per row of the printed image, the number of colors in the printed image, and the vertical resolution of the printed image, with the specific printed data row index used to indicate which row of the printed image.

[0060] A printing apparatus includes a processor, a memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method described above for printing a vertically high pass count image.

[0061] A storage medium storing computer program instructions that, when executed by a processor, implement the aforementioned method for printing a vertically high pass count image.

[0062] Example 2

[0063] This embodiment differs from Embodiment 1, specifically providing a method for printing vertically high PASS count images, including the following steps:

[0064] S1, before initiating the printing operation, uses mature edge detection algorithms to process the printed image, specifically employing the Sobel operator, Canny edge detection algorithm, etc. These algorithms determine edge-related information of objects in the image based on the gray-level variation characteristics of image pixels;

[0065] Taking architectural drawings as an example, these drawings contain numerous elements such as wall outlines, door and window frames, and beam and column structures, all composed of horizontal and vertical lines. When using the Sobel operator, it accurately locates the pixel positions of each line edge by calculating the grayscale gradient of image pixels in the horizontal and vertical directions. For the horizontal edges of walls, it can accurately detect areas where pixel grayscale values ​​change significantly along that direction, thereby determining the pixel row and column positions of the horizontal wall edge. Similarly, for the edges of vertical columns and diagonal lines such as stair railings and pipe runs, it can accurately capture their start and end points and the positions of each pixel along the line.

[0066] Building upon this foundation, the Canny edge detection algorithm further determines the direction and sharpness of the edges. For the outer contour lines of buildings, which are usually represented by clear drawing lines, the Canny algorithm can determine them as clear edges with a clear direction. However, for lines representing hidden structures or schematic representations within buildings, which may have been blurred or gradually transitioned with surrounding elements during drawing, the algorithm can accurately identify them as relatively blurred edges and mark the range and direction of the blur.

[0067] Taking high-resolution photographs as another example, the image encompasses the outlines of foreground flowers, the background mountain skyline, and the edges of objects such as branches and leaves interspersed in the middle. The Sobel operator and the Canny edge detection algorithm can also accurately locate the edges of each object, distinguishing the direction and sharpness of the edges of different objects.

[0068] S2, optimize the acquisition of data row index based on edge information. Specifically, in the data row index acquisition stage, the present invention adaptively adjusts the calculation formula based on the parity of PRNLineSeq based on the row number and direction features of the edge obtained by edge detection, so as to optimize the distribution of ink droplets in the image, especially to achieve a more ideal presentation effect in the edge area.

[0069] Taking architectural drawings as an example, for rows containing sharp edges representing the building's facade boundary in the vertical direction, the traditional calculation method, which does not consider edge factors, uses the data row index obtained based on the parity of PRNLineSeq to distribute ink droplets at relatively uniform intervals in these edge areas. However, this results in the building facade boundary not being clear enough in the printed effect, insufficient differentiation from the surrounding wall area, and even edge blurring.

[0070] This invention optimizes and adjusts based on edge information. For rows containing sharp vertical edges, when the row number is even (assuming the original calculation formula yields a certain index value), the spacing between the corresponding row indices is increased based on the edge characteristics. Thus, during actual inkjet printing, ink droplets create a more pronounced contrast in density on both sides of the edge, clearly distinguishing the edge from the surrounding wall area and more accurately reproducing the line precision requirements of architectural drawings.

[0071] For rows where the foreground flowers meet the blurred background in high-resolution photographs, given their low edge sharpness and irregular shape, the index values ​​are fine-tuned when calculating the row index, based on the specific edge direction and its relationship with surrounding areas. For example, at the turning points of the edge curves, the index spacing is appropriately adjusted so that ink droplets naturally follow the edge shape when crossing these transition areas. This ensures that the flower outline remains clearly discernible even where it meets the blurred background, preserving the original artistic effect of the photograph while maintaining edge clarity and continuity.

[0072] When acquiring the data row index, the edge-related features corresponding to the current processing row are read from the stored edge information. It is determined whether an edge exists in the row; if so, the direction of the edge and the parity of its row number are further determined. If the row number is even and the edge is a sharp vertical edge (e.g., the boundary of a building facade in architectural drawings), the spacing of the corresponding row index is increased by adding specific values ​​based on the pre-defined adjustment rules and the basic calculation formula for PRNLineSeq parity. If it is another type of edge (e.g., irregular edges in the transition area between flowers and the background in high-resolution photography), the corresponding index value adjustment strategy is adopted based on its specific edge direction and relationship with the surrounding area to ensure that ink droplets are reasonably distributed in and around the edge area, thereby optimizing image details and overall effect.

[0073] S3, dynamically adjust the swath step value by combining edge information. Specifically, in calculating each swath step value, the present invention combines information such as the edge sharpness and direction obtained by edge detection to make dynamic and fine adjustments, so that the ink droplets can be distributed in a way that fits the edge shape more when crossing the edge area, thereby enhancing the clarity and coherence of the image edge and improving the quality of the printed image.

[0074] Taking architectural drawings as an example, the complex, slanted edges at the junction of walls and beams are often sharp and have varied orientations. Traditional fixed swath step value calculation methods do not fully consider these edge characteristics, which can easily lead to uneven distribution of ink droplets when crossing the edge area, resulting in ink droplet accumulation or gaps at the edge, affecting edge clarity and the accurate representation of the overall structure.

[0075] This invention dynamically adjusts the step value based on the sharpness and specific angle of the oblique edge. For example, at the beginning of the edge, the step value is reduced according to the angle between the edge and the adjacent wall and the initial angle of ink droplet ejection, so that the ink droplets cover the starting area of ​​the edge more densely and clearly delineate the starting point of the edge. As the edge extends diagonally, the step value is gradually fine-tuned according to its direction and relative position with the surrounding structure, ensuring that the ink droplets are evenly and closely attached to the edge shape distribution as they cross the entire oblique edge, accurately reproducing the complex details at the junction of the building structure and avoiding jagged or blurry printing effects.

[0076] For the edges where tree branches meet the sky background in high-resolution photography, the swath step value is dynamically adjusted based on factors such as the curvature changes at various points along the branch edge and the color contrast with the sky background. At curved sections of the branch edge with greater curvature, the step value is increased to allow the ink droplets to spread naturally along the curve, preventing excessively dense ink droplets that would result in overly dark colors and affect the image's depth. At relatively flat sections of the branch edge, the step value is finely adjusted to ensure even distribution of ink droplets, maintaining a clear and smooth edge. This results in a natural and realistic outline of the branch against the sky background, enhancing the visual appeal of the image.

[0077] Through the comprehensive optimization method based on image edge detection described above, ink droplets can achieve a reasonable distribution in the edge areas of various images, whether it is the geometric edges in architectural drawings or the outlines of natural objects in high-definition photographs. This overcomes the visual quality problems that existing technologies encounter when processing image edges, making printed images clearer and more realistic. It effectively meets the printing needs of engineering drawings, high-definition photographs, and other printing tasks that require high detail in image edges, thereby improving the overall printing quality.

[0078] During the calculation of each swath step value, the operation is also based on the acquired edge information. For edges with complex orientations and varying sharpness, information such as edge sharpness, orientation (e.g., specific angle, curve shape), and the relative position of the current ink droplet to the edge is read in real time. At the edge's inception, the initial distribution of ink droplets is controlled by decreasing or increasing the step value based on the edge's geometric relationship with its surrounding structure and the physical characteristics of ink droplet ejection. As the ink droplets cross the edge, the step value is continuously fine-tuned according to the dynamic changes in the edge's orientation, following a preset dynamic adjustment algorithm. This ensures that the ink droplets are always closely aligned with the edge's shape, ultimately improving the image's edge sharpness, coherence, and overall visual quality.

[0079] 1.1.1 In this embodiment, the basic calculations related to image edge detection are as follows:

[0080] The Sobel operator determines edge location and intensity by calculating the gray-level gradient of each image pixel in the vertical (Gy) direction. Its calculation formula is as follows:

[0081]

[0082] Among them, I i,j This represents the grayscale value of the pixel at coordinate in the image.

[0083] The final edge strength G can be calculated using the following formula:

[0084]

[0085] When the value of G exceeds the set threshold, the pixel is identified as an edge point, thereby determining the edge position in the image.

[0086] In this embodiment, the core calculation steps of the Canny edge detection algorithm are as follows:

[0087] A Gaussian filter is used to smooth the original image to reduce noise interference with edge detection. The two-dimensional discrete form of the Gaussian filter is as follows:

[0088]

[0089] Where σ is the standard deviation of the Gaussian distribution, which determines the degree of filtering. For each pixel (i,j) in the image, its filtered gray value I... filtered (i, j) is obtained by convolving with a Gaussian filter:

[0090]

[0091] Here, k is usually taken as an integer in the range (3σ, 3σ) to ensure that most of the Gaussian distribution weights are covered.

[0092] Similar to the Sobel operator, the gradient magnitude and direction are calculated for each pixel in the filtered image, but a more precise difference calculation method is used. The specific formula is as follows:

[0093] Gradient magnitude: M(i,j):

[0094]

[0095] Among them, I x (i, j) and I y (i, j) represent the gradient values ​​in the horizontal and vertical directions, respectively. The calculation method can refer to the difference calculation method similar to the Sobel operator, but it is more refined.

[0096] Gradient direction, θ(i,j):

[0097]

[0098] The angle range is typically limited to (0, 2π) or (-π, 5π) for subsequent nonmaximum suppression steps.

[0099] In this embodiment, non-maximum suppression (NMS) is applied to the gradient magnitude of each pixel along the gradient direction to determine whether the pixel is a local maximum. If it is not a local maximum, its gradient magnitude is set to 0 to refine the edges. Specifically, the judgment logic divides the gradient direction into four intervals (e.g., horizontal, vertical, positive diagonal, and negative diagonal), and compares the gradient magnitude with adjacent pixels within the corresponding interval to determine whether to retain the edge information of that pixel.

[0100] In this embodiment, dual threshold detection and edge connection are used, with a high threshold T set. h and low threshold T l ,(T h >T l This process is applied to the image after non-maximum suppression. Pixel gradient magnitudes greater than T are considered valid. h It is directly determined as an edge point; the amplitude is less than T. l Points with amplitudes between the two are considered non-edge points; points with amplitudes between the two are considered edge points if they are connected to already identified edge points. By connecting discontinuous edges in this way, the final edge image is obtained, and the sharpness and direction information of the edges are also determined.

[0101] 1.1.2 In this embodiment, the calculation formula for obtaining the optimized data row index is adjusted based on edge information.

[0102] Let the original formula for obtaining the data row index based on the parity of PRNLineSeq be:

[0103] When PRNLineSeq is even:

[0104]

[0105] When PRNLineSeq is odd:

[0106]

[0107] Where, index original,even and index original,odd These represent the index values ​​corresponding to the original even-numbered and odd-numbered rows, respectively. PRNLineSeq is the row number of the PRN file data that is incremented line by line, and YPassNum is the number of passes printed in the Y direction.

[0108] In this embodiment, for rows containing vertical sharp edges, when a vertical sharp edge is detected in a row and PRNLineSeq is even, the adjusted index value is...

[0109] index adjusted,even The calculation formula is:

[0110] indexadjusted,even =index original,even +Δ vertical,even ;

[0111] Where, Δ vertical,even The index adjustment increment is used for even-numbered rows containing vertically sharp edges, and its value is determined based on factors such as image resolution, edge sharpness, and printer head characteristics.

[0112] In this embodiment, for the case where odd-numbered rows have sharp vertical edges, the adjusted index value can be obtained similarly. adjusted,odd Calculation formula:

[0113] index adjusted,odd =index original,odd +Δ vertical,odd ;

[0114] Where, Δ vertical,odd The method of determining Δ vertical,even same.

[0115] In this embodiment, the row containing the irregular edge is calculated. For the row containing the irregular edge, the index value adjustment needs to consider the curve direction of the edge and its relationship with the surrounding area. The adjusted index value is calculated using the formula: index adjusted,even It can be represented as:

[0116]

[0117] Where n represents the number of discrete points the edge curve passes through in that row (represented by pixels refined after edge detection), Δ irregular (i) represents the index adjustment value corresponding to the i-th discrete point. Its calculation involves multiple factors such as the edge curvature at that point, the difference in grayscale changes with adjacent areas, and the printing accuracy of the printer. For example, it can be represented by a comprehensive function as:

[0118]

[0119] Where k2 is the comprehensive proportionality coefficient, and C(i) is the edge curvature at the i-th discrete point.

[0120] ΔG(i) is the difference in grayscale change between this point and its adjacent regions, P print This indicates the printer's minimum printing resolution.

[0121] 1.1.3 In this embodiment, the calculation formula for dynamically adjusting the swath step value based on edge information is as follows:

[0122] Suppose that when obtaining the swath step value, the original calculation formula for PRNLineSeq when it is an even number is:

[0123]

[0124] The calculation formula for when PRNLineSeq is odd is:

[0125]

[0126] Among them, step original,even and step original,odd These represent the swath step values ​​corresponding to the original even-numbered and odd-numbered rows, respectively. PrintHeight is the effective printing height of the printer head, and YPASSNum is the number of passes in the Y direction of printing.

[0127] In this embodiment, the formula after dynamic adjustment based on image edge detection is as follows:

[0128] For cases with sharp edges and clear directions, when a sharp edge is detected in a row (such as a slanted structural edge in architectural drawings) and PRNLineSeq is even, the adjusted swath step value is set to step. adjusted,even The calculation formula is:

[0129] step adjusted,even =step original,even +Δ step,even ;

[0130] Where, Δ step,even The increment for adjusting the swath step value for even-numbered rows containing the sharp edge is determined by factors such as the sharpness of the edge, the direction angle, and the relative position of the printhead and the paper.

[0131] In this embodiment, for irregular curved edges, taking even-numbered row numbers as an example, the adjusted swath step value is set to step for the row containing the irregular curved edge. adjusted,even The calculation formula can be expressed as:

[0132]

[0133] Where m represents the number of discrete points traversed by the edge curve in that row, Δ step,irregular (i) represents the swath step adjustment value at the i-th discrete point, the calculation of which involves the edge curvature at that point, the diffusion characteristics of the ink droplet at that point, and the color contrast with the surrounding area.

[0134] By adjusting the above series of calculation formulas based on image edge detection, the various characteristics of image edges are fully considered in the process of obtaining data row index and swath step value, thereby achieving a reasonable distribution of ink droplets in the image edge area, improving the quality of printed images, and meeting the requirements of different types of printing tasks for image edge details.

[0135] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for printing vertically high PASS count images, characterized in that, Includes the following steps: S1, Obtain print image information, read the basic information of the image from the print PRN file; S2, calculate the number of PASSes in the Y direction by reading the PRN information; S3, based on the number of PASSes obtained in step S2, obtain the index of the data row; S4. Based on the index of the data row in step S3, obtain the step value for each swath; S5 drives the printing software to send the step value data of each swath preprocessed in steps S1-S4 to the printer control board, controlling the print head to print white ink and color ink images. In step S1, information including resolution, number of passes, number of colors, and BytesPerLine of the image is read from the printed PRN file. Specifically, the resolution is read by reading the header information in the PRN file and inputting y_dpi = struct.unpack('I', f.read(4n))[0] ; The specific method for reading the pass count is: pass_num = ord(f.read(n)); The specific method for reading the number of colors is: color_num = ord(f.read(1)). The 1 in the function means reading 1 byte and converting it to an integer to get the number of colors. The specific steps for reading BytesPerLine are as follows: bytes_per_line = struct.unpack('I',f.read(4))[0], which parses 4 bytes according to the unsigned integer format and obtains the BytesPerLine value; In step S2, the resolution of the image in the Y direction is denoted as ImageYDPI, and the printer's reference Y direction resolution is denoted as PrintYDPI; the number of passes in the Y direction of printing is calculated: ImageYDPI÷PrintYDPI=YPassNum, where YPassNum is the image's Y-direction resolution divided by the printer's reference Y-direction resolution; Specifically, step S3 is as follows: let index be the index of the printed data line, and PRNLineSeq be the line number of the PRN file data that is incremented line by line. When PRNLineSeq is even, index = PRNLineSeq / 2 + YPassNum / 2. When PRNLineSeq is odd, index = (PRNLineSeq-1) / 2. Specifically, step S4 involves setting the effective printing height of the printer head to PrintHeight, and when PRNLineSeq is an even number, calculating the step value of swath using the following formula: step = PrintHeight / YPASSNum - (YPASSNum / 2-1); When PRNLineSeq is an odd number, the formula for calculating the step value of swath is: step = PrintHeight / YPASSNum + (YPASSNum / 2+1).

2. The method for printing a vertically high PASS number image according to claim 1, characterized in that, In step S3, obtaining the index of the data row based on the number of printed PASSes includes: determining the total number of vertical rows of the printed image based on the number of bytes per row, the number of colors in the printed image, and the vertical resolution of the printed image. The specific printed data row index is used to indicate which row of the printed image.

3. A printing device, characterized in that, It includes a processor, a memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method described in any one of claims 1-2.

4. A storage medium, characterized in that, It stores computer program instructions, which, when executed by a processor, implement the method described in any one of claims 1-2.

Citation Information

Patent Citations

  • Jet printing control method, controller and digital printer

    CN114889346A