Color enhancement method and device for restoring picture from PRN file and storage medium
By analyzing PRN files and applying image conversion and deep learning technology, the color distortion and noise problems in the restored image of PRN files are solved, high-quality color enhancement and noise removal are achieved, and image processing ability and user experience are improved.
Patent Information
- Application Number
- CN202411171126.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-23
AI Technical Summary
Images restored directly from PRN files are caused by color distortion, salt and pepper noise and insufficient contrast, which affect image quality and processing possibilities.
By analyzing PRN files, image conversion, gamma change, data normalization, and noise removal algorithms are applied, combined with deep learning technology, the image is enhanced and noise suppressed, and converted into JPG or PNG files in RGB color space.
It significantly improves the visual effect of the image and improves the image quality, so that the restored image of the PRN file is close to the original image level, reduces the difficulty of operation, and improves user experience and production efficiency.
Smart Images

Figure CN119130844A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to digital image processing technology, in particular to a color enhancement method, device and storage medium for restoring a picture from a PRN file. Background Art
[0002] The invention discloses a method and system for significantly improving the image quality of an image restored from a (Printer Ready) file by using color enhancement and noise removal techniques. As a printer control file, a PRN file contains printing instructions for image data. However, in practical applications, images directly restored from a PRN file often suffer from color distortion and a large number of salt and pepper noise points on the restored image, resulting in color deviation, insufficient contrast, and noise interference, which affects the use effect of the image and the possibility of further processing. The present invention aims to solve the above problems by establishing a new image processing algorithm, so that the quality of the restored image is close to or reaches the level of the original image. Summary of the invention
[0003] In response to the problems existing in the above-mentioned background technology, the present invention proposes a color enhancement method, device and storage medium for restoring pictures from PRN files. By parsing the PRN files, the image data can be efficiently restored, and on this basis, advanced color correction, enhancement technology and noise suppression algorithms are applied to significantly improve the visual effect of the restored image and enhance the image quality.
[0004] The color enhancement method for restoring an image from a PRN file includes the following steps:
[0005] S1, acquire the image, read and store the PRN file that needs to be restored;
[0006] S2, image conversion, based on the image obtained in S1, converts the image into a floating point type through image analysis to obtain a floating point data packet after the image is converted into data;
[0007] S3, color enhancement, based on the floating point data packet obtained in S2, performs gamma change on each floating point type RGB data of the data packet to obtain the RGB data after gamma change;
[0008] S4, data normalization, based on the RGB data obtained in S3, normalize the RGB data to 0-255, and obtain the normalized RGB data;
[0009] S5, image conversion, based on the RGB data obtained in S4 after normalization, convert the floating point type image into an 8-bit image to obtain an image;
[0010] S6, noise removal, based on the image obtained in S5, performs Gaussian filtering on the entire image to remove salt and pepper noise while preserving the original texture of the image, and finally obtains an image with noise removed and color enhanced.
[0011] In the step S1, the user uploads the PRN file to be processed through the GUI, and the system starts the PRN file parsing module to read the file and extract image data.
[0012] In the step S1, the file source of the PRN file to be restored is obtained, it is determined whether the color space of the PRN file belongs to RGB or YMCK, and the determination result is saved.
[0013] In step S2, the image is converted into a floating point type according to the judgment result. If the judgment result is RGB, it is converted into a floating point type of RBG. If the judgment result is YMCK, it is first converted into YMCK, and each pixel in the YMCK color mode is converted into the corresponding pixel in the RGB color mode.
[0014] In step S3, the basic formula of the gamma change is: Output = Input^Gamma, where Input is the original RGB component value, which ranges from 0 to 1, Gamma is the gamma value, which ranges from 1.8 to 2.2, and Output is the RGB component value after gamma change.
[0015] In step S5, the floating point image is converted into an 8-bit image, and the conversion formula is output_pixel=round((input_pixel-min_val)*255 / (max_val-min_val)), and the values less than 0 in the floating point image are set to 0, and the values greater than 1 are set to 1, and then multiplied by 255 and converted to 8-bit data type.
[0016] A device for restoring color enhancement of an image from a PRN file includes a processor, a memory, and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the method steps for converting the prepress PRN file into a previewable image are implemented.
[0017] A storage medium stores computer program instructions, which, when executed by a processor, implement the method steps for converting the prepress prn file into a previewable image.
[0018] The beneficial effects of the present invention are:
[0019] The present invention solves the problems that images directly restored from PRN files often have color deviation, insufficient contrast and noise interference due to color distortion and a large number of salt and pepper noise points on the restored images; it realizes that PRN files can be directly restored to picture files such as JPG or PNG in RGB color space, making the pictures more processable and facilitating users to process images in PRN files.
[0020] In summary, this method effectively solves the technical complexity, compatibility issues and image quality loss problems in the PRN file conversion process through automated and precise color conversion, which not only improves production efficiency and reduces operational difficulty, but also greatly improves user experience, making the entire process from design to printing smoother and more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of the color enhancement method for restoring a picture from a PRN file according to the present invention. DETAILED DESCRIPTION
[0022] In order to further explain the technical means and effects taken by the present invention to achieve the predetermined invention purpose, exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of methods and systems consistent with some aspects of the present application as detailed in the attached claims.
[0023] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0024] The specific implementation methods, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0025] Example 1
[0026] S1, obtain an image, read and store the PRN file to be restored. Specifically, read the PRN file to be restored through the GUI system, read and save the file into the conversion module, and determine whether the color space of the PRN file belongs to RGB or YMCK by obtaining the file source of the PRN file to be restored, and save the determination result. In the printer file, the PRN file includes not only image information but also printing instructions and other information. In addition to reading the image information of the PRN file, the conversion module also needs to read the printing information of the PRN file, so as to determine the type of the printer where the PRN file is located, and finally determine whether the printing color space of the printer belongs to RGB or YMCK.
[0027] S2, image conversion, based on the image obtained in S1, the image is converted into a floating point type through image analysis to obtain a floating point data packet after the image is digitized. The PRN file read is converted into a floating point data packet through a related algorithm, and the data packet is saved. After the judgment result in S1, the image is converted into a floating point type. If the judgment result is RGB, it is converted into a floating point type of RBG. If the judgment result is YMCK, it is first converted into YMCK, and each pixel in the YMCK color mode is converted into the corresponding pixel in the RGB color mode;
[0028] S3, color enhancement, based on the floating point data packet obtained in S2, performs gamma change on each floating point type RGB data of the data packet to obtain the RGB data after gamma change, and the basic formula of the gamma change is: Output = Input^Gamma, where Input is the original RGB component value, which ranges from 0 to 1, Gamma is the gamma value, which ranges from 1.8 to 2.2, and Output is the RGB component value after gamma change;
[0029] S4, data normalization, based on the RGB data obtained in S3, normalize the RGB data to 0-255, and obtain the normalized RGB data;
[0030] S5, image conversion, based on the RGB data obtained in S4 after the data normalization, convert the floating point type image into an 8-bit image, and convert the floating point type image into an 8-bit image, and the conversion formula is output_pixel = round ((input_pixel-min_val)*255 / (max_val-min_val)), and set the value less than 0 in the floating point image to 0, and the value greater than 1 to 1, and then multiply it by 255 and convert it to 8-bit data type;
[0031] S6, noise removal, based on the image obtained in S5, performs Gaussian filtering on the entire image to remove salt and pepper noise while preserving the original texture of the image, and finally obtains an image with noise removed and color enhanced.
[0032] In the step S1, the user uploads the PRN file to be processed through the GUI, and the system starts the PRN file parsing module to read the file and extract image data.
[0033] A device for color enhancement of images restored from PRN files includes a processor, a memory, and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the method steps for converting the prepress PRN file into a previewable image are implemented.
[0034] A storage medium stores computer program instructions, which, when executed by a processor, implement the method steps for converting the prepress prn file into a previewable image.
[0035] This embodiment solves the problems of color deviation, insufficient contrast and noise interference caused by color distortion and a large amount of salt and pepper noise on the restored image caused by images restored directly from PRN files; it realizes that PRN files can be directly restored to picture files such as JPG or PNG in RGB color space, making the pictures more processable and facilitating users to process images in PRN files.
[0036] Example 2
[0037] In order to solve the problem of visual color difference, this embodiment adds a method and steps of color contrast and correction, as follows:
[0038] S1, acquiring an image, and reading and storing a PRN file to be restored through a first image processing software;
[0039] S2, opening the acquired image file on the second image processing software and taking a screenshot, saving the screenshot, taking a screenshot of the PRN file and saving the screenshot in the PRN file reading, directly reading the color information of the screenshot, and expressing the color information in the form of RGB or CMYK;
[0040] S3, first image conversion, based on the image obtained in S1, convert the image into a floating point type through image analysis to obtain a first floating point data packet after the image is converted into data;
[0041] S4, for the second time, based on the image acquired in S2, the image is converted into a floating point type through image analysis to obtain a second floating point data packet after the image is converted into data;
[0042] S5, merging the first floating point data packet and the second floating point data packet, and obtaining floating point data after visual color difference is balanced by calculating the average value;
[0043] S5, color enhancement, based on the floating point data packet obtained in S5, performs gamma change on each floating point type RGB data of the data packet to obtain the RGB data after gamma change;
[0044] S4, data normalization, based on the RGB data obtained in S3, normalize the RGB data to 0-255, and obtain the normalized RGB data;
[0045] S5, image conversion, based on the RGB data obtained in S4 after normalization, convert the floating point type image into an 8-bit image to obtain an image;
[0046] S6, noise removal, based on the image obtained in S5, performs Gaussian filtering on the entire image to remove salt and pepper noise while preserving the original texture of the image, and finally obtains an image with noise removed and color enhanced.
[0047] A device for color enhancement of images restored from PRN files includes a processor, a memory, and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the method steps for converting the prepress PRN file into a previewable image are implemented.
[0048] A storage medium stores computer program instructions, which, when executed by a processor, implement the method steps for converting the prepress prn file into a previewable image.
[0049] Example 3
[0050] A method for color enhancement of a picture restored from a PRN file, in which a deep neural network is used to learn the mapping relationship of the PRN file restoration picture based on deep learning, thereby realizing effective PRN file restoration picture.
[0051] A convolutional neural network (CNN) is established, which consists of a convolutional layer, a pooling layer, and a fully connected layer. The features of the image are extracted through convolution operations, and then the features of the PRN file restoration image are gradually learned to realize the PRN file restoration image.
[0052] Generative adversarial network, including generator and discriminator.
[0053] The generator generates realistic PRN file restoration images, and the discriminator determines whether the input image is a real clean image or an image generated by the generator, and the two are trained in adversarial manner.
[0054] For example, the Noise2Noise method uses a GAN architecture to restore images without a clean image as a reference.
[0055] And generate the next level of adversarial network for image color enhancement and image denoising.
[0056] When training these deep neural networks, a large number of noisy images and corresponding clean image pairs are usually required as datasets. Common datasets include BSD68, Set12, etc.
[0057] In order to improve the denoising effect, some technologies are also used, such as:
[0058] Residual learning: Let the network learn the residual of noisy images and clean images instead of directly learning clean images.
[0059] Multi-scale learning: image features at different scales are processed simultaneously to better capture noise patterns.
[0060] Adversarial Network for Image Color Enhancement Based on Deep Learning
[0061] Principle: It consists of a generator and a discriminator. The generator generates color-enhanced images, and the discriminator determines whether the generated images are realistic and the color enhancement effect is good. Through adversarial training, the generator continuously improves its output to generate more realistic and colorful images.
[0062] For example, CycleGAN can perform style transfer and color enhancement without paired training data.
[0063] The mapping relationship of color enhancement can be learned by designing a deep convolutional neural network.
[0064] For example, multiple convolutional layers and non-linear activation functions are used to extract image features and adjust color channels.
[0065] The autoencoder compresses the input image into a low-dimensional representation, and the decoder performs color enhancement when reconstructing the image.
[0066] The introduction of the attention mechanism enables the network to focus on important areas in the image, thereby performing color enhancement more specifically.
[0067] Multimodal learning combines information from multiple image modalities, such as brightness, saturation, hue, etc., to perform more comprehensive color enhancement.
[0068] In practical applications, multiple techniques are often combined to improve the effect of color enhancement. For example, a pre-trained convolutional neural network is used to extract features, and then these features are input into a generative adversarial network for color enhancement.
[0069] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A color enhancement method for restoring a picture from a PRN file, characterized in that: The steps include: S1, acquire the image, read and store the PRN file that needs to be restored; S2, image conversion, based on the image obtained in S1, converts the image into a floating point type through image analysis to obtain a floating point data packet after the image is converted into data; S3, color enhancement, based on the floating point data packet obtained in S2, performs gamma change on each floating point type RGB data of the data packet to obtain the RGB data after gamma change; S4, data normalization, based on the RGB data obtained in S3, normalize the RGB data to 0-255, and obtain the normalized RGB data; S5, image conversion, based on the RGB data obtained in S4 after normalization, convert the floating point type image into an 8-bit image to obtain an image; S6, noise removal, based on the image obtained in S5, performs Gaussian filtering on the entire image to remove salt and pepper noise while preserving the original texture of the image, and finally obtains an image with noise removed and color enhanced.
2. The color enhancement method for restoring a picture from a PRN file according to claim 1, characterized in that: In the step S1, the user uploads the PRN file to be processed through the GUI, and the system starts the PRN file parsing module to read the file and extract image data.
3. The color enhancement method for restoring a picture from a PRN file according to claim 1, characterized in that: In the step S1, the file source of the PRN file to be restored is obtained, it is determined whether the color space of the PRN file belongs to RGB or YMCK, and the determination result is saved.
4. The color enhancement method for restoring a picture from a PRN file according to claim 1, characterized in that: In step S2, the image is converted into a floating point type according to the judgment result. If the judgment result is RGB, it is converted into a floating point type of RBG. If the judgment result is YMCK, it is first converted into YMCK, and each pixel in the YMCK color mode is converted into a corresponding pixel in the RGB color mode.
5. The color enhancement method for restoring a picture from a PRN file according to claim 1, characterized in that: In step S3, the basic formula of the gamma change is: Output = Input^Gamma, where Input is the original RGB component value, which ranges from 0 to 1, Gamma is the gamma value, which ranges from 1.8 to 2.2, and Output is the RGB component value after gamma change.
6. The color enhancement method for restoring a picture from a PRN file according to claim 1, characterized in that: In step S5, the floating point image is converted into an 8-bit image, and the conversion formula is output_pixel=round((input_pixel-min_val)*255 / (max_val-min_val)), and the values less than 0 in the floating point image are set to 0, and the values greater than 1 are set to 1, and then multiplied by 255 and converted to 8-bit data type.
7. A device for restoring color enhancement of an image from a PRN file, comprising a processor, a memory, and computer program instructions stored in the memory, wherein when the computer program instructions are executed by the processor, the method described in any one of claims 1 to 6 is implemented.
8. A storage medium having computer program instructions stored thereon, which implement the method according to any one of claims 1 to 6 when the computer program instructions are executed by a processor.
Citation Information
Patent Citations
Image color enhancement method and device, and electronic equipment
CN104935902A
Saturation enhancement method and device and computer readable storage medium
CN111147837A
Apparatus and Method for Decoding Extended Color Space Data
US20090167955A1
Noise synthesis for digital images
US20230050950A1
Vehicle detection method based on clustering algorithm
WO2023108933A1
