Image printing method and device, computer readable medium and electronic equipment
By performing color conversion and segmentation processing on color photos taken by the camera, and printing them directly on the printing module, the problem of requiring multiple devices to operate on color photos in existing technologies is solved, and a highly efficient printing process is achieved.
Patent Information
- Application Number
- CN202511685288.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technology, color photos taken by cameras need to be modified back and forth between multiple devices before they can be printed in other color formats, resulting in low printing efficiency.
By performing color conversion processing on the image to be printed and then processing it into segments, the image is directly sent to the printing module for printing. The printing module can start printing as soon as it receives at least one segment of image data, avoiding the need to wait for all data transmissions to be completed.
It improves printing efficiency, reduces back-and-forth operations between devices, shortens print start-up delay, and lowers the requirements for transmission link bandwidth and stability, making it suitable for portable printing scenarios.
Smart Images

Figure CN121680757A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of image processing, and particularly relates to an image printing method and device, a computer readable medium and an electronic device. BACKGROUND
[0002] A camera is a device commonly used in people's daily life. Currently, the photos taken by the camera are basically color pictures. In the camera image printing scene, the color images output by the camera are usually directly processed. When a user needs to print pictures in other color forms, the user often needs to send the photos to a computer terminal, modify the color of the image through a drawing software on the computer terminal, and then send the modified image to a special printing device for printing. Such a printing process involves many steps and requires multiple different devices, which reduces the printing efficiency. SUMMARY
[0003] The present application aims to provide an image printing method and device, a computer readable medium and an electronic device to improve the printing efficiency of color conversion images to some extent.
[0004] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.
[0005] According to an aspect of an embodiment of the present application, an image printing method is provided, comprising: color conversion processing of a to-be-printed image to obtain a color conversion image corresponding to the to-be-printed image; fragmentation processing of the color conversion image to obtain a plurality of fragment image data; sequential sending of the plurality of fragment image data to a printing module, so that the printing module starts color conversion image printing upon receiving at least one of the fragment image data.
[0006] According to an aspect of an embodiment of the present application, an image printing device is provided, comprising: a color conversion module configured to perform color conversion processing of a to-be-printed image to obtain a color conversion image corresponding to the to-be-printed image; a fragmentation module configured to perform fragmentation processing of the color conversion image to obtain a plurality of fragment image data; a sending module configured to sequentially send the plurality of fragment image data to a printing module, so that the printing module starts color conversion image printing upon receiving at least one of the fragment image data.
[0007] In an embodiment of the present application, the fragmentation module is specifically configured to: adjusting a height of the color conversion image according to a target image height, and adjusting a width of the color conversion image according to a total number of heating elements in a width direction of a print head in the print module, to obtain an adjusted image; performing slice processing on the adjusted image to obtain a plurality of slice image data.
[0008] In an embodiment of the present application, the slice module is specifically configured to: performing slice processing on the color conversion image to obtain a plurality of candidate slice data; In generating the candidate slice data, performing image deblurring processing on the candidate slice data to obtain slice image data corresponding to the candidate slice data.
[0009] In an embodiment of the present application, the slice module is specifically configured to: performing global image deblurring processing on the color conversion image to obtain a deblurred image; performing slice processing on the deblurred image to obtain a plurality of slice image data.
[0010] In an embodiment of the present application, the color conversion module is specifically configured to: performing gray scale processing on a to-be-printed image to obtain a gray scale image corresponding to the to-be-printed image, and taking the gray scale image as the color conversion image.
[0011] In an embodiment of the present application, the color conversion module is specifically configured to: determining a gray scale step according to a gray scale level, and performing gray scale processing on a to-be-printed image according to the gray scale step to obtain a gray scale image corresponding to the to-be-printed image.
[0012] In an embodiment of the present application, the color conversion module is specifically configured to: for each pixel point in the to-be-printed image, performing weighted summation on pixel values of a plurality of color channels of the pixel point to obtain a gray value of the pixel point in the gray scale image.
[0013] In an embodiment of the present application, the sending module is specifically configured to: after sending the first slice image data to the print module, receiving data reception feedback information sent by the print module; if it is determined according to the data reception feedback information that the current data transmission environment is normal, continuing to send other slice image data to the print module.
[0014] In an embodiment of the present application, the sending module is specifically configured to: If it is determined according to the data reception feedback information that the current data transmission environment is abnormal, the first piece of image data is re-sent to the printing module after waiting for a set time length; wherein the current data transmission environment being abnormal includes not receiving the data reception feedback information sent by the printing module.
[0015] In an embodiment of the present application, the sending module is specifically configured to: receiving the check information of the printing module for each piece of image data; if the check information indicates that the transmission of the image data is incorrect, re-sending the image data to the printing module.
[0016] In an embodiment of the present application, the sending module is specifically configured to: performing the image segmentation processing on the color conversion image according to the color channels included in the color conversion image, to obtain a plurality of pieces of image data.
[0017] In an embodiment of the present application, the printing module in the process of printing the color conversion image includes: after printing the color corresponding to the current piece of image data to the photo paper, controlling the photo paper to retreat to the initial position, and taking the next piece of image data as the current piece of image data, returning to execute the step of printing the color corresponding to the current piece of image data to the photo paper until the color corresponding to the last piece of image data is printed.
[0018] According to an aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor executes the executable instructions to enable the electronic device to perform the image printing method in the above technical solutions.
[0019] According to an aspect of an embodiment of the present application, there is provided a computer program product or a computer program, comprising computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the image printing method in the above technical solutions.
[0020] In the technical scheme provided in the embodiments of the present application, the to-be-printed image is converted into a color conversion image for printing, direct printing of the color conversion image is realized, the operation of modifying the image back and forth between multiple different devices is avoided, and the printing efficiency is improved. Secondly, the color conversion image is processed in a fragmentation manner, and the fragmented image data is sent in sequence, so that the printing module can start printing after receiving at least one piece of fragmented image data, without waiting for all data transmission to be completed, the printing start delay is significantly shortened, and the printing efficiency is improved. Thirdly, the fragmentation transmission manner reduces the amount of data transmitted at a time, reduces the requirements for the bandwidth and stability of the transmission link, and greatly reduces the storage and caching requirements of the printing module for complete image data, improves the ability of the printing module to continuously process printing tasks, and is especially suitable for portable printing scenarios.
[0021] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained from these drawings without creative labor for those skilled in the art.
[0023] Figure 1 A schematic diagram of the system architecture to which the technical scheme of the present application is applied is schematically shown.
[0024] Figure 2 A flowchart of the image printing method provided by an embodiment of the present application is schematically shown.
[0025] Figure 3A A schematic diagram of the camera to which the technical scheme of the present application is applied is schematically shown.
[0026] Figure 3B A schematic diagram of the printing module to which the technical scheme of the present application is applied is schematically shown.
[0027] Figure 4A A schematic diagram of the image printing process provided by an embodiment of the present application is schematically shown.
[0028] Figure 4B A schematic diagram of the image printing process provided by an embodiment of the present application is schematically shown.
[0029] Figure 4C A schematic diagram of the image printing process provided by an embodiment of the present application is schematically shown.
[0030] Figure 5 A schematic block diagram of the image printing apparatus provided in an embodiment of this application is shown.
[0031] Figure 6 A schematic diagram of a computer system architecture suitable for implementing the technical solutions of this application is shown. Detailed Implementation
[0032] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0033] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0034] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0035] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0036] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0037] Figure 1 A schematic diagram of the system architecture applying the technical solution of this application is shown.
[0038] like Figure 1 As shown, the system architecture may include an image processing module 110 and a printing module 120. The image processing module 110 may include a smartphone, tablet, laptop, digital camera, instant camera, etc. The printing module 120 may be a DSLR printing module, a mirrorless camera printing module, an instant camera printing module, etc. The image processing module 110 and the printing module 120 are connected for communication to facilitate data transmission.
[0039] In one embodiment of this application, the image processing module 110 and the printing module 120 can be housed in the same device, such as a camera with printing capabilities. In this case, the image processing module 110 and the printing module 120 can be connected via a dedicated communication hardware interface, data signal transmission lines / pins, etc.
[0040] In one embodiment of this application, the image processing module 110 and the printing module 120 may be located in different devices. For example, the image processing module 110 may be a camera, mobile phone, computer, etc., and the printing module 120 may be a dedicated printing device, another camera with printing capabilities, etc. In this case, the image processing module 110 and the printing module 120 can be connected via a network. This network can be a communication medium of various connection types that can provide a communication link, such as a wired communication link or a wireless communication link, such as a USB data cable, Bluetooth, WiFi, NFC, etc.
[0041] The image printing method provided in this application will be described in detail below with reference to specific embodiments.
[0042] Figure 2 A flowchart illustrating an embodiment of the image printing method provided in this application is shown schematically. This method can be performed by, for example... Figure 1 The image processing module 110 shown is implemented as follows. Figure 2 As shown, the image printing method provided in this embodiment includes steps 210 to 230, as detailed below: Step 210: Perform color conversion processing on the image to be printed to obtain the color-converted image corresponding to the image to be printed.
[0043] Specifically, the image to be printed is the image that needs to be printed. It can be a picture taken directly by a camera, a picture stored in the camera, or a picture downloaded from a webpage. The image to be printed can be an RGB format image. Color conversion processing refers to adjusting the color format of the image to be printed, so that the adjusted color format is the color format desired by the user for printing, such as a grayscale image, a CMY three-color printing image, or a CMYK four-color printing image.
[0044] In one embodiment of this application, if the color format to be printed is a grayscale image, then the image to be printed can be converted to grayscale by grayscale processing, that is, the color or multi-channel pixel information of the image to be printed is mapped to a single grayscale value. The grayscale value usually reflects the brightness information of the image, ensuring that the details of the image (such as outlines and contrast) are not lost, so as to realize the grayscale printing of the color image in the future.
[0045] In one embodiment of this application, the grayscale processing includes: for each pixel in the image to be printed, weighted summing of the pixel values of multiple color channels of the pixel to obtain the grayscale value of the pixel in the color-converted image. That is, grayscale processing is performed based on a weighted average method. For example, for an RGB image, the pixel value of a pixel can be represented as (R, B, G), and the corresponding grayscale value of the pixel can be represented as: 0.299×R + 0.587×G + 0.114×B.
[0046] In one embodiment of this application, grayscale processing can also be performed according to the average value method. For example, for an RBG image, the pixel value of a pixel can be represented as (R, B, G), and the grayscale value corresponding to the pixel can be represented as (R+G+B)÷3.
[0047] In one embodiment of this application, grayscale processing can be performed based on the main color of the image to be printed. The main color of the image includes the color that accounts for the largest proportion of the entire image. For example, for an RGB image, if green accounts for more than 50% of the entire image, then green (G) is the main color. During grayscale processing, the main color channel value can be directly used as the grayscale value. Selecting a channel value consistent with the main color of the image as the grayscale value makes the main details in the grayscale image clearer and the contrast stronger.
[0048] For example, for images with a red main subject (such as red roses or red logos), the red channel value is selected as the grayscale value. The red channel captures the brightness of red pixels most accurately, and the extracted light and dark levels of the rose petals (such as the highlights at the edges of the petals and the shadows in the center of the flower) will be preserved more completely, making the red main subject stand out more after printing. As another example, for images with a blue main subject (such as blue sky, blue ocean, or blue product images), the blue channel value is selected as the grayscale value. The blue channel can maximize the presentation of details in the blue areas, avoiding the blue sky being overly darkened or losing details. As yet another example, for images with a green main subject (such as green plants, lawns, or green packaging), the green channel value is selected as the grayscale value. The green channel is most sensitive to the brightness of green, allowing details such as the veins of the leaves and the gradations of light and dark to be clearly reproduced, making the green plants more layered after printing.
[0049] In one embodiment of this application, if the required printing color format is a CMY three-color printing image, the RGB image is first normalized, converting the original pixel values (typically 0-255) of the three RGB channels into decimals of 0-1. Then, based on the complementary color relationship between RGB and CMY, the pixel value of each channel (C / M / Y) is calculated separately. For example, cyan (C) = 1 - normalized red (R), magenta (M) = 1 - normalized green (G), and yellow (Y) = 1 - normalized blue (B).
[0050] In one embodiment of this application, if the required printing color format is a CMYK four-color printing image, the RGB image is first normalized, converting the original pixel values of the three RGB channels into decimals between 0 and 1. Then, the black channel (K) is calculated. This channel represents the darkest color component and is used to replace the impure black produced by mixing the three CMY colors. K = 1 - the maximum value among the normalized RGB values (i.e., max(R,G,B)). Finally, the CMY calculation result is corrected by the K value to avoid color deviation caused by black superposition. For example, C = (1-RK) / (1-K), M = (1-GK) / (1-K), Y = (1-BK) / (1-K), where if K = 1, then C = M = Y = 0.
[0051] Step 220: Perform segmentation processing on the color conversion image to obtain multiple segmented image data.
[0052] Specifically, segmenting a color-converted image refers to splitting the image according to a preset segmentation dimension, thus dividing a complete image into multiple smaller image segments. During segmentation, the rules of complete coverage and no redundancy must be met; that is, all segmented images, after being stitched together, must be completely identical to the original color-converted image, with no missing or duplicate pixels. This allows for faster transmission of the segmented image data to the printing module and avoids timeouts and stuttering issues caused by transmitting large amounts of data at once.
[0053] Optionally, the preset split dimension can be the direction of movement of the printing media or the working direction of the print head to avoid printing splicing errors. The preset split dimension can also be the image width or the image height, for example, splitting by width, with one column in the width direction as one piece of image data; or splitting by height, with one row in the height direction as one piece of image data. The preset split dimension can also be a preset piece image size, for example, a preset piece image size of 10×10 (pixels).
[0054] Optionally, the preset splitting dimension can also be the data volume of the sliced image data. This data volume can be flexibly set according to the buffer size of the printing module. For example, if the printing module has a large buffer, a larger sliced image data volume is set; if the printing module has a small buffer, a smaller sliced image data volume is set. Then, during slicing, each image data that is allocated to the preset sliced image data volume forms a sliced image data. If the data volume of the last sliced image is less than the preset sliced image data volume, the remaining image data volume is directly used as the last sliced image data.
[0055] Step 230: Send multiple slice image data to the printing module in sequence, so that the printing module can start color conversion image printing when it receives at least one slice image data.
[0056] Specifically, the printing module can begin printing upon receiving at least one image segment data, instead of waiting for all image segments to be received. This achieves a "print-as-you-go" effect, improving printing efficiency and avoiding the need for a full reprint due to transmission interruptions, thus enhancing printing reliability. For example, the printing module can begin printing the content of the first image segment data upon receiving it; or, it can begin printing the content of the first image segment data upon receiving the second image segment data.
[0057] In one embodiment of this application, when generating a segmented image data, the segmented image data can be sent to the printing module. After receiving the data, the printing module starts printing. This achieves the effect of "splitting, transmitting, and printing simultaneously," which can shorten the time the printing module waits to receive image data, thereby further improving printing efficiency. Optionally, multiple segmented image data can be generated first, and then each segmented image data can be sent to the printing module sequentially.
[0058] In the technical solution provided in this application embodiment, the image to be printed is converted into a color-converted image for printing, realizing direct printing of color-converted images from color images. This avoids the operation of modifying images back and forth between multiple different devices, improving printing efficiency. Secondly, the color-converted image is processed into segments, and the segmented image data is sent sequentially. This allows the printing module to start printing after receiving at least one segmented image data, without waiting for all data transmission to be completed, significantly shortening the printing start delay and improving printing efficiency. Thirdly, the segmented transmission method reduces the amount of data transmitted in a single transmission, lowers the requirements for transmission link bandwidth and stability, and significantly reduces the printing module's storage and caching requirements for complete image data, improving the printing module's ability to continuously process printing tasks, which is especially suitable for portable printing scenarios.
[0059] Figure 3AA schematic diagram of a camera applying the technical solution of this application is shown. For example... Figure 3A As shown, the camera has a printing module capable of printing images. In this embodiment, the camera uses thermal printing, with thermal paper and a serrated paper outlet for easy tearing. Thermal printing involves contacting a heating element with the thermal paper to print; this method allows for continuous, uninterrupted printing, thus enabling customized printing lengths.
[0060] Figure 3B A schematic diagram of a printing module applying the technical solution of this application is shown. For example... Figure 3B As shown, the printing module includes a pressure plate, heating element, ceramic circuit board, heat sink, connector, IC, and protective resin. The IC represents the control chip, and the protective resin protects it. The connector connects the printing module to other components or connects multiple components within the printing module. The heat sink dissipates heat to reduce the temperature during printing. The ceramic circuit board sets the circuit structure connecting the heating element. The pressure plate compresses the thermal paper to ensure full contact with the heating element. During printing, the printing module outputs a portion of the thermal paper outside the module for each segment of image data printed, resulting in an image of the required length after printing.
[0061] In one embodiment of this application, the control signal for the print head in the printing module is a pulse signal. The pulse width controls the energizing duration of the heating unit in the print head, and the energizing duration determines the energy generated by the heating unit. The amount of energy reflects the color depth printed on the photographic paper. Therefore, grayscale printing can be achieved by controlling the pulse width of the print head control signal. Optionally, the temperature of the heating unit also affects the color printed on the photographic paper. Therefore, grayscale printing can be achieved by controlling both the pulse width of the print head control signal and the temperature of the heating unit.
[0062] For example, assuming that the image is divided according to its width during the slicing process, meaning one or more columns belong to a slice of image data, then the image can be printed using thermal printing. The specific process is as follows: Figure 4A As shown, printing one slice of image data at a time is equivalent to obtaining one column of content in the image. Here, "one column" refers to the width of one slice of image data in the vertical direction, not one column of pixels. Of course, if one slice of image data is the width of one column of pixels, then that "one column" is one column of pixels.
[0063] For example, assuming that the image is divided according to its height during the slicing process, meaning one or more rows belong to a slice of image data, then the image can be printed using thermal printing. The specific process is as follows: Figure 4BAs shown, printing one slice of image data at a time is equivalent to obtaining one line of content in the image. Here, "one line" refers to the width of one slice of image data in the horizontal direction, not a line of pixels. Of course, if one slice of image data is the width of one line of pixels, then that "one line" is one line of pixels.
[0064] In one embodiment of this application, the printing module may use thermal sublimation printing technology, that is, using heat energy to transfer pigments onto thermal sublimation photographic paper, in which case the photographic paper is thermal sublimation paper.
[0065] For example, assuming that during the segmentation process, the image is divided according to a preset segment size, i.e., the image content of a preset height × preset width belongs to one segment image data, then the image can be printed using thermal sublimation printing, the specific process of which is as follows: Figure 4C As shown, printing one slice of image data at a time is equivalent to obtaining one cell of the image.
[0066] In one embodiment of this application, during the grayscale processing in step 210, the grayscale step size can be determined based on the grayscale level, and grayscale processing can be performed on the image to be printed based on the grayscale step size to obtain the color conversion image corresponding to the image to be printed. That is, some grayscale levels can be set for the user to select. Different grayscale levels correspond to different grayscale conversion accuracies. Grayscale conversion accuracy reflects the grayscale levels. The more grayscale levels there are, the more delicate the transition between light and dark in the image, the more accurate the detail reproduction, and the higher the quality of the final printed image. Therefore, the grayscale level actually reflects the image printing accuracy.
[0067] Grayscale step size refers to the target grayscale value interval between two adjacent grayscale levels. Grayscale step size = total number of grayscale values / number of grayscale levels. The number of grayscale levels is also called the grayscale order. For example, if the grayscale value range is 0-255, totaling 256 data points, then if the number of grayscale levels is also 256 (i.e., 256 grayscale levels), the step size = 256 / 256 = 1; if the number of grayscale levels is 16 (i.e., 16 grayscale levels), the step size = 256 / 16 = 16; if the number of grayscale levels is 32 (i.e., 32 grayscale levels), the step size = 256 / 32 = 8. The number of grayscale levels (i.e., the grayscale order) is matched with the grayscale levels, meaning there is a correlation between the two. For example, level 1 can be set to correspond to 16 grayscale levels, level 2 to correspond to 32 grayscale levels, and level 3 to correspond to 64 grayscale levels.
[0068] The grayscale step size is calculated based on the grayscale level selected by the user, and then grayscale processing is performed according to the grayscale step size. Taking 16-level grayscale as an example, the grayscale step size is 16. Then, grayscale values 0~15 are set as target grayscale value 0, grayscale values 16~31 are set as target grayscale value 1, and so on, and grayscale processing is performed.
[0069] In one embodiment of this application, during the segmentation process in step 220, the height of the color conversion image can be adjusted according to the height of the target image, and the width of the color conversion image can be adjusted according to the total number of heating elements in the width direction of the print head in the printing module to obtain an adjusted image; then the adjusted image is segmented to obtain multiple segmented image data.
[0070] In other words, the image processing module scales the image height to the required size (i.e., the target image height) and precisely scales the width to match the physical pixel count of the printhead. For example, if the printhead has 384 heating points (i.e., the number of heating elements), the image width should be scaled to 384 pixels. Adjusting the image width must match the total number of heating elements in the width direction of the printhead to avoid pixel loss or duplicate printing during printing, thereby improving print quality. After adjusting the image's height and width, the adjusted image is then segmented to generate multiple segmented image data, ensuring that the segmented image data is consistent with the adjusted image, and ultimately, the printed image is also consistent with the adjusted image.
[0071] In one embodiment of this application, during the segmentation process in step 220, the color conversion image is segmented to obtain multiple candidate segment data; when generating candidate segment data, image de-shaking processing is performed on the candidate segment data to obtain segment image data corresponding to the candidate segment data.
[0072] In other words, the image processing module first segments the color-converted image, and then performs dithering on each candidate segment. Dithering refers to reducing jitter interference in the candidate segment data, such as pixel offset and edge blurring, to ensure that the details of each segment image are clear and the edges are regular, avoiding misalignment and ghosting during subsequent printing and splicing, which can improve the integrity and accuracy of the final printed image.
[0073] Optionally, the jitter removal process includes position correction, which can specifically extract the edge contours in the candidate segment image represented by the candidate segment data, compare them with the edge contours of the corresponding area in the color conversion image, calculate the offset, and then correct the position of the pixels in the candidate segment image so that the edges are completely aligned with the original image in the color conversion image.
[0074] Optionally, the dithering process includes pixel alignment verification, which can specifically check whether the pixel values at the boundaries of the candidate slice images are consistent with the corresponding positions in the color conversion image. If they are inconsistent, the pixel coordinates are fine-tuned to ensure that the boundaries of all candidate slice images are consistent.
[0075] Optionally, the shaking process includes detail sharpening enhancement, which can specifically enhance the contrast between edge pixels and surrounding pixels in the candidate image (such as blurry leaf veins, by sharpening to make bright areas brighter and dark areas darker) and restore detail clarity.
[0076] Optionally, the shading process may include a combination of the above processes, such as first performing position correction and then sharpening enhancement.
[0077] In one embodiment of this application, during the segmentation process in step 220, the color conversion image can first undergo global image de-jitter processing to obtain a de-jittered image; then, the de-jittered image can be segmented to obtain multiple segmented image data. That is, the image processing module can first perform whole-image de-jitter processing on the color conversion image, and then perform segmentation processing on the de-jittered image. In this way, the independence and adaptability of each segment are guaranteed, while the clarity and positional accuracy of the global de-jitter are fully preserved, thereby improving print quality.
[0078] Optionally, during global image decluttering, the image processing module can first determine the type of jitter present in the color conversion image and then apply appropriate jitter processing. For example, jitter types can be categorized into positional jitter and sharpness jitter. Positional jitter refers to the entire color conversion image being translated (e.g., shifted 3 pixels to the right, 2 pixels down), slightly rotated, or stretched relative to the original image to be printed. In this case, a reference feature point in the image can be found first, and then the offset, rotation angle, or stretching coefficient of the entire image can be calculated based on this reference feature point. This corrects the position of all pixels in the color conversion image, allowing the color conversion image to return to its original reference position, thus completing the decluttering process. Sharpness jitter refers to jitter that changes the image sharpness, such as motion blur (e.g., ghosting), blurred details (e.g., blurred edges after compression of a large image), or low overall contrast. In this case, a deblurring algorithm can be used to restore the ghosting or blurred details, and then a sharpening algorithm can be used to enhance the contrast of global edges and details, uniformly improving the overall image sharpness without local blurred areas, thereby completing the decluttering process. Optionally, the shading process can first perform positional shading, and then perform sharpness shading.
[0079] In one embodiment of this application, during the segmented data transmission process in step 230, after sending the first segmented image data to the printing module, data reception feedback information sent by the printing module is received. If the data reception feedback information indicates that the current data transmission environment is normal, other segmented image data is then sent to the printing module. That is, the image processing module first sends one segmented image data to the printing module, and the printing module returns data reception feedback information, which reflects whether the data transmission environment is normal. If the image processing module receives the data reception feedback information within a set time for sending the segmented image data, it indicates that the data transmission environment is normal. If it fails to receive the data reception feedback information within the set time, or does not receive the data reception feedback information, it indicates that the data transmission environment is abnormal. Alternatively, the data reception feedback information may contain a field indicating whether the data transmission environment is normal, and the normality of the data transmission environment can be determined directly based on this field.
[0080] Only when the data reception feedback indicates that the current data transmission environment is normal will the image processing module continue to send other image fragments to the printing module. This allows potential communication problems to be detected early in the printing task, avoiding the blind continuation of sending large amounts of subsequent data when the data transmission environment is abnormal, thus preventing more invalid data transmission and wasted time.
[0081] In one embodiment of this application, if the current data transmission environment is determined to be abnormal based on data reception feedback information, the first segment of image data is resent to the printing module after a set waiting period. The abnormal data transmission environment includes the failure to receive data reception feedback information from the printing module. That is, if the data transmission environment is abnormal, it may recover on its own after a certain period, such as due to network congestion or grayscale issues. In this case, the segmented image data is resent for image printing. After resending the segmented image data, other segmented image data is only sent to the printing module after confirming that the current data transmission environment is normal. If the current data transmission environment is still abnormal after resending, the waiting period continues and data is resent. A set number of resends can be set. When the set number of resends is reached, it indicates that the data transmission environment has an unrecoverable problem in the short term and is not suitable for continuing data transmission. At this time, the image printing task can be canceled, or a prompt message can be generated, allowing the user to decide whether to continue the image printing task.
[0082] In one embodiment of this application, when transmitting each segment of image data, verification information for each segment of image data can be received from the printing module; if the verification information indicates an error in the transmission of the segment of image data, the segment of image data is resent to the printing module. That is, the verification information is used to determine whether there is an error in the data transmission, and if there is an error, the data is retransmitted to ensure the accuracy of image printing.
[0083] Optionally, when sending data, the image processing module uses a specific verification algorithm to generate sender verification data for each image data segment (e.g., performing a hash calculation on the image data segments), and packages the sender verification data along with the image data segments before sending it to the printing module. Upon receiving data, the printing module uses the same verification algorithm to calculate the receiver verification data, and then compares the receiver verification data with the sender verification data. If they match, the verification is successful and the data is error-free; if they do not match, the verification fails and the data transmission is incorrect.
[0084] Optionally, when sending data, the image processing module can also send the data identifier of the segmented image data together. The printing module feeds back the data identifier and the verification result as verification information to the image processing module, so that the image processing module can determine which segmented image data transmission has an error and which segmented image data transmission has no error.
[0085] When a data transmission error occurs, the image processing module retransmits the corresponding image fragment data to the printing module. In this way, only the data fragment data needs to be retransmitted, without the need to retransmit the entire image data, reducing data transmission overhead and saving retransmission time.
[0086] In one embodiment of this application, during the slicing process in step 220, if the color conversion image is a CMY image or a CMYK image, the color conversion image can be sliced according to the color channels included in the color conversion image to obtain multiple sliced image data. Each sliced image data corresponds to one color channel, representing a color. For example, slicing a CMY image yields C-channel sliced image data, M-channel sliced image data, and Y-channel sliced image data; slicing a CMYK image yields C-channel sliced image data, M-channel sliced image data, Y-channel sliced image data, and K-channel color data.
[0087] In one embodiment of this application, if the segmentation processing in step 220 is performed on color channels, then the printing process of the printing module in step 230 includes: printing the color corresponding to the current segmented image data onto the photographic paper, controlling the photographic paper to retract to the initial position, and using the next allocated image data as the current segmented image data, returning to execute the step of printing the color corresponding to the current segmented image data onto the photographic paper, until the color corresponding to the last segmented image data is printed. That is, the printing module performs backtracking printing for each segmented image data. Each time a segmented image data is printed, the photographic paper needs to be retracted to the initial position, and the colors corresponding to these segmented image data are printed onto the photographic paper step by step according to the receiving order of the segmented image data, finally obtaining a complete printed image. For example, when printing a CMY image, if the receiving order of the segmented image data is C, M, Y, then the printing module first prints the C channel segmented image data, forming cyan (C) on the photographic paper; then the photographic paper is returned to its initial position, which is the position of the photographic paper when the C channel segmented image data starts printing; next, it continues to print the M channel segmented image data, continuing to form magenta (M) on the photographic paper that already has cyan (C); then the photographic paper is returned to its initial position, which is the position of the photographic paper when the C / M channel segmented image data starts printing; next, it continues to print the Y channel segmented image data, continuing to form yellow (Y) on the photographic paper that already has cyan (C) and magenta (M). At this point, all the segmented image data has been printed, resulting in a printed image including the three colors CMY.
[0088] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0089] The following describes an apparatus embodiment of this application, which can be used to perform the image printing method described in the above embodiments of this application. Figure 5 A schematic block diagram of the image printing apparatus provided in an embodiment of this application is shown. Figure 5 As shown, the image printing apparatus provided in this application embodiment includes: The color conversion module 510 is used to perform color conversion processing on the image to be printed in order to obtain the color conversion image corresponding to the image to be printed. The segmentation module 520 is used to segment the color conversion image to obtain multiple segmented image data. The sending module 530 is used to send multiple sliced image data to the printing module in sequence, so that the printing module can start color conversion image printing when it receives at least one sliced image data.
[0090] In one embodiment of this application, the sharding module 520 is specifically used for: The height of the color conversion image is adjusted according to the height of the target image, and the width of the color conversion image is adjusted according to the total number of heating elements in the width direction of the print head in the printing module, to obtain an adjusted image; The adjusted image is segmented to obtain multiple segmented image data.
[0091] In one embodiment of this application, the sharding module 520 is specifically used for: The color-converted image is segmented to obtain multiple candidate segment data; When generating the candidate segment data, image denoising processing is performed on the candidate segment data to obtain the segment image data corresponding to the candidate segment data.
[0092] In one embodiment of this application, the sharding module 520 is specifically used for: The color conversion image is subjected to global image de-jitter processing to obtain a de-jittered image; The shaky image is segmented to obtain multiple segmented image data.
[0093] In one embodiment of this application, the color conversion module 510 is specifically used for: The image to be printed is subjected to grayscale processing to obtain a grayscale image corresponding to the image to be printed, and the grayscale image is used as the color conversion image.
[0094] In one embodiment of this application, the color conversion module 510 is specifically used for: The grayscale step size is determined based on the grayscale level, and grayscale processing is performed on the image to be printed based on the grayscale step size to obtain the grayscale image corresponding to the image to be printed.
[0095] In one embodiment of this application, the color conversion module 510 is specifically used for: For each pixel in the image to be printed, the pixel values of multiple color channels of the pixel are weighted and summed to obtain the grayscale value of the pixel in the grayscale image.
[0096] In one embodiment of this application, the sending module 530 is specifically used for: After sending the first segmented image data to the printing module, the system receives data reception feedback information sent by the printing module. If the data reception feedback information determines that the current data transmission environment is normal, then the remaining image fragments will continue to be sent to the printing module.
[0097] In one embodiment of this application, the sending module 530 is specifically used for: If the current data transmission environment is determined to be abnormal based on the data reception feedback information, the first segmented image data will be resent to the printing module after a set waiting period; wherein, the abnormal current data transmission environment includes not receiving the data reception feedback information sent by the printing module.
[0098] In one embodiment of this application, the sending module 530 is specifically used for: Receive the verification information from the printing module for each of the image fragments; If the verification information indicates an error in the transmission of the segmented image data, the segmented image data is resent to the printing module.
[0099] In one embodiment of this application, the sharding module 520 is specifically used for: The color conversion image is segmented according to the color channels included in the color conversion image to obtain multiple segmented image data.
[0100] In one embodiment of this application, the printing module performs the process of printing a color-converted image, including: After printing the color corresponding to the current segment of image data onto the photographic paper, the photographic paper is controlled to return to its initial position, and the next allocated image data is used as the current segment of image data. The process of printing the color corresponding to the current segment of image data onto the photographic paper is then repeated until the color corresponding to the last segment of image data has been printed. The specific details of the image printing apparatus provided in the various embodiments of this application have been described in detail in the corresponding method embodiments applied to the printing module, and will not be repeated here.
[0101] Figure 6 A schematic diagram of the computer system architecture used to implement the technical solution of this application is shown.
[0102] It should be noted that, Figure 6 The computer system 600 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0103] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM). The RAM 603 also stores various programs and data required for system operation. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output interface 605 (I / O interface) is also connected to the bus 604.
[0104] The following components are connected to the input / output interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a local area network card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0105] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit 601, it performs various functions defined in the system of this application.
[0106] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0107] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0108] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0109] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0110] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0111] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. An image printing method characterized by, The method comprises the following steps: color conversion processing is performed on a to-be-printed image to obtain a color conversion image corresponding to the to-be-printed image; the color conversion image is divided into multiple pieces to obtain multiple piece image data; the multiple piece image data are sequentially sent to a printing module, so that the printing module starts to print the color conversion image when at least one piece of the piece image data is received.
2. The image printing method according to claim 1, characterized by, The method comprises the following steps: The height of the color conversion image is adjusted according to the target image height, and the width of the color conversion image is adjusted according to the total number of heating elements in the width direction of the print head in the printing module to obtain an adjusted image; the adjusted image is divided into multiple pieces to obtain multiple piece image data.
3. The image printing method according to claim 1, characterized by, The method comprises the following steps: The color conversion image is divided into multiple pieces to obtain multiple candidate piece data; image deblurring processing is performed on the candidate piece data to obtain piece image data corresponding to the candidate piece data when the candidate piece data is generated.
4. The image printing method according to claim 1, characterized by, The method comprises the following steps: global image deblurring processing is performed on the color conversion image to obtain a deblurred image; the deblurred image is divided into multiple pieces to obtain multiple piece image data.
5. The image printing method according to claim 1, wherein The method comprises the following steps: gray scale processing is performed on the to-be-printed image to obtain a gray scale image corresponding to the to-be-printed image, and the gray scale image is taken as the color conversion image.
6. The image printing method according to claim 5, wherein The method comprises the following steps: The gray scale step is determined according to the gray scale level, and the to-be-printed image is processed according to the gray scale step to obtain a gray scale image corresponding to the to-be-printed image.
7. The image printing method according to claim 5, wherein The method comprises the following steps: For each pixel point in the to-be-printed image, the pixel values of multiple color channels of the pixel point are weighted and summed to obtain a gray value of the pixel point in the gray scale image.
8. The image printing method according to claim 1, wherein The method comprises the following steps: after the first piece of the piece image data is sent to the printing module, data reception feedback information sent by the printing module is received; if it is determined according to the data reception feedback information that the current data transmission environment is normal, the other piece image data is continuously sent to the printing module.
9. The image printing method according to claim 8, characterized by, The method further comprises the following steps: if it is determined according to the data reception feedback information that the current data transmission environment is abnormal, the first piece of the piece image data is re-sent to the printing module after waiting for a set time; wherein the current data transmission environment being abnormal includes not receiving the data reception feedback information sent by the printing module.
10. The image printing method according to claim 1, characterized by, The method comprises the following steps: receiving check information of the print module for each of the piece image data; if the check information indicates that the transmission of the piece image data is incorrect, re-sending the piece image data to the print module.
11. The image printing method according to claim 1, wherein performing piece processing on the color conversion image to obtain a plurality of piece image data, including: performing piece processing on the color conversion image according to the color channels included in the color conversion image to obtain a plurality of piece image data.
12. The image printing method according to claim 11, wherein the print module in the process of color conversion image printing, including: after printing the color corresponding to the current piece image data to the photo paper, controlling the photo paper to retreat to the initial position, and taking the next piece image data as the current piece image data, returning to execute the step of printing the color corresponding to the current piece image data to the photo paper until the color corresponding to the last piece image data is printed.
13. An image printing apparatus characterized by comprising: including: a color conversion module, configured to perform color conversion processing on a to-be-printed image to obtain a color conversion image corresponding to the to-be-printed image; a piece module, configured to perform piece processing on the color conversion image to obtain a plurality of piece image data; a sending module, configured to send the plurality of piece image data to a print module in sequence, so that the print module starts color conversion image printing after receiving at least one of the piece image data.
14. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the image printing method of any one of claims 1-12.
15. An electronic device, comprising: including: a processor; and a memory for storing executable instructions of the processor; wherein the processor executes the executable instructions to enable the electronic device to perform the image printing method of any one of claims 1-12.
16. A computer program product, characterised in that, The computer program product includes computer instructions stored in a computer readable storage medium; the processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the image printing method of any one of claims 1-12.