Generalized method and system for image rasterization
By acquiring image file information and job setting information, performing format recognition and parsing, generating an initialization parameter set, and utilizing standardized input/output interfaces and unified data structures to perform multiple image processing operations, the problem of poor universality of existing RIP technology is solved, and multi-format compatible and efficient image rasterization processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BOYUAN HENGXIN TECH CO LTD
- Filing Date
- 2025-10-11
- Publication Date
- 2026-07-31
AI Technical Summary
Existing RIP technology cannot achieve unified adaptation of multiple file formats, and the algorithm cannot be flexibly replaced or added, resulting in poor versatility, increased R&D and maintenance costs, and difficulty in meeting the needs of multiple image formats, multiple printing devices and multiple printing scenarios.
By acquiring image file information and job setting information, the system performs format recognition and parsing, generates an initialization parameter set, and utilizes standardized input/output interfaces and unified data structures to perform multiple image processing operations. It supports multi-format compatibility and allows for flexible replacement or addition of algorithms.
It achieves universal rasterization processing for multiple image formats, multiple devices, and multiple scenarios, reducing R&D and maintenance costs, improving processing efficiency, and adapting to diverse image output needs.
Smart Images

Figure CN120929028B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of printing technology, and in particular to a general processing method and system for image rasterization. Background Technology
[0002] With the widespread application of digital image output devices such as inkjet printing, laser printing, 3D printing, and industrial roll printing, image rasterization (RIP) technology has become a key step in converting image files of different formats such as TIFF, JPEG, and BMP into dot matrix data that can be recognized by printing devices.
[0003] Most mainstream RIP technologies today are designed with specialized workflows, exhibiting an integrated architecture: on the one hand, these RIP workflows can only reliably recognize and process image files of a single specific format. When dealing with other file formats, separate dedicated processing modules need to be deployed, making it impossible to achieve unified adaptation for multiple file formats; on the other hand, the algorithms for core components such as image scaling, color conversion, and dithering are all fixed and integrated, making it impossible to flexibly replace or add algorithms according to the needs or quality requirements of different output devices. For example, it is impossible to switch to a better interpolation scaling algorithm in high-precision printing scenarios, and it is also difficult to add a suitable dithering algorithm in specific scenarios.
[0004] The existing integrated dedicated RIP workflow design has poor versatility and is difficult to meet the image rasterization processing needs of multiple image formats, multiple printing devices and multiple printing scenarios. Enterprises often need to deploy multiple RIP systems for different application scenarios, which not only increases the R&D and maintenance costs, but also reduces the overall processing efficiency. Summary of the Invention
[0005] The purpose of this invention is to provide a general processing method and system for image rasterization to improve efficiency.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a general processing method for image rasterization, comprising:
[0008] Obtain image file information and job settings information for the image to be processed;
[0009] Based on the image file information, file format recognition and parsing are performed to obtain basic image information;
[0010] The job setting information is initialized to generate an initialization parameter set;
[0011] Based on the basic image information and the initialization parameter set, multiple image processing operations are performed on the image to be processed to obtain a target rasterized image; wherein, the multiple image processing operations interact with each other through standardized input / output interfaces and a unified data structure.
[0012] Optionally, the plurality of image processing operations include a scaling operation;
[0013] The scaling operation includes:
[0014] Obtain the original resolution and original DPI from the basic image information;
[0015] Obtain the target DPI and scaling mode parameters from the initialization parameter set;
[0016] Calculate the target resolution based on the original resolution, the original DPI, and the target DPI;
[0017] Based on the target resolution and the scaling mode parameters, a corresponding scaling algorithm is selected from the preset algorithms to scale the image;
[0018] The scaling operation is implemented in blocks through a hook function that reads and writes line by line.
[0019] Optionally, the preset algorithm includes at least the nearest neighbor algorithm, the bilinear algorithm, the cubic spline algorithm, and the Mitchell filtering algorithm;
[0020] Based on the target resolution and the scaling mode parameters, a corresponding scaling algorithm is selected from preset algorithms for scaling, including:
[0021] When the target resolution is greater than or equal to a preset threshold and the scaling mode parameter represents a high-speed mode, the nearest neighbor algorithm is selected for scaling.
[0022] When the target resolution is less than the preset threshold and the scaling mode parameter represents high-speed mode, or when the target resolution exceeds the preset threshold and the scaling mode parameter represents balanced mode, the bilinear algorithm is selected for scaling.
[0023] When the target resolution is less than the preset threshold and the scaling mode parameter represents the balanced mode, or when the target resolution exceeds the preset threshold and the scaling mode parameter represents the high-quality mode, the cubic spline algorithm is selected for scaling.
[0024] When the target resolution is less than the preset threshold and the scaling mode parameter represents an ultra-high precision mode, the Mitchell filtering algorithm is selected for scaling.
[0025] Optionally, the plurality of image processing operations include color space conversion operations;
[0026] The color space conversion operation includes:
[0027] The original color space is obtained from the basic image information; the original color space includes the color space type and the corresponding number of color channels;
[0028] Obtain the target color space, color management parameters, and target color depth from the initialization parameter set;
[0029] Based on the color management parameters, the original color data in the original color space is preprocessed to obtain preprocessed color data.
[0030] The preprocessed color data is converted from the original color space to the target color space; the target color space includes CMYK, duotone, monochrome, and LkLcLmLy.
[0031] Based on the target color depth, the converted color data is quantized to obtain color space conversion output data;
[0032] If the image to be processed is a spot color TIFF image, the general image rasterization processing method skips the color space conversion operation.
[0033] Optionally, the plurality of image processing operations include tone processing operations;
[0034] The tone processing operation includes:
[0035] Read the lookup table corresponding to each color channel from the initialization parameter set; the lookup table is a static table pre-generated based on the hue intensity parameter set in the job and the original color space in the image basic information.
[0036] By using lookup tables corresponding to each color channel, the corresponding channel value of each pixel in the image is transformed in real time to achieve brightness adjustment, contrast adjustment, or gamma adjustment.
[0037] Optionally, the general image rasterization processing method further includes the following steps before performing tone processing:
[0038] Based on the hue intensity parameter and the original color space, a corresponding lookup table is generated for each color channel;
[0039] The step of generating a corresponding lookup table for each color channel based on the hue intensity parameter and the original color space includes:
[0040] When the hue intensity parameter is greater than 0, for each color channel, the hue intensity parameter is substituted into the formula:
[0041] ;
[0042] The contrast enhancement factor is calculated; where expense is the contrast enhancement factor; Tmax is the maximum hue intensity; and ToneValue is the hue intensity parameter.
[0043] Formula used:
[0044] ;
[0045] Calculate the pixel rate; where, The pixel rate; The raw pixel value within a single color channel. ;
[0046] Formula used:
[0047] ;
[0048] Calculate the pixel values after the first hue adjustment; where, The pixel value after adjustment to the first color tone; This is a rounding function;
[0049] When the hue intensity parameter is less than 0, for each color channel, substitute the hue intensity parameter into the formula:
[0050] ;
[0051] Calculate the contrast compression factor; where, The contrast compression factor;
[0052] Formula used:
[0053] ;
[0054] Calculate the pixel values after adjusting for the second hue; The pixel value is adjusted for the second hue.
[0055] Optionally, the plurality of image processing operations include a jitter processing operation;
[0056] The jitter processing operation includes:
[0057] Obtain the output depth parameter and jitter mode parameter from the initialization parameter set;
[0058] Based on the output depth parameter and the jitter mode parameter, a corresponding jitter algorithm is selected from the preset jitter algorithm for jitter processing;
[0059] The step of selecting a corresponding jitter algorithm from a preset jitter algorithm for jitter processing based on the output depth parameter and the jitter mode parameter includes:
[0060] When the output depth parameter is the first bit value and the jitter mode parameter represents the fast output mode, the random jitter algorithm is selected for jitter processing.
[0061] When the output depth parameter is the second bit value and the jitter mode parameter represents the balance mode, or when the output depth parameter is the first bit value and the jitter mode parameter represents the uniformity priority mode, the array jitter algorithm is selected.
[0062] When the output depth parameter is the third bit value and the jitter mode parameter represents a high-quality mode, or when the output depth parameter is the second bit value and the jitter mode parameter represents a detail-preserving mode, the error diffusion algorithm is selected; wherein, the first bit value is less than the second bit value, and the second bit value is less than the third bit value.
[0063] Optionally, based on the image file information, file format recognition and parsing are performed to obtain basic image information, including:
[0064] The file extension and file type in the image file information are matched with the preset read function registry, and the matching target read function is called;
[0065] The target reading function is used to extract the original image information;
[0066] The original image information is standardized to obtain the basic image information that conforms to a preset data format.
[0067] Optionally, the original image information is standardized to obtain basic image information conforming to a preset data format, including:
[0068] By unifying the attribute identification rules and data types of raw image information, standardized information is obtained.
[0069] The standardized information is organized according to a preset original information key-value pair structure to obtain the basic information of the image;
[0070] The initialization process for the job settings information includes:
[0071] Convert job settings information into standardized parameters:
[0072] The above standardized parameters are organized into the structure according to the preset target parameter key values.
[0073] The beneficial effects of this invention are as follows: Compared with the prior art, the universal image rasterization processing method provided by this invention first obtains the image file information and job setting information of the image to be processed, and then generates basic image information through file format recognition and parsing, and generates an initialization parameter set through job setting initialization. This achieves decoupling of the original attributes and target rules from the dual data sources, eliminating the need to deploy independent processing modules for different image formats, and is compatible with multiple image formats such as TIFF, JPEG, and BMP. At the same time, multiple image processing operations interact through standardized input / output interfaces and unified data structures, breaking the limitation of fixed algorithm integration. When adding or replacing algorithms in image processing, there is no need to modify the global logic, and enterprises do not need to deploy multiple RIP systems, reducing R&D and maintenance costs, significantly improving the efficiency of image rasterization processing, and ultimately achieving universal rasterization processing that adapts to multiple image formats, multiple devices, and multiple scenarios, meeting the diverse needs of the image output field.
[0074] Secondly, the present invention also provides a general processing system for image rasterization, comprising:
[0075] The acquisition module is used to acquire image file information and job setting information of the image to be processed;
[0076] The file parsing module is used to identify and parse the file format based on the image file information to obtain basic image information;
[0077] An initialization module is used to initialize the job setting information and generate an initialization parameter set;
[0078] The image processing operation module is used to perform multiple image processing operations on the image to be processed based on the basic image information and the initialization parameter set to obtain a target rasterized image. The multiple image processing operations interact with each other through standardized input / output interfaces and a unified data structure, so that modifications to the internal logic of each operation do not affect other operations. Attached Figure Description
[0079] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0080] Figure 1 One of the schematic flowcharts of a general image rasterization processing method provided in an embodiment of the present invention;
[0081] Figure 2 This is a schematic diagram of the structure of a general image rasterization processing system provided in an embodiment of the present invention. Detailed Implementation
[0082] To facilitate a clear description of the technical solutions in the embodiments of the present invention, the terms 'first' and 'second' are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. For example, the first threshold and the second threshold are merely used to distinguish different thresholds and do not limit their order. Those skilled in the art will understand that the terms 'first' and 'second' do not limit the quantity or execution order, and the terms 'first' and 'second' are not necessarily different.
[0083] It should be noted that in this invention, the terms 'exemplary' or 'for example' are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as 'exemplary' or 'for example' in this invention should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms 'exemplary' or 'for example' is intended to present the relevant concepts in a concrete manner.
[0084] In this invention, 'at least one' means one or more, and 'more than one' means two or more. 'And / or' describes the relationship between the associated objects, indicating that three relationships can exist.
[0085] like Figure 1 As shown, embodiments of the present invention provide a general processing method for image rasterization, which may include:
[0086] Step 100: Obtain the image file information and job settings information of the image to be processed;
[0087] Step 200: Based on the image file information, perform file format recognition and parsing to obtain basic image information;
[0088] For example, image file information can include the file extension and file type.
[0089] For example, when a user uploads a file, the system recognizes:
[0090] File extension: .tif. .tif indicates TIFF format.
[0091] File type: The header magic number confirms that it is a TIFF image. For example, if the first two bytes are II or MM, it is confirmed to be a TIFF image. It should be noted that the header magic number is a specific byte sequence at the beginning of the file used to identify the true format, and the first two bytes being II or MM is a fixed characteristic of the TIFF image header magic number.
[0092] For example, step 200 may specifically include:
[0093] Step 1: Match the file extension and file type in the image file information with the preset reading function registry, and call the matching target reading function; for example, refer to Table 1.
[0094] Table 1: Relevant parameters of images to be processed in different formats.
[0095]
[0096] It should be noted that the registry predefines a mapping of 'extension and file type → read function' for the read function. For example, even if a TIFF file is renamed to .img, it will still be recognized as a TIFF by the magic number and the corresponding function will be called.
[0097] Step 2: Use the target reading function to extract the original image information.
[0098] For example, the following raw image information can be extracted from a TIFF file:
[0099] Original width and height: TIFF header offset 24-27 bytes, corresponding to a 4-byte unsigned integer → width 1920, height 1080.
[0100] Original DPI: TIFF label 282 means X resolution = 300dpi; label 283 means Y resolution = 300dpi.
[0101] Color Channels: Label 262 stands for Photometric Interpretation, and its value of 2 corresponds to RGB mode → 3 channels.
[0102] Number of bytes per line: (1920 × 24 bits) ÷ 8 = 5760 bytes, which follows the line byte alignment rules of the TIFF uncompressed format.
[0103] For example, extract the following raw image information from a JPEG file containing EXIF metadata:
[0104] Original width and height: After the SOI segment, there is the APP0 segment, which is identified as FFE0. Read ImageWidth, which corresponds to 2 bytes = 1920, and ImageHeight, which corresponds to 2 bytes = 1080.
[0105] Original DPI: EXIF segment XResolution=72 / 1, that is, 72dpi, YResolution=72 / 1.
[0106] Color channels: JPEG defaults to 3 channels, which are obtained by converting YCrCb to RGB, BitsPerSample=8→3 channels.
[0107] Number of bytes per line: (1920 × 24 bits) ÷ 8 = 5760 bytes. JPEG compression is ignored during the calculation, and only the original pixel arrangement is recorded.
[0108] Step 3: Standardize the original image information to obtain basic image information that conforms to the preset data format.
[0109] For example, the third step may include:
[0110] (1): Unify the attribute identification rules and data types of the original image information to obtain standardized information;
[0111] For example, refer to Table 2 to compare the DPI normalization of TIFF and BMP.
[0112] Table 2: List of information related to DPI standardization for TIFF and BMP.
[0113]
[0114] Unified attribute identifiers: The 'width and height' of all formats are unified to the original width and height, i.e., pixel pairs; the 'DPI' is unified to the original DPI; and the color channels are unified to enumerated values, i.e., RGB, CMYK, or spot colors.
[0115] (2): Standardize the information according to the preset original information key-value pair structure to obtain the basic information of the image.
[0116] Taking a TIFF file as an example, this file is a non-spot color type, RGB three-channel, uncompressed format, and its basic image information is organized according to the preset original information key-value pair structure as follows:
[0117] For example, the "Original Width and Height" field has a value of "1920×1080", and its data type is an unsigned 32-bit integer pair, representing the original width and height pixel values of the image;
[0118] The “Raw DPI” field has a value of “300×300” and a data type of unsigned 32-bit integer pair. The DPI in the X and Y directions is set independently, both of which are 300 dpi.
[0119] The “Color Channel” field has a value of “RGB”, a data type of string enumeration, and can only be selected from three types: RGB, CMYK, and spot color, representing the original color space type of the TIFF file.
[0120] The "Bytes per line" field has a value of 5760, which is an unsigned 32-bit integer representing the number of bytes occupied by each line of pixel data in the TIFF file.
[0121] The "Spot Color Marker" field has a value of "false" and is a Boolean type. It is marked as "false" because this TIFF file is not a spot color image.
[0122] As shown in steps 1) and 2), regardless of whether the input is TIFF (300dpi), JPEG (72dpi), or BMP (72dpi), the basic information of the final output image is presented in a unified format, providing consistent input for subsequent image processing operations and achieving multi-format compatibility. For example, scaling operations in image processing do not need to concern themselves with the unit or storage method of the original DPI; they can directly read the standardized original DPI.
[0123] Step 300: Initialize the job settings information and generate an initialization parameter set;
[0124] Step 300 may include:
[0125] Step 1: Convert job settings information into standardized parameters:
[0126] Step 2: Organize the above standardized parameters into the structure according to the preset target parameter key values.
[0127] In one specific implementation, a user needs to process a landscape image for A3-sized inkjet printing. The original job requirements, i.e., job settings, are as follows:
[0128] ① Print resolution: 300 DPI both horizontally and vertically for clarity, matching the resolution of the inkjet printer;
[0129] ② Color mode: Use four-color printing, namely CMYK, which is a common mode for inkjet printing;
[0130] ③ Contrast Ratio: Slightly increase it, based on user's subjective needs; the actual setting is 'Enhance by 50'.
[0131] ④ Dithering effect: For clear details and to avoid color blocks, select the error diffusion algorithm;
[0132] ⑤ Output method: Save separately according to the four color channels C / M / Y / K for easy subsequent channel-by-channel printing;
[0133] ⑥ Color depth: Each channel is stored using 4 bits to balance precision and file size.
[0134] Step 1 is used to generate standardized parameters that conform to the specifications for each of the above original requirements, as shown in Table 3 below:
[0135] Table 3: Correspondence between work requirements and standardized parameters.
[0136]
[0137] Then, the operation in step 2 is adopted: the standardized parameters obtained in step 1 are organized into a structure with fixed key names and standardized parameters as values, usually in JSON format, to finally generate the initialization parameter set: for example:
[0138] The first fixed key name: Target resolution. The parameter value corresponding to this key is "300, 300", which corresponds to the horizontal and vertical target resolutions, respectively. The data type of this key is marked as "Uint32 integer pair", indicating that the parameter value is stored as a pair of unsigned 32-bit integers.
[0139] The second fixed key name: Target color space. The parameter value corresponding to this key is "CMYK"; the data type of this key is marked as "limited enumeration", which means that the parameter value can only be selected from these few preset enumeration options, and other values cannot be set outside this range.
[0140] The third fixed key name: Hue Intensity parameter. The parameter value corresponding to this key is "50". The data type of this key is marked as "int32, range -100~100", which means that the parameter value is stored as a 32-bit signed integer and the value must be limited to between -100 and 100.
[0141] The fourth fixed key name: Jitter Algorithm Parameter. The parameter value corresponding to this key is "Error Diffusion"; the data type of this key is marked as "Limited Enumeration, such as including random jitter, array jitter and error diffusion, etc.", indicating that the parameter value can only be selected from the above preset enumeration options, and other algorithm types cannot be customized.
[0142] The fifth fixed key name: Output mode parameter. The parameter value corresponding to this key is "color separation output"; the data type of this key is marked as "limited enumeration, such as including color separation output and composite output", indicating that the parameter value can only be selected from the two preset enumeration options of color separation output and composite output, and only these two output methods are supported.
[0143] The sixth fixed key name: Output Depth Parameter. The parameter value corresponding to this key is "4bit"; the data type of this key is marked as "limited enumeration, such as including 1bit, 2bit and 4bit", which means that the parameter value can only be selected from the three preset enumeration options of 1bit, 2bit and 4bit, and only these three color depth settings are supported.
[0144] As can be seen from the above examples, step 300 essentially transforms user requirements into a standardized instruction set that can be recognized by machines and called by modules: first, it solves the problem of unified parameter format, such as 300DPI → Uint32 integer pairs; then it solves the problem of unified parameter structure, such as using the target resolution as the key name; finally, the generated initialization parameter set will work in conjunction with the basic image information to provide a unified target rule for multiple subsequent image processing operations.
[0145] Step 400: Based on the basic image information and the initialization parameter set, perform multiple image processing operations on the image to be processed to obtain the target rasterized image; among them, the multiple image processing operations interact with each other through standardized input and output interfaces and a unified data structure.
[0146] For example, multiple image processing operations may include, but are not limited to, scaling operations, color space conversion operations, tone processing operations, dithering operations, and output operations.
[0147] Technical effects of this embodiment:
[0148] 1) Breaking free from single-format dependence and achieving unified matching of multiple image formats. Existing RIP processes can only handle a single specific format. When dealing with other formats such as JPEG, BMP, PS, EPS, and PDF, additional dedicated modules need to be deployed, resulting in enterprises needing to maintain multiple RIP processing systems. This invention, through a format recognition and parsing mechanism based on image file information, first matches the file extension and file type with a preset reading function registry, calls the corresponding function to extract the original image information; then, it standardizes the original information, ultimately generating image basic information with a unified format. This design allows the system to be compatible with multiple mainstream formats such as TIFF, JPEG, BMP, PS, EPS, PDF, and in-memory data without additional modules, completely solving the adaptation problem of "multiple modules required for multiple formats" in existing technologies.
[0149] 2) Decoupling raw information from target rules lays the foundation for multi-scenario adaptation. Existing technologies forcibly couple raw image attributes with job setting requirements, leading to the need to reconstruct the global logic when parameters are modified or new formats are added. This invention, through a dual independent data source design, completely separates basic image information from the initial parameter set. Subsequent image processing modules can call information across sources as needed; for example, scaling operations read the raw DPI and target DPI, and color conversion operations read the raw color space and target color space, without relying on a single integrated data set. This avoids the coupling problem of existing technologies where a single change requires a complete overhaul, providing underlying support for adaptation to multiple printing devices and multi-scenario needs.
[0150] 3) Breaking away from rigid algorithm integration, supporting flexible expansion and dynamic adaptation of multiple algorithms. In existing technologies, core algorithms such as scaling, color conversion, and dithering are all rigidly integrated, making flexible replacement impossible depending on the printing scenario. This invention achieves inter-module interaction through standardized input / output interfaces and a unified data structure: multiple image processing operations are based on a unified format of basic image information and initialization parameter sets. Data is transferred between operations through standardized interfaces, and the internal logic is completely isolated from other operations. For example, when replacing the scaling algorithm from the bilinear algorithm to the Mitchell filtering algorithm in a high-precision printing scenario, only the internal logic of the scaling operation needs to be modified, without altering other modules such as color conversion and tone processing. This design allows the system to flexibly adjust the algorithm according to the needs of different printing devices, completely solving the limitation of existing technologies where rigid algorithms cannot adapt to multiple scenarios.
[0151] In summary, this invention, through its three-dimensional solution design—unified parsing of multiple formats, decoupling of dual data sources, and modular algorithm expansion—completely solves the problems of poor versatility, high cost, and low efficiency of existing technologies. Ultimately, it achieves unified printing processing of image rasterization across multiple image formats, printing devices, and scenarios, significantly reducing R&D and maintenance costs and significantly improving the versatility of image processing across multiple printing scenarios and printing efficiency.
[0152] The above embodiments mention multiple image processing operations, including scaling operations; in an optional embodiment, the scaling operation includes:
[0153] Obtain the raw resolution and raw DPI from the basic image information;
[0154] Obtain the target DPI and scaling mode parameters from the initialization parameter set;
[0155] The target resolution is calculated based on the original resolution, original DPI, and target DPI. The target resolution calculation follows the principle of consistent scaling units. First, the physical size of the image is determined using the original resolution and original DPI: Physical size = Original resolution / Original DPI (in inches). Then, the target resolution is calculated by combining the target DPI with the following formulas: Target resolution width = Original resolution width / Original horizontal DPI × Target horizontal DPI; Target resolution height = Original resolution height / Original vertical DPI × Target vertical DPI.
[0156] It should be noted that resolution refers to the total number of pixels in an image, such as 1920×1080, while DPI refers to the pixel density per inch. The two should be distinguished separately to avoid calculation errors.
[0157] Finally, based on the target resolution and scaling mode parameters, the corresponding scaling algorithm is selected from the preset algorithms to scale the image; the scaling operation is implemented in blocks through a hook function that reads and writes line by line.
[0158] In the image rasterization scaling operation of this invention, the hook function for line-by-line reading and writing is a specially designed callback function. Its core purpose is to solve the problem of memory overflow when loading the entire high-resolution image: it can actively intercept the pixel data stream read line by line, split and temporarily store it according to the preset block size, and can also automatically schedule the block processing order, synchronize the progress and release the cache to ensure complete stitching; the call is completely bound to the scaling process. The scaling algorithm is automatically triggered by the system after initialization and before reading pixels, without manual intervention. The parameters are also automatically obtained from the basic image information and the initialization parameter set, which efficiently adapts to the block scaling requirements.
[0159] Regarding the preset algorithms, for example, the preset algorithms include, but are not limited to, the nearest neighbor algorithm, the bilinear algorithm, the cubic spline algorithm, and the Mitchell filtering algorithm;
[0160] Specifically, for example, based on the target resolution and scaling mode parameters, a corresponding scaling algorithm is selected from preset algorithms for scaling, including:
[0161] When the target resolution is greater than or equal to a preset threshold and the scaling mode parameter indicates a high-speed mode, the nearest neighbor algorithm is selected for scaling; for example, the preset threshold is 1000 pixels.
[0162] When the target resolution is less than the preset threshold and the scaling mode parameter represents high-speed mode, or when the target resolution exceeds the preset threshold and the scaling mode parameter represents balanced mode, the bilinear algorithm is selected for scaling.
[0163] When the target resolution is less than the preset threshold and the scaling mode parameter represents the balanced mode, or when the target resolution exceeds the preset threshold and the scaling mode parameter represents the high-quality mode, the cubic spline algorithm is selected for scaling.
[0164] When the target resolution is less than a preset threshold and the scaling mode parameter represents an ultra-high precision mode, the Mitchell filtering algorithm is selected for scaling.
[0165] This embodiment has the following technical effects: 1) By combining target resolution and scaling mode parameters to select an algorithm, it meets specific scenario requirements: for example, in high-speed printing scenarios, the target resolution is high, and the nearest neighbor algorithm is selected in high-speed mode; in precision-priority scenarios, the target resolution is low, and the Mitchell filtering algorithm is selected in ultra-high precision mode, thus solving the defects of existing technologies where algorithms are fixed and cannot be switched as needed. 2) By using a hook function for line-by-line reading and writing to achieve block processing, large-format, high-resolution images, such as a 10000×5000 pixel image for industrial roll printing, can be split into small pixel blocks, such as 512×512 pixels, and scaled block by block. This avoids the memory overflow problem caused by full-image loading in existing technologies, adapts to scenarios such as 3D printing and large-format inkjet printing that require processing ultra-large images, and ensures that there are no obvious seams when splicing the blocks. 3) The scaling operation relies on basic image information and a standardized set of initialization parameters. Regardless of whether the input image is TIFF, JPEG or BMP, there is no need to modify the scaling logic. For example, after the original DPI of a BMP image is standardized to 72 DPI, the target resolution is calculated using the same formula as the 300 DPI of a TIFF image, which solves the defect of existing technology that requires reconstruction of the scaling module when binding to a single format or multiple formats.
[0166] The above embodiments mention multiple image processing operations, including color space conversion operations; in an optional embodiment, the color space conversion operation includes:
[0167] Obtain the original color space from the basic information of the image; the original color space includes the color space type and the number of its corresponding color channels;
[0168] The target color space, color management parameters, and target color depth are obtained from the initialization parameter set. The color management parameters include gamut mapping rules and color level adjustment thresholds. The target color depth is 8-bit, 16-bit, etc. It should be noted that the target color depth is channel-level precision; that is, the desired color depth is set according to the precision of each individual channel. For example, in CMYK mode, there are four color channels: cyan, magenta, yellow, and black. If each channel is designed with 8-bit precision, then the total number of colors that can be displayed is... If each channel is designed with 16-bit precision, the total number of colors is... The higher the number of bits in a channel, the finer the density level of a single channel, the more colors there are in total, and the smoother the color transitions.
[0169] Based on color management parameters, the original color data in the original color space is preprocessed to obtain preprocessed color data. The preprocessing process includes: if some colors in the original color space exceed the target device color gamut corresponding to the target color space, color gamut mapping rules are used to compress or replace the colors exceeding the color gamut with approximate colors within the target color gamut; if the color level range of the original color data, such as 0-200, does not match the requirements of the target device, such as 0-255, a color level adjustment threshold is used to stretch or compress the original color levels to the target range to avoid the converted colors being too dark or overexposed.
[0170] The preprocessed color data is converted from the original color space to the target color space; the target color space includes CMYK, duotone, monochrome, and LkLcLmLy.
[0171] For example, the target color space may also include OGBR.
[0172] Based on the target color depth, the converted color data is quantized to obtain color space conversion output data. The quantization process includes: if the target color depth is 8 bits, the converted color data is quantized to an integer range of 0-255; if the target color depth is 16 bits, it is quantized to an integer range of 0-65535, to ensure that the quantized color data meets the color data storage format requirements of the target device and avoid device reading errors or color distortion due to depth incompatibility.
[0173] If the image to be processed is a spot color TIFF image, the general image rasterization processing method skips the color space conversion operation.
[0174] It should be further explained that the specific conversion logic of the image from the original color space to the target color space is as follows: 1) If the original color space is RGB and the target color space is CMYK, first normalize the RGB pixel values to [0,1], calculate the basic CMY values according to the formula C=1-R, M=1-G, Y=1-B, then calculate the black component through K=min(C,M,Y), and finally adjust the CMY values (C=(CK) / (1-K), M=(MK) / (1-K), Y=(YK) / (1-K)); 2) If the target color space is LkLcLmLy, take the luminance channel of the original color space as the reference, and generate Lk (luminance) and Lc, Lm, and Ly (color components) through linear transformation; if the target color space is ogbr, based on the device primary color mapping table in the initialization parameter set, map the original channel values to the device-specific primary color values in the ogbr space.
[0175] This embodiment has the following technical effects: 1) Color space conversion operation can accurately ensure color output quality and device compatibility: By preprocessing the original color data through color management parameters, the part of the original color that exceeds the target device color gamut, such as the CMYK color gamut of the RGB ultra-high-density inkjet printer, can be mapped to an approximate color within the target color gamut according to the rules. It can also adjust the threshold according to the color level to match the device color level requirements, such as stretching the original 0-200 color level to the 0-255 range required by the device, avoiding color cast, too dark or overexposed after conversion; combined with the quantization processing of the target color depth, the converted data can be accurately matched to the device storage format such as 8-bit (0-255 range) and 16-bit (0-65535 range), completely eliminating the device reading error or color distortion problem caused by depth incompatibility. 2) This operation has strong scene adaptability and versatility: it supports multiple conversion logics such as RGB to CMYK, original space to LkLcLmLy, and original space to OGBR, adapting to different scene requirements such as inkjet printing and special device output; and it skips the conversion for spot color TIFF images, taking into account the special needs of spot color applications in the printing industry, which greatly improves the adaptability and output reliability of image rasterization processing in multiple devices and multiple scenes.
[0176] The above embodiments mention multiple image processing operations, including tone processing operations; in an optional embodiment, the tone processing operation includes:
[0177] Read the pre-generated lookup table corresponding to each color channel from the initialization parameter set: Lookup Table (LUT); The lookup table is a static table pre-generated based on the tone intensity parameter (ToneValue) in the job settings information and the original color space in the basic image information.
[0178] By using lookup tables corresponding to each color channel, the corresponding channel value of each pixel in the image is transformed in real time to achieve brightness adjustment, contrast adjustment or gamma adjustment, and the transformed pixel value is limited to the range of 0-255 by boundary protection logic.
[0179] Specifically, common image rasterization methods before performing tone processing operations include:
[0180] Based on the hue intensity parameter and the original color space, a corresponding lookup table is generated for each color channel.
[0181] Based on the hue intensity parameter and the original color space, a corresponding lookup table is generated for each color channel, including:
[0182] When the hue intensity parameter is greater than 0, substitute the hue intensity parameter into the formula for each color channel:
[0183] (1)
[0184] The contrast enhancement factor is calculated; where expense is the contrast enhancement factor; Tmax is the maximum hue intensity, Tmax=100×65536; and ToneValue is the hue intensity parameter.
[0185] Formula used:
[0186] (2)
[0187] Calculate the pixel rate; where, Pixel rate; The raw pixel value within a single color channel. ;
[0188] Formula used:
[0189] (3)
[0190] Calculate the pixel values after the first hue adjustment; where, The pixel values adjusted for the first hue, which is also the first lookup table; This is a rounding function;
[0191] When the hue intensity parameter is less than 0, substitute the hue intensity parameter into the formula for each color channel:
[0192] (4)
[0193] Calculate the contrast compression factor; where, This is the contrast compression factor;
[0194] Formula used:
[0195] (5)
[0196] Calculate the pixel values after adjusting for the second hue; This refers to the pixel values adjusted for the second hue, which is also the second lookup table.
[0197] When the original color space is RGB, the color channels include R, G, B, and A channels; when the original color space is CMYK, the color channels include C, M, Y, and K channels.
[0198] It should be noted that RGB is an abbreviation for Red, Green, and Blue, a color space based on the mixing of the three primary colors of light, widely used in screen display and digital image storage. For example, in this embodiment of the invention, RGB can be used as an input source for color space conversion, such as RGB to CMYK for printing. Tone processing requires the independent generation of LUTs for the R, G, B, and A (Alpha) transparency channels to ensure consistency between the screen preview and the printed effect.
[0199] CMYK is an abbreviation for Cyan, Magenta, Yellow, and Key, all taken from the first letters of the key colors. It is a color space based on the mixing of the three primary colors of pigments and is specifically used for printing, such as inkjet and laser printing.
[0200] LkLcLmLy is a professional color space that separates luminance and chroma. Lk (Luminance-key) is the primary luminance channel, determining the brightness and darkness of an image. Lc (Luminance-chroma1), Lm (Luminance-chroma2), and Ly (Luminance-chroma3) are three component color channels, each corresponding to different hue saturations. Unlike RGB, which stores luminance and chroma together, LkLcLmLy completely separates luminance and chroma information. For example, when adjusting contrast, only the LUT of the Lk channel needs to be modified, without affecting color saturation; similarly, when adjusting hue, only the LUTs of the Lc / Lm / Ly channels need to be modified, without affecting the brightness and darkness.
[0201] Color tone processing can specifically optimize the Lk channel, such as improving the surface brightness and shadow details of 3D printed models, while preserving the color purity of the Lc, Lm, and Ly channels, avoiding the problem of color bias that inevitably occurs when adjusting contrast in traditional color spaces.
[0202] In this embodiment, ogbr is an abbreviation for Output Device Gamut-Based RGB, a device-specific color space. "O" represents Output, and "gbr" corresponds to the device's native red (g), green (b), and blue (r) primary colors. Some devices may have a different primary color order than standard RGB. The LUT generation for tone processing needs to consider the device's primary color characteristics in ogbr. For example, if the native brightness of the green channel on a certain ogbr device is low, the LUT needs to additionally enhance the high pixel values of the green channel by stretching it. For instance, when ToneValue=20, the expense value of the green channel LUT is 10% smaller than that of the red channel to ensure that the green output from the device matches the design image.
[0203] This embodiment has the following technical effects: 1) For high-resolution images, such as 10000×5000 pixel images printed on industrial rolls, if the tone transformation formula is calculated pixel by pixel, it would require more than a million calculations; however, after static LUT pre-generation, tone processing only requires table lookup and replacement, directly reading the corresponding value of LUT[i], reducing the amount of computation by more than 90%, completely solving the problem of low efficiency in real-time processing of high-resolution images. 2) Independent channel processing, adapting to the characteristics of multiple color spaces. Avoiding color distortion caused by multiple channels sharing LUT: For example, the R channel of RGB and the K channel of CMYK have completely different sensitivities to contrast: the R channel needs to retain more highlight details, the LUT needs to weaken the stretching of high pixel values, the K channel needs to strengthen the dark area level, and the LUT needs to strengthen the compression of low pixel values. Independent LUT can accurately match the characteristics of each channel, ensuring that color consistency is maintained after RGB to CMYK conversion. 3) Stable output: Boundary protection combined with quantization calibration eliminates abnormal pixel values. Specifically, without boundary protection, when ToneValue is too large, for example, ToneValue=90, expense=100×65536-90≈6552700, The value might approach 0 or infinity, causing pixel values to exceed the 0-255 range, such as negative values or values above 300. This embodiment uses round() quantization and truncation at the 0-255 boundary to ensure the output pixel value fully matches the hardware requirements of the printing device: for example, color depth must match the device's storage format, avoiding white patches or black spots caused by abnormal pixel values. 4) Flexible scenarios: Positive and negative ToneValue adaptation covers all enhancement and compression needs. Specifically, it can cover multiple printing scenario requirements: Industrial parts drawing printing (ToneValue=50), enhancing contrast: stretching line pixel values through an exponential function, for example, an original line pixel value of 100 → adjusted to 150, making the lines clearer; Portrait photo printing (ToneValue=-30), compressing contrast: weakening the difference between light and dark through a linear function i×factor, for example, an original dark pixel value of 20 → adjusted to 14, an original highlight pixel value of 230 → adjusted to 161, avoiding overexposure or underexposure of faces, meeting the multi-scenario adaptation goal. 5) Universal compatibility: Collaborating with color space conversion, supporting full-process adaptation. Specifically, for example, when the original image is converted to the LkLcLmLy color space, a "low Tone Value, such as -20" LUT can be generated for the Lk channel to compress brightness and contrast and avoid overexposure of highlights, and a "high Tone Value, such as 40" LUT can be generated for the Lc channel to enhance color contrast and make colors more vivid. This fully adapts to the brightness and color separation characteristics of the LkLcLmLy color space, and enhances general performance.
[0204] The above embodiments mention multiple image processing operations including a dithering operation. In one optional embodiment, the dithering operation includes:
[0205] Obtain the output depth parameter and jitter mode parameter from the initialization parameter set; for example, the output depth parameter includes 1 bit, 2 bits and 4 bits;
[0206] Based on the output depth parameter and jitter mode parameter, a corresponding jitter algorithm is selected from the preset jitter algorithms for jitter processing;
[0207] Based on the output depth parameter and jitter mode parameter, a corresponding jitter algorithm is selected from the preset jitter algorithms for jitter processing, including:
[0208] When the output depth parameter is the first bit value and the dithering mode parameter represents the fast output mode, a random dithering algorithm is selected for dithering processing; the first bit value is, for example, 1 bit.
[0209] When the output depth parameter is the second bit value and the dithering mode parameter represents the balanced mode, or when the output depth parameter is the first bit value and the dithering mode parameter represents the uniformity priority mode, the array dithering algorithm is selected; the second bit value is, for example, 2 bits.
[0210] When the output depth parameter is the third bit value and the dithering mode parameter represents a high-quality mode, or when the output depth parameter is the second bit value and the dithering mode parameter represents a detail-preserving mode, the error diffusion algorithm is selected. Here, the third bit value is, for example, 4 bits, the first bit value is less than the second bit value, and the second bit value is less than the third bit value. The error diffusion algorithm calculates the quantization error and distributes it proportionally to adjacent pixels.
[0211] Dithering can convert continuous tone data into device-recognizable bitmap data, such as error diffusion.
[0212] for each y from top to bottom do
[0213] for each x from left to right do
[0214] oldpixel := pixels[x][y]
[0215] newpixel := find_closest_palette_color(oldpixel)
[0216] pixels[x][y] := newpixel
[0217] quant_error := oldpixel newpixel
[0218] pixels[x + 1][y] := pixels[x + 1][y] + quant_error ×7 / 16
[0219] pixels[x 1][y + 1] := pixels[x 1][y + 1] + quant_error × 3 / 16
[0220] pixels[x ][y + 1] := pixels[x ][y + 1] + quant_error ×5 / 16
[0221] pixels[x + 1][y + 1] := pixels[x + 1][y + 1] + quant_error ×1 / 16
[0222] It should be noted that in the dithering algorithm, the dithering threshold matrix can be dynamically rotated or switched to improve output uniformity. For example, clustered dot screens are defined as follows: if consecutive thresholds are spatially adjacent, then this is called a clustered dot screen. An 8×8 dithering threshold matrix is illustrated below:
[0223]
[0224] This embodiment has the following technical effects:
[0225] 1) The algorithm is precisely matched to different printing scenarios, covering multiple dimensions of needs such as speed, uniformity, and detail, and has strong versatility. ① Fast output scenario: 1-bit combined with fast mode selects random dithering, balancing efficiency. The core advantage of the random dithering algorithm is its simple calculation and independence, meaning it does not need to traverse adjacent pixels, which can significantly reduce computation time. ② Uniformity priority scenario: 1-bit uniformity and 2-bit balanced mode, select array dithering, which can avoid the use of a "fixed threshold matrix" such as a 4×4 or 8×8 matrix to determine whether a pixel should be retained. Compared with the irregular distribution of random dithering, it can significantly improve the uniformity of the dot matrix, that is, it can reduce the local black dot clusters or white dot gaps. ③ High quality and detail scenario: 4-bit high quality / 2-bit detail mode, select error diffusion algorithm to preserve texture. ④ The core logic of the error diffusion algorithm is to distribute the quantization error of the current pixel, that is, the difference between the actual value and the dot matrix value, proportionally to the adjacent unprocessed pixels. It can simulate the transition effect of continuous tones, and is especially suitable for preserving image details such as human skin texture and fine lines in industrial drawings.
[0226] 2) Multiple output depth adaptation for compatibility with printing devices with different hardware capabilities. ① 1-bit output meets the needs of low-precision, high-speed devices. 1 bit can only represent two states: black and white, meaning the dot matrix is either black or white, commonly found in simple label printers and thermal printers. Adapting the 1-bit depth through random dithering or array dithering ensures that these devices can quickly generate recognizable dot matrix data, avoiding data overflow due to algorithm incompatibility. For example, using a 4-bit algorithm to process 1-bit data will produce invalid grayscale values. ② 2-bit or 4-bit output meets the needs of medium- to high-precision devices. 2 bits can represent 4 grayscale levels, such as 0-3, and 4 bits can represent 16 grayscale levels, such as 0-15, commonly found in inkjet printers and laser printers. These two depths are adapted through array dithering or error diffusion: 2-bit array dithering can balance grayscale levels and computational efficiency, while 4-bit error diffusion can maximize the use of 16 grayscale levels to represent details. For example, when a 4-bit inkjet printer uses error diffusion to process photos, the 16 grayscale levels can simulate a smooth transition from light gray to dark gray, avoiding obvious grayscale breaks.
[0227] 3) Error diffusion algorithm optimization reduces tonal banding and enhances output realism. Traditional algorithm pain point: Directly hard-quantizing continuous-tone pixels into bitmap values, such as converting a 128 grayscale value directly to 1-bit "black," results in the loss of a large amount of intermediate tone information, leading to obvious color blocks in the image, such as the sky's gradient jumping abruptly from light blue to dark blue. Optimization effect of this embodiment: Error diffusion allows adjacent pixels to share the quantization error through error propagation. For example, a pixel with an original value of 128 (gray) becomes 0 (white) after 1-bit quantization, resulting in a quantization error of 128-0=128. After proportional distribution, the right-hand pixel will have an added error of 128×7 / 16=56, and the bottom pixel will have an added error of 128×5 / 16=40. These added errors are incorporated into the quantization judgment during subsequent processing, ultimately making the overall bitmap appear as a visually continuous tone. This is particularly suitable for 4-bit high-quality scenarios such as art reproduction, resulting in an output effect closer to the realistic texture of the original image.
[0228] 4) Modular algorithm selection supports flexible expansion and adaptability to various printing devices. ① To add a new dithering algorithm, simply add the new algorithm to the preset dithering algorithm library and define its matching rules with output depth and dithering mode: for example, 4-bit + ultra-high precision mode → blue noise dithering. There is no need to modify the core logic of the dithering module, such as parameter reading and error propagation framework, nor will it affect other image processing operations such as tone processing and color conversion. This fully conforms to the modular goal of multiple image processing operations interacting through standardized input / output interfaces, where modifications to the internal logic of each operation do not affect other operations. ② When a new output depth device, such as an 8-bit device, only the output depth parameter needs to be expanded, such as adding 8-bit and matching it with the corresponding algorithm, such as 8-bit + top quality mode → improved error diffusion. This allows for rapid adaptation without reconstructing the entire dithering module, significantly reducing the development cost of subsequent device compatibility and achieving the goal of universality.
[0229] In one specific implementation, the general processing flow for image rasterization involves inputting the image to be processed and job settings information to form basic image information and an initialization parameter set, respectively. Then, image processing operations can be performed on the image to be processed one by one in the order of image scaling, color space conversion, tone processing, and dithering processing, and finally, the target rasterized image is output.
[0230] In one optional embodiment, the multiple image processing operations may further include a missing-spray compensation operation. Specifically, the missing-spray compensation operation may include: for inkjet printing scenarios, identifying the location of the missing nozzle and the corresponding image channel, locating the affected pixel area, and reconstructing the pixel value using at least one algorithm selected from adjacent pixel interpolation, color space-based smooth filling, and local image texture reconstruction, supporting dynamic adjustment of compensation intensity and state switching.
[0231] Understandably, multiple image processing operations also include output operations. Output operations include: outputting the processed image data to a target file or memory according to a set format, supporting multi-channel color separation output or composite output, and adapting to the needs of different digital image output devices.
[0232] Regarding the comparison between the RIP process in the prior art and the RIP process in this embodiment of the invention, it should be noted that the RIP process in the prior art is a single-scenario customized integrated architecture. Data coupling and module binding are the fundamental reasons why it cannot adapt to multiple formats and is difficult to extend algorithms. The specific breakdown is as follows:
[0233] (a) Reasons why existing RIP processes cannot adapt to multiple formats.
[0234] Existing RIP processes are centered on scene customization, forcibly coupling job settings with raw image information. Modules are hard-coded to rely on raw data structures of specific formats, resulting in the need to reconstruct the global logic when adding new formats. Specific reasons and examples are as follows:
[0235] 1) Strong binding between input and format: The initialization logic of existing technologies requires that job settings and extracted image information be pre-integrated and only supports a single preset format. For example, RIPs for fixed inkjet printing scenarios only allow TIFF files to be uploaded, and the target DPI in the job settings is directly hard-coded and associated with the original DPI storage tag unique to TIFF files; if a JPEG file is input, the DPI of the file is stored in the EXIF segment and the format is numerator / denominator. The parsing module of existing technologies cannot recognize the EXIF structure, and the association logic between the target DPI and the original DPI is completely incompatible, ultimately resulting in the inability to parse the JPEG file.
[0236] 2) The parameter set contains format-specific raw data: Existing initialization parameter sets not only include target rules but also forcibly embed raw attributes of specific formats, such as the number of bytes per line in a TIFF file and the compression method. This is because subsequent modules, such as scaling and color conversion, rely on these format-specific fields for their logic. For example, the scaling module needs to read the width and height data offset by 24-27 bytes in the TIFF file to calculate the size. If it is a BMP file, the width and height of the file are stored in bytes 18-21 of the bitmap information header. Existing scaling modules cannot recognize the width and height of BMP files due to the hard-coded address reading, and the parameter set needs to add a field for the alignment rules of the number of bytes per line in BMP files, resulting in incompatibility with the BMP format.
[0237] 3) Adding a new format requires global modifications: To support a new format such as JPEG, three types of core modules need to be modified simultaneously: ① Modify the initialization parameter set structure, adding a JPEG-specific EXIF segment parsing field; ② Modify the file parsing module, adding JPEG magic number FFD8 recognition and EXIF reading logic; ③ Modify all modules that depend on the parameter set, for example, the color conversion module needs to adapt to JPEG's YCrCb original color space, while the original module only supports TIFF's RGB. This design of 'adding a new format requires global code modification' makes existing technology unable to efficiently support multi-format parsing.
[0238] (ii) Reasons why the existing RIP process cannot extend the algorithm.
[0239] In existing technologies, the module logic is deeply bound to the parameter set structure and the original data format, and the algorithm is rigidly integrated. Adding or replacing an algorithm requires breaking the underlying logic. Specific reasons and examples are as follows:
[0240] 1) Hard-coded binding between algorithm and parameter set: The algorithm logic of existing technologies relies on the format-specific raw data in the parameter set, rather than standardized target rules. For example, the scaling algorithm is fixed as bilinear interpolation, and its calculation logic directly calls the original resolution and original DPI of the TIFF file in the parameter set. The original resolution corresponds to the file offset of 24-27 bytes, and the original DPI corresponds to labels 282 and 283. If it is to be replaced with the Mitchell filtering algorithm, the parameter set structure must be modified first, such as adding a filter window size field, and then the reading logic of the scaling module must be adjusted synchronously. Modification of the parameter set will trigger a global chain reaction.
[0241] 2) Module coupling leads to complete overhaul: In existing technologies, all modules share and integrate the parameter set of the original data. Modifying any algorithm requires adapting all modules that depend on this parameter set. For example, when adding a missing-spray compensation module, a 'nozzle number-image channel mapping' field needs to be added to the parameter set. This field is hard-coded as a specific extended tag for TIFF files. At this time: ① The scaling module needs to re-adapt to the reading order of the new parameter set to avoid missing the original resolution; ② The file parsing module needs to add TIFF extended tag reading code to write the nozzle mapping into the parameter set; ③ The output module needs to adjust the parameter calling method to prevent errors in the color separation output logic due to the addition of parameter set fields. This design, which requires a global reconstruction for every new algorithm, results in zero algorithm scalability in existing technologies.
[0242] (III) The core design and principle of the present invention to solve the defects of the prior art.
[0243] This invention addresses the shortcomings of existing technologies at the architectural level through dual data source separation, standardized interaction, and modular design. Its core advantages and principles are as follows:
[0244] 1) Implementation logic for multi-format compatibility.
[0245] This invention achieves multi-format compatibility by combining format recognition with original information standardization. The specific logic is as follows:
[0246] First, the automatic format recognition mechanism: It uses a two-dimensional matching system—file extension and magic number (file header features)—to match a pre-defined 'read function registry,' eliminating the need to bind to a single format. For example, when recognizing a TIFF file, it matches the extension .tif with the magic number II or MM, calling the ReadTIFFHeader() function; when recognizing a JPEG file, it matches the extension .jpg with the magic number FFD8, calling the ReadJPEGEXIF() function; and when recognizing a BMP file, it matches the extension .bmp with the magic number BM, calling the ReadBMPInfoHeader() function. Even if the file is renamed, such as changing the TIFF file extension to .img, the format can still be accurately recognized using the magic number.
[0247] Second, mandatory standardization of raw information: Regardless of how the raw information of the input format is stored (e.g., TIFF files use imperial floating-point DPI and BMP files use metric integer DPI), it is uniformly converted to a preset data format: ① Unified data type: The raw DPI is converted to an unsigned 32-bit integer, width and height are converted to unsigned 32-bit integer pairs, and color channels are converted to string enumeration types of 'RGB', 'CMYK', or 'spot color'; ② Unified structure: Organized according to key-value pairs of 'raw width and height', 'raw DPI', 'color channels', and 'spot color markers'. For example, 2835 dots / meter in a BMP file will be converted to 72 dpi and stored together with 300 dpi in a TIFF file as an unsigned 32-bit integer pair of 'raw DPI: X×Y'. Subsequent operations such as scaling and color conversion do not need to care about the raw format; they can directly read the standardized 'basic image information', achieving seamless adaptation to multiple formats. It should be noted that in 'Original DPI: X×Y', X×Y refers to the combination of dots per inch (DPI) in the image along the horizontal (X-axis) and vertical (Y-axis) dimensions. Specifically: X represents the number of dots per inch in the horizontal direction of the image, that is, the number of pixels or dots contained in each inch of length in the horizontal direction; Y represents the number of dots per inch in the vertical direction of the image, that is, the number of pixels or dots contained in each inch of length in the vertical direction.
[0248] 2) The structure and value of having two separate data sources.
[0249] First, data redundancy and coupling are avoided: Merging two data sources into a single dataset, as is done in existing technologies, results in redundant information such as 'raw DPI and target DPI' and 'raw color channels and target color spaces'. Furthermore, when a new image format is added, the structure of this single dataset must be modified simultaneously, for example, by adding raw information fields specific to JPEG files. In this embodiment, after separating the two data sources, the initialization parameter set only contains the target rules and does not involve any original image attributes. When a new image format is added, only the steps for generating basic image information need to be adjusted, i.e., the recognition and raw information extraction logic for the corresponding format is extended. The initialization parameter set requires no modification, fundamentally avoiding data redundancy and coupling problems.
[0250] Secondly, it supports on-demand cross-source information retrieval for subsequent steps: Each subsequent image processing step can independently read the required information from two data sources according to its own functional needs, without relying on a single integrated dataset. For example: ① When performing the scaling processing step, it needs to read the target DPI, the original DPI, and the original resolution, and calculate the target resolution using a formula; ② When performing the missing spray compensation processing step, it needs to read the compensation strategy and the nozzle-channel mapping. This retrieval method completely breaks the binding relationship of 'all steps relying on a single dataset' in existing technologies. Each step only obtains the information it needs and does not need to pay attention to other irrelevant data.
[0251] Third, it provides underlying support for multi-scenario adaptation: When adapting to new scenarios, such as 3D printing, only the processing steps related to the two data sources need to be adjusted, without modifying other existing steps: ① In the 'Job Setting Information Initialization Processing' step, a new target rule 'Target Channel Count = Multi-Material Channel' is added, so that the initialization parameter set includes this new rule; ② In the 'File Format Recognition and Parsing' step, the logic of 'Extracting 3D Image Layer Coordinates' is expanded, so that the basic image information includes this new original attribute. Subsequent processing steps, such as the output processing step, only need to read the newly added target rule and original attribute, without refactoring their own logic; while existing technologies, when adapting to new scenarios, need to modify the global data set structure and all steps that depend on this set, and cannot achieve this kind of flexible adaptation.
[0252] 3) Implementation logic for flexible algorithm extension.
[0253] This invention also enables the addition or replacement of algorithms through standardized input / output interfaces and unified data structures without modifying the global logic. The specific principle is as follows:
[0254] First, standardization of interactions between different image processing steps.
[0255] All interactions between image processing steps are achieved through standardized input / output interfaces. The input and output data required by the interfaces depend only on the basic image information and standardized data in the initialization parameter set, such as unsigned 32-bit integer pairs and enumerated data, and are independent of the computational logic within the steps.
[0256] For example, when performing the scaling process, the input interface always requires the original resolution, original DPI, and target DPI to be unsigned 32-bit integer pairs, and the output interface always provides the target resolution, which is also an unsigned 32-bit integer pair. Even if the scaling algorithm is changed from bilinear interpolation to the Mitchell filtering algorithm, only the pixel interpolation calculation logic inside the scaling process needs to be modified. The input data format, output data format, and data type of the interface remain unchanged, and other image processing steps, such as color conversion steps, do not require any adaptation or adjustment.
[0257] Secondly, adding a new image processing step does not require modifying the existing logic.
[0258] When adding a new image processing step, such as a missing-spray compensation step, only the following operations need to be performed without modifying any existing steps: ① Read the required target rules, such as 'compensation strategy', from the initialization parameter set. This rule is enumerated data, and the optional values include 'adjacent pixel interpolation' and 'texture reconstruction'; ② Read the required raw attributes, such as 'nozzle-channel mapping' and 'affected pixel region', from the basic image information. 'Nozzle-channel mapping' is string enumeration data, and 'affected pixel region' is unsigned 32-bit integer coordinate data; ③ Output the processing result, such as 'compensated pixel value', through the standardized output interface. This pixel value is an integer data in the range of 0-255.
[0259] The entire process requires no modification to the structure of the initialization parameter set, nor any alteration to the logic of existing steps such as scaling and color conversion. It achieves local expansion and completely solves the problem that adding a new step in the existing technology requires global modifications.
[0260] The general image rasterization processing system provided by the present invention will be described below. of The general image rasterization processing system and the general image rasterization processing method described above can be referred to and correspond to each other.
[0261] like Figure 2 As shown, embodiments of the present invention also provide a general image rasterization processing system for implementing the general image rasterization processing method in any of the above embodiments. This system may include:
[0262] The acquisition module 210 is used to acquire image file information and job setting information of the image to be processed;
[0263] The file parsing module 220 is used to identify and parse file formats based on image file information to obtain basic image information;
[0264] The initialization module 230 is used to initialize the job setting information and generate an initialization parameter set;
[0265] The image processing operation module 240 is used to perform multiple image processing operations on the image to be processed based on the basic image information and the initialization parameter set to obtain the target rasterized image. The multiple image processing operations interact with each other through standardized input and output interfaces and a unified data structure, so that modifications to the internal logic of each operation do not affect other operations.
[0266] Specifically, the image processing operation module includes a scaling submodule, a color space conversion submodule, a tone processing submodule, a dithering submodule, and an output submodule. The specific operations of the scaling submodule, color space conversion submodule, tone processing submodule, dithering submodule, and output submodule are described in the corresponding image processing operations of the general image rasterization processing method in any of the above embodiments, and will not be repeated here.
[0267] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art will understand and implement other variations of the disclosed embodiments by reviewing the accompanying drawings, the disclosure, and the appended claims in carrying out the claimed invention. In the claims, the word "include" does not exclude other components or steps, and "one" or "a" does not exclude multiple. A single processor or other unit can implement several of the functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0268] Although the invention has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made therein without departing from the spirit and scope of the invention. Accordingly, this specification and drawings are merely exemplary descriptions of the invention as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if such modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include such modifications and modifications.
Claims
1. A general processing method of image rasterization, characterized in that, include: Obtain image file information and job settings information for the image to be processed; Based on the image file information, file format recognition and parsing are performed to obtain basic image information; The job setting information is initialized to generate an initialization parameter set; Based on the basic image information and the initialization parameter set, multiple image processing operations are performed on the image to be processed to obtain a target rasterized image; wherein, the multiple image processing operations interact with each other through standardized input / output interfaces and a unified data structure; Based on the image file information, file format recognition and parsing are performed to obtain basic image information, including: The file extension and file type in the image file information are matched with the preset read function registry, and the matching target read function is called; The target reading function is used to extract the original image information; The original image information is standardized to obtain the basic image information that conforms to a preset data format; The original image information is standardized to obtain basic image information conforming to a preset data format, including: By unifying the attribute identification rules and data types of raw image information, standardized information is obtained. The standardized information is organized according to a preset original information key-value pair structure to obtain the basic information of the image; The initialization process for the job settings information includes: Convert job settings information into standardized parameters: The above standardized parameters are organized into the structure according to the preset target parameter key values.
2. The general image rasterization processing method according to claim 1, characterized in that, The image processing operations include scaling operations; The scaling operation includes: Obtain the original resolution and original DPI from the basic image information; Obtain the target DPI and scaling mode parameters from the initialization parameter set; Calculate the target resolution based on the original resolution, the original DPI, and the target DPI; Based on the target resolution and the scaling mode parameters, a corresponding scaling algorithm is selected from the preset algorithms to scale the image; wherein, the scaling operation is implemented in blocks through a hook function that reads and writes line by line.
3. The general image rasterization processing method according to claim 2, characterized in that, The preset algorithms include at least the nearest neighbor algorithm, the bilinear algorithm, the cubic spline algorithm, and the Mitchell filtering algorithm; Based on the target resolution and the scaling mode parameters, a corresponding scaling algorithm is selected from preset algorithms for scaling, including: When the target resolution is greater than or equal to a preset threshold and the scaling mode parameter represents a high-speed mode, the nearest neighbor algorithm is selected for scaling. When the target resolution is less than the preset threshold and the scaling mode parameter represents high-speed mode, or when the target resolution exceeds the preset threshold and the scaling mode parameter represents balanced mode, the bilinear algorithm is selected for scaling. When the target resolution is less than the preset threshold and the scaling mode parameter represents the balanced mode, or when the target resolution exceeds the preset threshold and the scaling mode parameter represents the high-quality mode, the cubic spline algorithm is selected for scaling. When the target resolution is less than the preset threshold and the scaling mode parameter represents an ultra-high precision mode, the Mitchell filtering algorithm is selected for scaling.
4. The general image rasterization processing method according to claim 1, characterized in that, The image processing operations include color space conversion operations; The color space conversion operation includes: The original color space is obtained from the basic image information; the original color space includes the color space type and the corresponding number of color channels; Obtain the target color space, color management parameters, and target color depth from the initialization parameter set; Based on the color management parameters, the original color data in the original color space is preprocessed to obtain preprocessed color data. The preprocessed color data is converted from the original color space to the target color space; the target color space includes CMYK, duotone, monochrome, and LkLcLmLy. Based on the target color depth, the converted color data is quantized to obtain color space conversion output data; If the image to be processed is a spot color TIFF image, the general image rasterization processing method skips the color space conversion operation.
5. The general image rasterization processing method according to claim 4, characterized in that, The image processing operations include tone processing operations; The tone processing operation includes: Read the lookup table corresponding to each color channel from the initialization parameter set; the lookup table is a static table pre-generated based on the hue intensity parameter set in the job and the original color space in the image basic information. By using lookup tables corresponding to each color channel, the corresponding channel value of each pixel in the image is transformed in real time to achieve brightness adjustment, contrast adjustment, or gamma adjustment.
6. The general image rasterization processing method according to claim 5, characterized in that, Before performing tone processing, the general image rasterization processing method also includes: Based on the hue intensity parameter and the original color space, a corresponding lookup table is generated for each color channel; The step of generating a corresponding lookup table for each color channel based on the hue intensity parameter and the original color space includes: When the hue intensity parameter is greater than 0, for each color channel, the hue intensity parameter is substituted into the formula: ; The contrast enhancement factor is calculated; where expense is the contrast enhancement factor; and Tmax is the maximum hue intensity. The hue intensity parameter; Formula used: ; Calculate the pixel rate; where, The pixel rate; The raw pixel value within a single color channel. ; Formula used: ; Calculate the pixel values after the first hue adjustment; where, The pixel value after adjustment to the first color tone; This is a rounding function; When the hue intensity parameter is less than 0, for each color channel, substitute the hue intensity parameter into the formula: ; Calculate the contrast compression factor; where, The contrast compression factor; Formula used: ; Calculate the pixel values after adjusting for the second hue; The pixel value is adjusted for the second hue.
7. The general image rasterization processing method according to claim 1, characterized in that, The image processing operations include a jitter reduction operation; The jitter processing operation includes: Obtain the output depth parameter and jitter mode parameter from the initialization parameter set; Based on the output depth parameter and the jitter mode parameter, a corresponding jitter algorithm is selected from the preset jitter algorithm for jitter processing; The step of selecting a corresponding jitter algorithm from a preset jitter algorithm for jitter processing based on the output depth parameter and the jitter mode parameter includes: When the output depth parameter is the first bit value and the jitter mode parameter represents the fast output mode, the random jitter algorithm is selected for jitter processing. When the output depth parameter is the second bit value and the jitter mode parameter represents the balance mode, or when the output depth parameter is the first bit value and the jitter mode parameter represents the uniformity priority mode, the array jitter algorithm is selected. When the output depth parameter is the third bit value and the jitter mode parameter represents a high-quality mode, or when the output depth parameter is the second bit value and the jitter mode parameter represents a detail-preserving mode, the error diffusion algorithm is selected; wherein, the first bit value is less than the second bit value, and the second bit value is less than the third bit value.
8. A general-purpose image rasterization processing system, characterized in that, include: The acquisition module is used to acquire image file information and job setting information of the image to be processed; The file parsing module is used to identify and parse the file format based on the image file information to obtain basic image information; An initialization module is used to initialize the job setting information and generate an initialization parameter set; An image processing operation module is used to perform multiple image processing operations on the image to be processed based on the image basic information and the initialization parameter set to obtain a target rasterized image; wherein, the multiple image processing operations interact with each other through a standardized input / output interface and a unified data structure, so that modifications to the internal logic of each operation do not affect other operations. Based on the image file information, file format recognition and parsing are performed to obtain basic image information, including: The file extension and file type in the image file information are matched with the preset read function registry, and the matching target read function is called; The target reading function is used to extract the original image information; The original image information is standardized to obtain the basic image information that conforms to a preset data format; The original image information is standardized to obtain basic image information conforming to a preset data format, including: By unifying the attribute identification rules and data types of raw image information, standardized information is obtained. The standardized information is organized according to a preset original information key-value pair structure to obtain the basic information of the image; The initialization process for the job settings information includes: Convert job settings information into standardized parameters: The above standardized parameters are organized into the structure according to the preset target parameter key values.