Background technology
All figures, image, the literal object of forming the page are referred to as Drawing Object.Page-describing is the set of Drawing Object, and the describing method of Drawing Object is divided into color separation (Separated) and covers look (Composite) two kinds.All Drawing Objects are being a color value that need specify in now under the given color space on the page.In most of color spaces, color value is made up of a plurality of color components, for example: white R=255 in red, green, blue (being called for short RGB) color space, G=255, B=255 represents, and white is expressed as C=0, M=0 in green grass or young crops, product, Huang, black (being called for short CMYK) color space, Y=0, K=0.So-called color separation page description refers to be deposited in each color part of the Drawing Object in the same logical page (LPAGE) in a plurality of Physical Page in the mode of gray scale Drawing Object.Deposit in the same Physical Page in the mode of color graphics object and cover all colours part that the look page-describing refers to the Drawing Object in the same logical page (LPAGE).
Fig. 1 represents a logical page (LPAGE), also is the page result who covers the look page-describing accordingly simultaneously.The illiteracy look page-describing of a logical page (LPAGE) has only a Physical Page.
Fig. 2 to Fig. 5 represents logical page (LPAGE) shown in Figure 1 color separation page description result under the CMYK color space.It has four Physical Page, respectively blue or green (Cyan), product (Magenta), yellow (Yellow), black (Black) four color parts in the presentation logic page or leaf.
If the color space of output does not change in real work, the rasterization process of color separation page description file does not rely on raster image processor (Raster Image Processor fully so, be called for short RIP) inner color space conversion ability and double exposure processing power, so just can access reliable and stable color output result and double exposure effect, so color separation page description is widely used in (Prepress) field before the seal both domestic and external.
The rasterization process of color separation page description, known method is at present: be the least unit of rasterisation and output with the Physical Page.For example, if the color separation page description of the page shown in Figure 1 outputs on the black-and-white printer, the result will be that four images of Fig. 2 to Fig. 5 print to respectively on the print media so, form four pages.The shortcoming of this method is: this color separation way of output makes the user can't understand the content of full page intuitively, so and be not suitable for some application, for example: proof, promptly check the page, this moment, the result that wishes of user was as Fig. 6, and just the color value of each Drawing Object is converted into the result of imaging behind the gray-scale value.
When needing gray scale output as a result if the user need understand the content of full page intuitively, unique way is to be forced to regenerate cover the look page description file at present, and then carries out grey scale grating, driving printer output.But this way also has shortcoming, and promptly when the Drawing Object double exposure of the page, it is incorrect to cover the look output effect, as Fig. 8 to shown in Figure 10.
In the prior art, also do not relate to the disposal route of color separation page description grey scale grating at present, do not find that any product provides this function yet.
Summary of the invention
At the defective that exists in the prior art, the objective of the invention is: the method that proposes a kind of color separation page description grey scale grating, can make the user understand the content of full page intuitively when color separation page description grey scale grating, the while can be reflected the double exposure effect of Drawing Object very exactly.
For reaching above purpose, the technical solution used in the present invention is: a kind of method of color separation page description grey scale grating may further comprise the steps:
(1) logical page (LPAGE) identification, Physical Page rasterisation: input color separation page description, at first determine the color attribute of current Physical Page and affiliated logical page (LPAGE) according to the colorant information in the color separation page description, then Physical Page is rasterized into the image gray data, the grey-scale raster images data of exporting Physical Page at last with and logical page (LPAGE) and color attribute;
(2) color is synthetic: find all grey-scale raster images data that belong to same logical page (LPAGE), then in conjunction with the synthetic chromatic grating data of its color attribute;
(3) colour changes gray scale: the chromatic grating data-switching after step (2) is synthesized becomes the gray scale raster data, finishes the grey scale grating of color separation page description.
Further, has better effect: add processing when color is synthetic in step (2), make that final gray scale output result and print result are more approaching to special look for making the present invention.
Further, has better effect for making the present invention: in step (3), the chromatic grating data are carried out color correction earlier, and then convert the gray scale raster data to.Add colour correction (abbreviation color correction) link two purposes arranged: make that final gray scale output result is more accurate on color, with make final gray scale output result on color and illiteracy look page-describing visually reach consistent.The most frequently used color calibrating method is the color calibrating method that international color consortium is recommended, and is called for short the ICC color correction.
Further, in step 3, utilize a multidimensional lookup table to carry out interpolation calculation, finish color correction process and the colored gray scale process of changeing simultaneously.This method not only can reach the effect of color correction, and can also improve the speed of processing greatly.
Effect of the present invention is: the user can understand the content of full page intuitively when color separation page description grey scale grating, simultaneously can also simulate the double exposure effect of Drawing Object in the page well, but also can so that the color separation page description of the same page and Meng Se page-describing when gray scale is exported visually color be consistent.
Embodiment
Below in conjunction with description of drawings, the invention will be further described:
As shown in Figure 7, a kind of method of color separation page description grey scale grating may further comprise the steps:
(1) logical page (LPAGE) identification, Physical Page rasterisation: input color separation page description, at first determine the color attribute of current Physical Page and affiliated logical page (LPAGE) according to the colorant in the color separation page description (Colorant) information and other accessory informations, this is owing to the Drawing Object of each Physical Page in color separation is described is all described with gray scale, then Physical Page is generated and is rasterized into the image gray data, the output of this processing procedure be Physical Page the raster image data with and logical page (LPAGE) and color attribute;
Here color attribute have two kinds may: the one, the processing look the CMYK color space under promptly is green grass or young crops, product, Huang, in deceiving one; The 2nd, non-processing look, promptly special look, need obtain its alternative look information under the CMYK color space this moment.
(2) color is synthetic: find all raster image data that belong to same logical page (LPAGE), then in conjunction with its color attribute combined color image data.For non-special color image, be example with the CYMK color space, false coordinate (x, y) locate, the pixel value of cyan image be C (x, y), the pixel value of product color image is M (x, y), the pixel value of yellow image be Y (x, y), the pixel value of black image is K (x, y), so synthetic back coloured image (x, the pixel value of y) locating is:
(C(x,y),M(x,y),Y(x,y),K(x,y))
Wherein, and 0<=C (x, y), M (x, y), y (x, y), K (x, y)<=1.
Because when color separation page description generated, the effect of double exposure was processed, so the simple synthetic effect that just can reflect page double exposure exactly of color separation dot matrix.
(3) colour changes gray scale, and the chromatic grating data-switching after step (2) is synthesized becomes the gray scale raster data, and the conversion formula that adopts in the present embodiment is as follows: supposition coordinate (x, y) the pixel value of locating after synthetic is (c, m, y, k), so the conversion after gray scale raster data G be
G(x,y)=1.0-F(k+0.3×c+0.59×m+0.11×y),
Wherein, if F (x)=x wherein is 0<=x<=1; If F (x)=1 is x>1.Note gray-scale value 0 expression black this moment.
Above-mentioned disposal route has been ignored special look information fully.This disposal route for scarcely comprise special look information or specially the look information page seldom be acceptable.But the special look information of some page can not be ignored, and we need add the synthetic processing links of color of special look in above-mentioned steps 2 for this reason.Disposal route is as follows:
For special color image, the effect that contains the color separation page description grey scale grating output of special look for acquisition correctly, can in the color building-up process, add special look processing links, if the color attribute of certain gray scale dot array data is the special look of handling outside the look, should at first find the processing of this special look to substitute look so, for example: under the CMYK color space, specially the look redness is expressed as (C=0, M=100, Y=100, K=100), and then and the gray-scale value of each pixel multiply each other, last result is added on the respective pixel of coloured image.The final output result of this processing is that color space is generally the color image data under the CMYK color space.Computing method are as follows:
Suppose original coordinate (x, y) locate the special look pixel value before merging for (C (and x, y), M (x, y), Y (x, y), K (x, y)); (x, the grey scale pixel value of y) locating are g to coordinate, 0<g<1 on special color image; The alternative look of this special look be (c, m, y, k), 0<=c wherein, m, y, k<=1, merge so the back image coordinate (x, y) locate the pixel value and be: (F (C (x, y)+c * g), F (M (x, y)+m * g), F (Y (x, y)+y * g), F (K (x, y)+k * g))
If F (x)=x wherein is 0<=x<=1; If F (x)=1 is x>1.
Same, the transparent effect when specially the look synthesis step has been simulated special look double exposure has well been eradicated the problem that look is printed special secondary school look double exposure of covering.
For making the present invention have better effect: in step (3), can carry out color correction earlier, and then convert the gray scale raster data to the chromatic grating data.Add colour correction (abbreviation color correction) link two purposes are arranged: make that final gray scale output result is more accurate on color, and make final gray scale output result on color and cover the result that the look page description grey scale exports and visually reach consistent.The most frequently used color calibrating method is the color calibrating method that international color consortium is recommended, and is called for short the ICC color correction.
ICC color correction specific implementation method is as follows:
1) each color of pixel value (y k) carries out the ICC color correction for c, m, obtain a new color value (c1, m1, y1, k1)
2) then (y1 k1) carries out the colored conversion of changeing gray scale for c1, m1, and the description in the above-mentioned steps (3) is seen in concrete operations.
Though the ICC color correction can obtain color simulation effect preferably,, make that the processing speed of above-mentioned steps 3 is slack-off owing to added the link of ICC color correction.We propose a kind of new disposal route for this reason: utilize a multidimensional lookup table to carry out interpolation calculation, finish color correction process and the colored gray scale process of changeing simultaneously.This method not only can reach the effect of color correction, and the speed of the processing that improves greatly.
The formation of multidimensional lookup table at first is described: we suppose (c, m, y, k), 0<=c wherein, m, y, k<=1, constituted a unit cube of four-dimentional space, we are divided into n part to every limit of this unit cube, have promptly obtained n+1 sampled point, so just this unit cube have been divided into n * n * n * impartial small cubes of n size.These cubes have (n+1) * (n+1) * (n+1) * (n+1) individual summit.These summits are: (k1/n, k2/n, k3/n, k4/n), 0<=k<=n wherein.We will preestablish the gray-scale value after these color value conversions, and these color values are saved as table, just a multidimensional lookup table.
For any one (c, m, y, k), 0<=c, m, y, k<=1, it necessarily drops in certain small cubes so.We amplify n to each dimension of this small cubes doubly, become unit cube then and by translation, and the computing method of interpolation are as follows so:
Suppose pixel value (c, m, y, k) value after the color correction be C (c, m, y, k), 0<=c wherein, m, y, k<=1,0<=C (c, m, y, k)<=1 (value of function is a gray-scale value); Known C (m1, m2, m3, m4), and m1 wherein, m2, m3, m4=0 or 1 (the summit corresponding gray of unit cube in the four-dimentional space), so:
C(c,m,y,k)=C(1,1,1,1)×c×m×y×k+C(1,1,1,0)×c×m×y×(1-k)
+C(1,1,0,1)×c×m×(1-y)×k+C(1,1,0,0)×c×m×(1-y)×(1-k)
+C(1,0,1,1)×c×(1-m)×y×k+C(1,0,1,0)×c×(1-m)×y×(1-k)
+C(1,0,0,1)×c×(1-m)×(1-y)×k+C(1,0,0,0)×c×(1-m)×(1-y)×(1-k)
+C(0,1,1,1)×(1-c)×m×y×k+C(0,1,1,0)×(1-c)×m×y×(1-k)
+C(0,1,0,1)×(1-c)×m×(1-y)×k+C(0,1,0,0)×(1-c)×m×(1-y)×(1-k)
+C(0,0,1,1)×(1-c)×(1-m)×y×k+C(0,0,1,0)×(1-c)×(1-m)×y×(1-k)
+C(0,0,0,1)×(1-c)×(1-m)×(1-y)×k+C(0,0,0,0)×(1-c)×(1-m)×(1-y)×(1-k)
The C that notes occurring in the formula (c, m, y, k), c wherein, m, y, k=0 or 1 are the gray-scale values after the summit conversion of this unit cube, they leave in the aforesaid multidimensional lookup table in advance.Like this, just obtained the gray-scale value after the color correction by multidimensional lookup table and top computing formula.