TW436712B - Processing method of halftone image - Google Patents
Processing method of halftone image Download PDFInfo
- Publication number
- TW436712B TW436712B TW88108058A TW88108058A TW436712B TW 436712 B TW436712 B TW 436712B TW 88108058 A TW88108058 A TW 88108058A TW 88108058 A TW88108058 A TW 88108058A TW 436712 B TW436712 B TW 436712B
- Authority
- TW
- Taiwan
- Prior art keywords
- output
- pixel
- grayscale
- image
- gray scale
- Prior art date
Links
Landscapes
- Image Processing (AREA)
Abstract
Description
_ ^£6712___ 五、發明說明⑴ ' ----- 【發明的應用領域】 本發明係有關一種圖像的丰色調化處理方法,特別是 、種應用於數位圖像(image)的顯示、列印或印刷等領 域’用以將圖像之像素(P丨xe丨)進行最佳之半色調化處理 的技術。 【發明的相關技術】 一 半色s周化(h a I f t ο n e )方法是一種廣泛應用於圖像顯 二、列印以及印刷或出版等領域的技術。其優點是可以在 較小的設備灰階度中再現顏色層次更豐富的圖像,例如要 f黑白印表機上列印彩色圖像,在單色二灰階度顯示器上 頭示不同灰階度層次的圖像等等。 、傳統的半色調處理方法主要有閥值法,模式法,振盪 法,下面以黑白二灰階度印表機的圖像列印為例,簡要介 紹這幾種方法的實現原理。 (1 )閥值法: 一 設定一閥值(Threshold),如果圖像中任一像素的真 貫灰階度大於這個值則列印,否則不列印。用這種方法產 生的圖像只適用於極少數的情況。 (2 )模式法: 又稱濃淡點圖法,即用一個矩陣表示一個像素的灰階 度’例如一個2 X 2的矩陣可以藉由列印〇個點,1個點,2 個點’ 3個點或4個點來表示5種灰階度。這樣當得到一個 像素的灰階度值時,便用代表該灰階度的矩陣代替。同理 若是利用1 6氺1 6的矩陣就可以表示2 5 7種灰階度,這種方_ ^ £ 6712 ___ V. Description of the Invention ⑴ '----- [Application Field of the Invention] The present invention relates to a method for processing a rich image, particularly, a method for displaying a digital image, In the fields of printing or printing, it is a technique for optimal halftoning the pixels (P 丨 xe 丨) of an image. [Related technology of the invention] The half-color s-period (h a I f t ο n e) method is a technology widely used in the fields of image display, printing, and printing or publishing. Its advantage is that it can reproduce images with richer color levels in smaller device gray levels. For example, to print a color image on a black and white printer, and display different gray levels on a monochrome two gray level display. Degree-level images and more. 2. Traditional halftone processing methods mainly include threshold method, mode method, and oscillation method. The following uses the black and white grayscale printer image printing as an example to briefly introduce the implementation principles of these methods. (1) Threshold method:-Set a threshold (Threshold). If the true gray level of any pixel in the image is greater than this value, print it; otherwise, do not print it. The images produced in this way are only suitable for very few situations. (2) Mode method: Also known as the light-dotted dot map method, which uses a matrix to represent the gray level of a pixel 'for example, a 2 X 2 matrix can be printed by 0 dots, 1 dot, 2 dots' 3 Points or 4 points to represent 5 gray levels. In this way, when a grayscale value of one pixel is obtained, a matrix representing the grayscale is used instead. Similarly, if a matrix of 1 6 氺 16 can be used to represent 2 5 7 gray levels, this formula
第5頁 4 367 1 2 五、發明說明(2) 法的最大缺點是會放大原圖像的尺寸。 (3)振Μ 法(dithering): 振盪法又分為圖樣振盪法與濾波振盪法兩種,圖樣振 盪法藉由一種振盪矩陣實現,最簡單的辦法是採用8 X 8的 0,1矩陣。在矩陣中根據0,1分佈不同從而得到不同的灰 階度矩陣。這種原理同模式法所述的一樣。與模式法不同 的是,振盪法不是將一個像素點對應一個矩陣,而是將螢 幕上的一種像素顏色與一個代表該顏色灰階度的振盪矩陣 對應,用對應之振盪矩陣中相應位置元素的值代替該像 素,來決定打點或不打點(即0或1 )。圖樣振盪法的另一 種方法是Bayer振盪法,它與最簡實現法不同的是它的圖 樣矩陣只有一個8 X 8矩陣,填充在矩陣中的元素是數值 0〜6 3而不是0 , 1,這種矩陣能實現6 4個灰階度級別。在原 始圖像中灰階度值大於圖樣矩陣中相應位置元素灰階度級 別的像素,在對應的輸出圖像中為一白色像素,反之,那 些不大於圖樣矩陣♦相應元素的像素將在輸出圖像中被表 示為黑色像素。 圖樣振盪法最明顯的缺點是受人為因素影響很大,效 果不好。為了盡量克服人為因素影響,最有成效的方法是 誤差分散法(error diffusion)。考慮一個已知像素, 它與最終的表示結果之間有一定的誤差,如果把這個誤差 分散給周圍的像素,則它的影響在最終的輸出圖像中就不 會太顯著。這種方法存在許多潛在的問題,其中尤其是尋 找分散像素實際誤差的問題,另一個更麻煩的問題是使得Page 5 4 367 1 2 V. Explanation of the invention (2) The biggest disadvantage of the method is that it will enlarge the size of the original image. (3) Dithering: The oscillation method is divided into two types: pattern oscillation method and filter oscillation method. The pattern oscillation method is implemented by an oscillation matrix. The simplest method is to use an 8 × 8 matrix of 0,1. In the matrix, different gray scale matrices are obtained according to different distributions of 0 and 1. This principle is the same as described in the model method. Different from the mode method, the oscillating method does not correspond one pixel to one matrix, but corresponds one pixel color on the screen to one oscillating matrix representing the gray scale of the color, and uses the corresponding position element in the oscillating matrix. The value replaces the pixel to decide whether to dot or not (ie 0 or 1). Another method of the pattern oscillation method is the Bayer oscillation method, which is different from the simplest implementation method in that its pattern matrix has only an 8 X 8 matrix, and the elements filled in the matrix are numeric values 0 ~ 6 3 instead of 0, 1, This matrix can achieve 64 gray levels. In the original image, the pixels whose grayscale value is greater than the grayscale level of the corresponding position element in the pattern matrix are white pixels in the corresponding output image. Conversely, those pixels that are not greater than the pattern matrix Images are represented as black pixels. The most obvious disadvantage of the pattern oscillation method is that it is greatly affected by human factors and the effect is not good. In order to overcome human factors as much as possible, the most effective method is error diffusion. Consider a known pixel, and there is a certain error between it and the final representation result. If this error is spread to the surrounding pixels, its influence will not be too significant in the final output image. There are many potential problems with this method, especially the problem of finding the actual error of scattered pixels. Another more troublesome problem is to make
第6頁 五、發明說明(3) 原有灰(¾度懸殊的區域邊界變仔柔和分散。例如,包括某 二文子的圖像,容易在文字的邊緣產生模糊的現象s最流 行的誤差分散算法是F 1 0 y d - S t e i n b e r g濾波算法,它的工 作原理可表示為: X 7 3 5 1 它的所有數字之和為1 6。設定一個在X處像素與黑白 色間閥值的誤差,則可將誤差的7 / 1 6加到直接位於}(右邊 的像素上’將誤差的3/ 1 6加到X左邊下一行的像素上,將 誤差的5 / 1 6加到直接位於X下方的像素上,將誤差剩餘的 1 /1 6加到X右邊下一行的像素上。 用振盪原理實現的半色調處理不要求放大原來的圖 像’但是不管是圖樣振盪法,還是濾波振盪法,它們的圖 樣矩陣或者是濾波式的產生都深受人為因素的影響,仍然 不能產生使人信服的較佳結果。 、 【發明之目的與概述】 本發明的主要目的,就是在提供一種既可以輸由更加 平滑細腻之圖像的半色調化處理法,又可以不受人為: 的影響。 ’ u素 本發明所揭露的技術手段,其實施的步驟主要包括 有·‘ 1 ·依據輸出設備的圖像再現方式(如輸出像素點的大 小、形狀、濃淡程度、排列方式、設備灰階度織數 的任一者或一者以上)和數學期望公式得到任相 中Page 6 V. Explanation of the invention (3) The original gray (¾-degree disparity area borders become soft and scattered. For example, an image that includes a certain essay is prone to blur at the edges of the text. S The most popular error dispersion The algorithm is F 1 0 yd-Steinberg filtering algorithm, and its working principle can be expressed as: X 7 3 5 1 The sum of all its numbers is 16. Set a threshold error between the pixel and black and white at X, Then you can add 7/16 of the error directly to the pixel located on the right side. (Add the 3/16 of the error to the pixel on the next row to the left of X, and 5/16 of the error to the pixel directly below X. Add the remaining 1/1 16 of the error to the pixels on the next row to the right of X. The halftone processing implemented by the oscillation principle does not require the original image to be enlarged. However, whether it is the pattern oscillation method or the filter oscillation method, The generation of their pattern matrix or filter is deeply affected by human factors and still cannot produce convincing better results. [Objective and Summary of the Invention] The main purpose of the present invention is to provide an By more The method of adding a smooth and delicate image to the halftone can also be free from the influence of man-made: 'u The technical means disclosed in the present invention, the implementation steps mainly include ·' 1 · According to the diagram of the output device Image reproduction methods (such as any one or more of the output pixel size, shape, density, arrangement, and device gray scale weaving number) and mathematical expectation formulas are obtained in any phase
第7頁 43 67 1 2 五、發明說明(4) 設備灰階度在總輸出機率等於1的條件下’隨輸出機率 變化(較小的設備灰階度輸出機率自1至0變化,相對較 大的設備灰階度輸出機率自0至1變化)得到的期望灰階 度曲線,組合得到整個輸出灰階度區間曲線,這是一條 單調增的曲線; 2 .由整個輸出灰階度區間曲線得到與各輸出灰階度、級別 相應的輸出表示訊息,建立一種用以記錄圖像中之像素 在任一灰階度值之輸出表示訊息的對照表; 3 *取得原圖像中的一個像素,由該像素的灰階度值自該 對照表中找到相應的輸出表示訊息’根據該訊息半色調 化這個像素,直到處理完所有的像素。 在本發明所揭露的技術中,利用了統計學的機率 (Probability)與期望值(Expected Value)。先由輸出設 備的圖像再現(R e p r 〇 d u c e )方式訊息求出每級設備灰階度 可表現的最大輸出灰階度,把設備灰階度的表現區間晝分 為η個不重疊地區間(假設設備本身有η級設備灰階度), 而位於相應區間的輸出灰階度值由該區間頭尾所對應的兩 個設備灰階度根據所佔的機率表示’利用數學期望值公式 可精確推出各機率所對應的期望灰階度(即最可能的輪出 灰階度),同樣’該期望灰階度的最合理的表示方法就是 用這兩個設備灰階度以這種分配機率表示,我們把這兩個 設備灰階度及輸出機率在這兩個設備灰階度中的分配機率 稱為該輸出灰階度的輸出表示訊息。根據這個原理,我們 可以求出每一種輸出灰階度相應的輸出表示訊息,根據所Page 7 43 67 1 2 V. Description of the invention (4) The gray scale of the device varies with the output probability under the condition that the total output probability is equal to 1. (The output probability of the gray scale of smaller devices varies from 1 to 0, which is relatively Large device grayscale output probability changes from 0 to 1), the desired grayscale curve obtained, combined to get the entire output grayscale interval curve, which is a monotonically increasing curve; 2. the entire output grayscale interval curve Obtain output representation messages corresponding to each output gray level and level, and establish a comparison table to record the output representation information of pixels in the image at any gray level value; 3 * Obtain a pixel in the original image, From the grayscale value of the pixel, a corresponding output is found from the lookup table to indicate that the message 'half-tones this pixel according to the message until all pixels have been processed. In the technology disclosed in the present invention, statistical probability and expected value are used. First, the maximum output gray level that can be represented by the gray level of each level of equipment is obtained from the image reproduction (R epr 〇 duce) mode information of the output device, and the performance interval of the gray level of the device is divided into n non-overlapping regions. (Assuming that the device itself has η-level device grayscale), and the output grayscale value of the corresponding interval is represented by the grayscale of the two devices corresponding to the beginning and end of the interval according to the probability occupied. Introduce the expected gray level corresponding to each probability (that is, the most likely rotation gray level). Similarly, the most reasonable expression method of the expected gray level is to use these two equipment gray levels to express this distribution probability. We call the distribution probability of the gray scale and output probability of the two devices in the gray scale of the two devices as the output representation information of the output gray scale. Based on this principle, we can find the output representation information corresponding to each output gray level.
第8頁 3 G7 1 五、發明說明¢5) 需要的輸出灰階度建立一輸出表示訊息的對照表,於輸出 時根據轉換像素顏色所得的灰階度查找對照表獲得該像素 在輸出時的輸出表示訊息,而以較優的方式地表示該像 素。有關本發明之詳細技術内容及實施例,將在下文中配 合圖式作一說明。 而前述的最大輸出灰階度,實際上可以透過許多方式 加以決定,例如:將一彩色圖像中某一包含 R(Red),G(Green),B(Blue)三種顏色值的彩色像素,其取 值範圍為0-256,籍由如RX30 + GX59 + BX11之方式轉換求 得一最大輸出灰階度為2 5 6 0 0 (輸出灰階度區間在0〜2 5 6 0 0 之間)。 【圖式說明】 第1圖,為本發明的主要實施步驟流程圖。 第2圖,顯示印表機在一個可列印之最小正方形中, 可以產生1 3個灰階度均勻的區域。 第3A〜3F圖,顯示在第2圖的正方形中,列印點的數種 可能組合方式。 第4圖,顯示對某一彩色像素進行半色調化處理的詳 細步驟流程圖。 【發明之詳細說明】 請參閱「第1圖」,本發明的主要實施步驟包括有: 1.依據該輸出設備的圖像再現方式訊息’取得該輸出 設備的設備灰階度級數,在任兩位相鄰之該設備灰階度的 總輸出機率等於1的條件下,計算該像素之輸出灰階度在Page 8 3 G7 1 V. Description of the invention ¢ 5) The required output gray level establishes a comparison table for output information. At the time of output, a look-up table based on the gray level obtained by converting the color of the pixel is used to obtain the corresponding value of the pixel at the time of output. The output represents the message, and the pixel is represented in a better way. The detailed technical content and embodiments of the present invention will be described below in conjunction with the drawings. The aforementioned maximum output gray level can actually be determined in many ways, for example: a color pixel that contains three color values of R (Red), G (Green), and B (Blue). Its value range is 0-256, and a maximum output grayscale is 2 5 6 0 0 (the output grayscale interval is between 0 ~ 2 5 6 0 0) by converting in a way such as RX30 + GX59 + BX11. ). [Explanation of the drawings] FIG. 1 is a flowchart of main implementation steps of the present invention. Figure 2 shows that the printer can generate 13 uniform grayscale areas in a printable smallest square. Figures 3A to 3F are shown in the square in Figure 2. There are several possible combinations of printed dots. Fig. 4 is a flowchart showing the detailed steps of halftoning a certain color pixel. [Detailed description of the invention] Please refer to "Figure 1". The main implementation steps of the present invention include: 1. Obtain the gray scale level of the output device according to the image reproduction mode information of the output device. Under the condition that the total output probability of the gray level of the adjacent device is equal to 1, calculate the output gray level of the pixel at
第9頁 4 3 671 2 五、發明說明¢6)Page 9 4 3 671 2 V. Description of invention ¢ 6)
:相應區:2,尾所對應的兩個設備灰階度中所佔的機 ;;,卩迎輸,〃’變化得到的一期望的輸出灰階度曲線, 經組合得到一全部輪出灰階度區間曲線; 再 2.依據該輪出灰階度區間曲,線,建立一輸出表示訊自 對照表,用以記錄該圖像中之像素在任一輸出灰階度值二 輪出表示訊息;以及 3 ·取得原圖像中的—個像素,由轉換該像素顏色值所 得的輸出灰階度值自該對照表中找到相應的該輸出表示訊 息,據該訊息半色調化這個像素,直到處理完所有的像 素。 在前述的步驟1中,主要是依據輸出設備的圖像再現 方式訊息(如輸出像素點的大小、形狀、濃淡程度、排列 方式、設備灰階度級數之中的任一者或一者以上)和數學 期望公式得到任兩個相鄰之設備灰階度在總輪出機率等於 1的條件下’隨輸出機率變化(較小的設備灰階度輸出機 率自1至0變化’相對較大的設備灰階度輸出機率自0至1變 化)得到的期望的輸出灰階度曲線,組合得到整個輸出灰 階度區間曲線(這是一條單調增的曲線)。 在前述步驟2中所謂的輸出表示訊息 (halftoneinfo[rank] ; rank表示輸出設備之最大輸出灰 階度級數),其中包含有: (1 )圖像中某一像素的輸出灰階度值; (2 )用於表示該輸出灰階度值的兩個相鄰設備灰階度 級數;以及: Corresponding area: 2, the machine occupied by the gray scale of the two devices corresponding to the tail;;, a desired output gray scale curve obtained by changing 卩 to lose, 〃 ', and combined to obtain a full round of gray Step interval curve; Secondly, according to the gray scale interval curve and line, a set of output indication information comparison table is established to record the pixels in the image at any output gray level value. And 3. Obtain a pixel in the original image, and output the grayscale value obtained by converting the color value of the pixel. Find the corresponding output representation message from the lookup table, and halftone the pixel according to the message until processing. Finish all the pixels. In the foregoing step 1, it is mainly based on any one or more of the image reproduction mode information of the output device (such as the size, shape, density, arrangement, and gray level of the output pixels). ) And mathematical expectation formula to obtain the gray level of any two adjacent devices under the condition that the total wheel output rate is equal to 1 'varies with the output probability (smaller device gray level output probability changes from 1 to 0' is relatively large (The grayscale output probability of the device varies from 0 to 1) to obtain the desired output grayscale curve, which is combined to obtain the entire output grayscale interval curve (this is a monotonically increasing curve). In the foregoing step 2, the so-called output representation information (halftoneinfo [rank]; rank represents the maximum output grayscale level of the output device), which includes: (1) an output grayscale value of a pixel in the image; (2) the gray scale levels of two neighboring devices for representing the output gray scale value; and
第10頁 五、發明說明(7) (3)像素之輸出灰階度值在這兩個相鄰設備灰階度值 區間的列印機率。 "而以上的步驟(1)、(2)是在一輪出設備的初始化過程 執行而建立元成的輸出表示訊息對照表,則是被儲存於 一可讀取的記憶裝置(如記憶體或其他:能類似的元件 ),以,輪出設備在輸出半色調化圖像時加以利用。 在實際依據前述的方法步驟對某—圖像進行半色調化 處理的過程中,將會不斷地重覆前述的步驟(3),取得原 圖像中的一個像素,由轉換該像素顏色值所得的輸出灰階 度值自該對照表中找到相應的輸出表示訊息,記錄該像素 的輸出表示訊息,直到處理完所有的像素,即完成了對圖 像進行半色調化的作業。 「實施例說明」 下文中以一個彩色圖像在一種多灰階度之印表機上輸 出’根據本發明所揭露之方法進行圖像半色調化的實施 過程。 (A )首先說明在前述的「步驟1」中如何產生輸出灰 階度區間曲線。 假设某一多灰階度之單色(黑白)印表機的圖像再現 方式(列印方式),其中輸出的像素點為圓形,輸出的像素 點按正方形排列,設備灰階度級數為1 6級,說明如何實現 2 3 6 0 0級的最大輸出灰階度。假設印表機的1 6級灰階度相 應輪出像素點的灰階度分別為’其 τ 0為全黑,1為全白,相應的設備灰階度級數依序分別為Page 10 V. Description of the invention (7) (3) The probability that the output grayscale value of the pixel is in the interval between the grayscale values of these two neighboring devices. " And the above steps (1) and (2) are executed in the initialization process of the out-of-equipment device to create a meta-indicating table of output information, which is stored in a readable memory device (such as memory or Other: similar components), so that the wheel-out device can use it when outputting halftone images. In the process of halftoning an image according to the foregoing method steps, the foregoing step (3) will be continuously repeated to obtain a pixel in the original image, which is obtained by converting the color value of the pixel The output grayscale value of is found from the corresponding table to find the corresponding output representation information, and the output representation information of the pixel is recorded, until all pixels are processed, the operation of halftoning the image is completed. "Explanation of the embodiment" Hereinafter, a color image is output on a multi-gray-scale printer. The process of half-toning an image according to the method disclosed in the present invention is described below. (A) First, it is explained how to generate the output gray-scale interval curve in the aforementioned "step 1". Assume that the image reproduction mode (printing method) of a monochrome (black and white) printer with multiple gray levels is that the output pixels are circular, the output pixels are arranged in a square, and the gray level of the device is It is 16 levels, and it shows how to achieve the maximum output gray scale of 2 3600. Assume that the gray scales of the corresponding 16-level grayscales of the printer are ’, where τ 0 is all black and 1 is completely white, and the corresponding device grayscale levels are sequentially
第11頁 4367 12 五、發明說明(8) 0、1、2、3'5、6、7、8、9、10、11、12、13、14、 15。 如「第2圖」所示,假設一個邊長a = 1的最小可被列印 正方形,可列印之像素點位置為正方形的四個角點P1,P2, P3, P4,每一個列印像素點的直徑為r ( ,根據 四個角點的列印情況,可把正方形分成面積分別為an, a12 ,a13 ,a14 ,a21 ,a22 ,a23 ,a24 , a31 ,a32 ,a33 ,a34 ,a4 的 1 3 個灰階度均勻的區域,其中an = a12二, ,a31 = a32 = a33 = a34 ’ a4 = A4,他們的灰階度分 別為hn,h12,h13,h14,h21,h22 ’ h23,h24,h31,h32,h33 ’ h34 ’ h4。 則這個正方形的平均灰階度可用這1 3個區域的面積分 別乘以各區域的灰階度求得,即: //= + + a13/il3 + 十“21Λ2Ι + + ίϊ:3%3 + ίϊ:4Λ24 + Ο) (2) “31^1 + + 义3^33 + 仏>4〜>4 + 〜乂 定義一個灰階度截取函數F (X )Page 11 4367 12 V. Description of the invention (8) 0,1,2,3'5,6,7,8,9,10,11,12,13,14,15. As shown in "Figure 2", suppose a minimum printable square with a side length a = 1, and the printable pixel positions are the four corner points P1, P2, P3, and P4 of the square. Each print The diameter of the pixel is r (, according to the printing conditions of the four corner points, the square can be divided into areas an, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a4 13 uniform grayscale regions, where an = a12 two,, a31 = a32 = a33 = a34 'a4 = A4, and their grayscales are hn, h12, h13, h14, h21, h22' h23 , H24, h31, h32, h33 'h34' h4. Then the average gray scale of this square can be obtained by multiplying the area of the 13 areas by the gray scale of each area, that is: // = + + a13 / il3 + ten "21Λ2Ι + + ίϊ: 3% 3 + ίϊ: 4Λ24 + Ο) (2)" 31 ^ 1 + + meaning 3 ^ 33 + 仏 > 4 ~ > 4 + ~ 乂 defines a grayscale interception Function F (X)
當0 < X < 1 當m 考慮列印機率在兩種非0的設備灰階度比、h2 ( hph ) 之區間分佈時列印機率與數學期望灰階度的關係式。假設 機率在h、h2上的分佈分別為1 - m,m ( 0 <m< 1 )。我們把這 個步據等效為兩種列印結果的相加:(1 )原灰階度為hi之When 0 < X < 1 when m considers that the printing probability is distributed between two non-zero device grayscale ratios and h2 (hph), the relationship between the printing probability and the mathematically expected grayscale. Suppose the distribution of probability on h and h2 is 1-m, m (0 < m < 1). We equivalent this step to the sum of the two print results: (1) the original gray level is hi
第12頁 五、發明說明(9) 列印;以及(2 )在設備灰階度為 為m時的列印。 像素點的全機率(m — 1 ) h2區間之像素點的機率 第一部份的列印結果 hu =h)2 =h13 =h1,1 =F (hj) 匕2丨=h22 =h23 二h24 =F(2h丨) h31’ =h32’ =h33’ =h34’ =F(3h,) h4’ 二 F (叫) 二部份的列印結果可根據數學期望定義式東得。設 ^ m ^ μ ^ ^ ^ pi ^ 機率為m,推導列印機率與數 子』望灰^度之間的關係,根據列印之 點與像素點之間的相對位置,^站數以及像素 均灰階度為Ph4,機率m4_ ;列印3種個Y素有種 種,記平均灰階度為叫,機率⑹ 平均灰階度為phn,另2種為對角的形態’記 Pk,每種情況出現的機率m2=m2(l-m)2 ;列p句火1¾又 種組合有α =4種,記平均灰階度為ph〖,出卩素, m 1 = m ( 1 - m )3 ;列印0個像素點,此種組合有p+ : ^Page 12 5. Description of the invention (9) Printing; and (2) Printing when the grayscale of the device is m. Total probability of pixels (m — 1) Probability of pixels in interval h2 The first part of the print result hu = h) 2 = h13 = h1,1 = F (hj) D2 2 = h22 = h23 2 h24 = F (2h 丨) h31 '= h32' = h33 '= h34' = F (3h,) h4 'Two F (called) The printing result of the two parts can be obtained according to the mathematical expression. Let ^ m ^ μ ^ ^ ^ pi ^ be the probability of m. Derive the relationship between the printing probability and the number of digits. According to the relative position between the printing point and the pixel, the number of stations and pixels The average gray level is Ph4, and the probability is m4_; there are three types of Y, and the average gray level is called, the probability is ⑹ The average gray level is phn, and the other two are diagonal forms. Remember Pk, each The probability of this situation m2 = m2 (lm) 2; column p sentence fire 1¾ and other combinations have α = 4, and the average gray level is ph〗 〖, out of prime, m 1 = m (1-m) 3 ; Print 0 pixels, this combination has p +: ^
平均灰階度為ph0(phO=〇),出現機率m〇 = (1、m)4。如「 °3A 圖'第3 F圖」所示則為前述數種列印情形的知 _ * 内㈣字0’ I 2’ 3’ 4分別表示相應區域被列印 u,i,2,3,4 次。 依據上述的平均灰階度計算公式(1 ), J Μ求得以上The average gray scale is ph0 (phO = 0), and the probability of occurrence m0 = (1, m) 4. As shown in "° 3A figure 'Figure 3F'", it is the knowledge of the aforementioned several printing situations. * Inner characters 0 'I 2' 3 '4 indicate that the corresponding area is printed u, i, 2, 3 , 4 times. According to the above-mentioned average grayscale calculation formula (1), J Μ can be obtained
第13頁 436712 五、發明說明¢10) 數種組合方式的平均灰階度分別為: ρΚ = 0 ph [ = \-(A} + 2. Az + j + A^jFfh) 池,=+ A +义列和一⑷+ 24十? ph„ = ph, = \-(2A2+3AjF(h)-i2A2+3A:jF(2h)-(Ai+AjF(3h) ph^ = XAA.Ffhj-AA.FflhjAA.FOhhA.Ff^h) 期望輸出灰階度E[H]為: E[H] = x m4 χ phA + m3 x C34 x phy + m2 x (piu^ x 4+/?/?22 x 2y + m, x C{ x ρ/ϊ! + m0 x Cj χ ρ/ϊ〇 (J) 此即為機率與數學期望值之間的關係式。 再假設η為列印像素點的半徑r與正方形邊長a之比, 即π = r / a,可求得A丨,A 2,A 3,A i[的面積分別為. , / «' , rr jrr + ahlx Ύ 叫Ύ Α2 = (^)2 arctg^l - γ arctg]j^4 -甚 ,η、 2 4 A =3Α1-2Α2+/ζτ (¾2 Α4 -\~πχ^ ——Α, -2Α-, -3Α,Page 13 436712 V. Description of the invention ¢ 10) The average gray levels of several combinations are: ρΚ = 0 ph [= \-(A) + 2. Az + j + A ^ jFfh) pool, = + A + 义 列 和 一 ⑷ + 24 十? ph „= ph, = \-(2A2 + 3AjF (h) -i2A2 + 3A: jF (2h)-(Ai + AjF (3h) ph ^ = XAA.Ffhj-AA.FflhjAA.FOhhA.Ff ^ h) expect The output gray level E [H] is: E [H] = x m4 χ phA + m3 x C34 x phy + m2 x (piu ^ x 4 + /? /? 22 x 2y + m, x C {x ρ / ϊ! + m0 x Cj χ ρ / ϊ〇 (J) This is the relationship between the probability and the mathematical expectation. Let us assume that η is the ratio of the radius r of the printing pixels to the square side length a, ie π = r / a, the area of A 丨, A2, A3, Ai [can be obtained., / «', rr jrr + ahlx Ύ is called Α Α2 = (^) 2 arctg ^ l-γ arctg] j ^ 4-even, η, 2 4 A = 3Α1-2Α2 + / ζτ (¾2 Α4-\ ~ πχ ^ ——Α, -2Α-, -3Α,
第14頁Page 14
I 五、發明說明(11) 兩種列印結果相加,得ph〇’ ' ph!’ 、ph21’ 、ph22’ 、 ph3’ 、ph4’ 分別為: ph' = l-[3A]F(hl) + 2A2F(2hl) + A:F(3hi) + 3AiF(2h]+h7) + 2A2 F(\ +KJ + A, F(h2) + A, F〇h\ + h2)] ph2x' = \-[2AxF(h{) + A1F(2hx)-\-2A-1F(h^+h2) + 2A,F(2hxjrh,) + 2A,Ffh, +lh2) + A2F(2h2) + 2^(^) +A,F(2h^ IK)] ph22' = \-[2AxF(h{) + 2A,F(h2)^^A2F(hl + h1_)^2AiF(2hl+hJ) + 2A,F(hl + 2h2)+A4F(2h} + 2h2)J ph: = \-[AlF(hJ + 3A]F(h2j + 2A2F(h]+h2) + 2A2F(2h2) +I. Description of the invention (11) The two printing results are added to obtain ph〇 '' ph! ', Ph21', ph22 ', ph3', and ph4 ', respectively: ph' = l- [3A] F (hl ) + 2A2F (2hl) + A: F (3hi) + 3AiF (2h) + h7) + 2A2 F (\ + KJ + A, F (h2) + A, F〇h \ + h2)] ph2x '= \ -[2AxF (h () + A1F (2hx)-\-2A-1F (h ^ + h2) + 2A, F (2hxjrh,) + 2A, Ffh, + lh2) + A2F (2h2) + 2 ^ (^ ) + A, F (2h ^ IK)] ph22 '= \-[2AxF (h () + 2A, F (h2) ^^ A2F (hl + h1 _) ^ 2AiF (2hl + hJ) + 2A, F (hl + 2h2) + A4F (2h} + 2h2) J ph: = \-[AlF (hJ + 3A] F (h2j + 2A2F (h) + h2) + 2A2F (2h2) +
A,F(3h2) + 2A:F(2hz +h\) + A,F(2h\ + hj + A,F(h} +3h2)] ph; = l-f4AiF(h2) + 4A2F(2h2) + 4A,F(3h2) + AiF(4h7)J 代八公式(3 )即得到在兩種設備灰階度區間分佈時期 望輸出灰階度與機率分佈之間的關係式: ~ x m4 x ph^' + w3x C34 x ph,' + πιΊ y.(ph^'y-A+ph,^!) + m^C\y.phx' +m〇x C°Axp\' (4) (B )繼續說明如何在前述的「步驟2」中建立—種用 以s己錄圖像中之像素在任一輸出灰階度值之輪出表示訊息 的對照表。A, F (3h2) + 2A: F (2hz + h \) + A, F (2h \ + hj + A, F (h) + 3h2)] ph; = l-f4AiF (h2) + 4A2F (2h2) + 4A, F (3h2) + AiF (4h7) J Substitute the eight formula (3) to get the relationship between the expected output gray level and the probability distribution when the gray level interval distribution of the two devices is distributed: ~ x m4 x ph ^ '+ w3x C34 x ph,' + πιΊ y. (ph ^ 'y-A + ph, ^!) + m ^ C \ y.phx' + m〇x C ° Axp \ '(4) (B) Continue to explain how to establish in the aforementioned "step 2"-a kind of comparison table used to represent the information of the pixels in the recorded image at any output grayscale value.
第15頁 436712 五、發明說明(ί2) 根據本發明所揭露的輪出表示訊息 (halft〇neinf〇[rank] ; rank表示輸出設備之最大輸出灰 階度級數),其中包括有: (1 )圖像中某一像素的輸出灰階度值;我們可以用數 組的下標表示。例如數組halftoneinfo中的一個元素 halftoneinf〇[l〇〇],它的下標是1〇〇,意指它是這個數组 中的第100個元素;而在本發明的處理方法中,輸出灰度 值為1 0 0的像素的輸出表示訊息就存放在這個元素中。 (2 )用於表示該輸出灰階度值的兩個相鄰設備灰階度 級數;如果知道較小的設備灰階度值則較大的設備灰階度 值可由較小的設備灰階度值加1求得,因為他們是相鄰 的,因此可由較小的設備灰階度值表示。以及 (3)像素之輸出灰階度值在這兩個相鄰設備灰階度值 區間的列印機率;因為在這兩個設備灰階度值輸出機率和 為1 ,由—個設備灰階度值的輪出機率可求出另一個設僙 灰階度值的輪出機率,也可以只用較小的設備灰階度值的 輸出機率表示。 假5文衩們用整 過 /、别出機率。因此可 下列虛擬碼的例子建立他們的資料結構如下: struct { int〇UtValuel; //較小的輸出設備像素值 ^㈣出設備像素值的輸出機率 若是原始圖像為彩色圖像 則可將彩色圖像之像素的Page 15 436712 V. Description of the invention (ί2) The rotation-out indication message (halft〇neinf〇 [rank]; rank indicates the maximum output gray level of the output device) according to the present invention, including: (1 ) The output grayscale value of a pixel in the image; we can use the index of the array. For example, an element halftoneinf〇 [l〇〇] in the array halftoneinfo has a subscript of 100, which means that it is the 100th element in the array; and in the processing method of the present invention, the gray scale is output. The output of a pixel with a value of 100 means that the message is stored in this element. (2) The gray level of two neighboring devices used to represent the output gray level value; if the smaller device gray level value is known, the larger device gray level value can be determined by the smaller device gray level Degree values are increased by 1 because they are adjacent and therefore can be represented by smaller device grayscale values. And (3) the probability that the output grayscale value of the pixel is within the grayscale value interval of the two adjacent devices; because the sum of the output probability of the grayscale value in these two devices is 1, The rotation probability of the degree value can be used to determine the rotation probability of another gray level value. It can also be expressed by the output probability of the smaller equipment gray level value. In the case of 5 texts, we use the whole /, do not have a chance. Therefore, the following virtual code example can be used to establish their data structure as follows: struct {int〇UtValuel; // Small output device pixel value ^ ㈣The output probability of the output pixel value of the device can be color if the original image is a color image Pixel of image
第16頁 五、發明說明(13) —種顏色值(R, G,B)藉由下式轉換為2 5 6 0 0級的輸出灰階度 值: Η - R X 30 + G X 59 + Β X 11 ; 在這個例子之中,其中的R(Red),G(Green),B(Blue) 為红,綠,藍三種顏色的分量,取值範圍為〇 - 2 5 6,因此Η 的範圍為L25600。而採用迭代方法建立輸出表示訊息對 照表h a 1 f t ο n e i n f 〇 [ 2 5 6 0 0 ]的虛擬妈可如下例所示:5. Description of the invention on page 16 (13)-A color value (R, G, B) is converted to an output grayscale value of level 2 5 6 0 0 by the following formula: Η-RX 30 + GX 59 + Β X 11; In this example, R (Red), G (Green), and B (Blue) are the components of three colors: red, green, and blue. The value ranges from 0 to 2 5 6. Therefore, the range of Η is L25600. The iterative method to create an output representation message comparison table h a 1 f t ο n e i n f 〇 [2 5 6 0 0] can be shown in the following example:
Void FillHalftoneInfoStruct (float η ) { int hi = 0 , h2 = 0 , nCount = 0 ; for(int i = 0 ; i < 15 ; i++) { for (float j = 0 ; j < 1 ; j += 0.00001 ) i h 1 = (int) (CaculateExpertOutValue (η , i/15,(i + l)/15,j)*25600); if ( hi > nCount && h2 <= nCount) { halftoneinfo[nCountj.outvaluel =i; halftoneinfo[nCount].outchancel =j *25600 ; nCount ++ ; } h2 = hi ; }Void FillHalftoneInfoStruct (float η) {int hi = 0, h2 = 0, nCount = 0; for (int i = 0; i <15; i ++) {for (float j = 0; j <1; j + = 0.00001) ih 1 = (int) (CaculateExpertOutValue (η, i / 15, (i + l) / 15, j) * 25600); if (hi > nCount & & h2 < = nCount) {halftoneinfo [ nCountj.outvaluel = i; halftoneinfo [nCount] .outchancel = j * 25600; nCount ++;} h2 = hi;}
第17頁 4367 1 2 五、發明說明(14) 其中函數Void FillHaiftonelnfoStruct (float η) 表示建立輸出表示訊息對照表,η為列印像素點的半徑r興 任二相鄰之列印像素點距a之比,即n = r / a,( Vi < ” < 2 ),float Cacu1ateExpertOutVa 1 ue (float n , float hi ,floate h2 , float chance ) 係用以計算期望輸出灰 階度值,為〇〜1之間的浮點值,c h a n c e為較小的設備灰階 度的輸出機率,其計算式如前述之公式(4)。此一步驟 雖然比較繁雜,但是對於一台列印輸出設備而言,只需初 始化一次,可利用性極佳。當η決定以後,這個式子是一 個關於m的一元四次方程,從理論上說能求得精確解。 (C )關於前述步驟(3 )之詳細實施例: 當實際執行前述步驟(3 )對某圖像進行半色調化處理 時’可利用本發明所揭露之方法步驟對圖像的每一個像素 分別進行處理,而獲得一種較佳的半色調化結果,例如: 對一個由R(Red),G(Green),B(Blue)三種顏色所合成的彩 色像素’可以依據下述之步驟對其進行半色調化的處理 (見「第4圖」),其步驟包括有; 1 ·將像素之顏色轉換為對應的灰階度值;假設以產生 2 5 6 0 0級的輸出灰階度為例’可依據計算式〔rank = R χ 30 + GX59 + BX11 ;rank(0< = rank<25600〕轉換求得像素Page 17 4367 1 2 V. Description of the invention (14) Where the function Void FillHaiftonelnfoStruct (float η) indicates the establishment of an output representation message comparison table, η is the radius r of the printing pixels, and the distance between two adjacent printing pixels a The ratio, that is, n = r / a, (Vi < ”< 2), float Cacu1ateExpertOutVa 1 ue (float n, float hi, float h2, float chance) is used to calculate the expected output grayscale value, which is 〇 For floating-point values between ~ 1, chance is the output probability of the smaller device grayscale, and its calculation formula is as the aforementioned formula (4). Although this step is more complicated, but for a print output device It only needs to be initialized once, and the availability is very good. When η is determined, this formula is a unary quartic equation about m, and theoretically an accurate solution can be obtained. (C) About the previous step (3) Detailed embodiment: When the above-mentioned step (3) is actually performed for halftoning an image, the method steps disclosed in the present invention can be used to process each pixel of the image separately to obtain a better halftone. Toning results For example: A color pixel 'composed of three colors of R (Red), G (Green), and B (Blue)' can be halftoned according to the following steps (see "Figure 4"), The steps include: 1. Converting the color of a pixel to the corresponding grayscale value; assuming an output grayscale of 2 560 0 level is taken as an example ', it can be calculated according to the formula [rank = R χ 30 + GX59 + BX11; rank (0 < = rank < 25600)
第18頁 五、發明說明(15) 之顏色所對應的灰階度值; 2 ·根據轉換所得的灰階度值自輸出表示訊息對照表中查 找對應的輪出表示訊息h a 1 f t 〇 n e i n f 〇 [ r a n k ];假設查找 所4'的輪出表示訊息halftoneinfo[rank]= { 6,1 5 0 〇 0丨,即表示我們可以在設備灰階度6與7之中的 某一者表示此一像素的輸出灰階度,其中以設備灰階度 6表示的機率為1 5 0 0 0 /2 5 6 0 0 (機率介於0〜1之間),以設 備灰階度7表示的機率為1-(15000/25600)(機率介於0〜1 之間); 3 ·產生一個隨機數r,例如用隨機數發生器(或函數)產生 一個介於0與最大輸出灰階度之間的隨機值Γ ;(在此一 實施例中即為產生一介於0到2 5 6 0 0之間的隨機值); 4 ·當該隨機值小於或等於該輸出表示訊息之設備灰階度 級數之較小者所佔的機率時,半色調化的結果即為該輸 出表示訊息之設備灰度之較小者,否則半色調化的結果 為該輸出表示訊息之設備灰階度之較小者加1,亦即較 大者。 而上述的驟可以由下例的虛擬碼實現: int CovertToHalftoneValue( int R ,int G , int B ) { int rank = R *30 + G * 59 + B * 11 ; if ( Rand() <= Halftonelnfo[rank].outchancel ) return Halftonelnfo[rank].outvaluel ; else return HalftoneInf〇[rank].outvaluel + 1 ;Page 18 V. Description of the invention (15) The grayscale value corresponding to the color; 2 · According to the grayscale value obtained by the conversion, look up the corresponding rotation display message ha 1 ft 〇neinf 〇 from the output representation message comparison table. [rank]; Suppose that the 4 'turn-out representation message halftoneinfo [rank] = {6,1 5 0 〇0 丨, that means we can represent this one in one of the device gray levels 6 and 7. Pixel output gray scale, where the probability represented by the device gray level 6 is 1 50 0 0/2 5 6 0 0 (the probability is between 0 and 1), and the probability represented by the device gray level 7 1- (15000/25600) (probability between 0 ~ 1); 3 · Generate a random number r, such as using a random number generator (or function) to generate a random number between 0 and the maximum output gray level Random value Γ; (In this embodiment, it is to generate a random value between 0 and 2 5 6 0 0); 4 When the random value is less than or equal to the gray scale level of the device that outputs the message When the probability of the smaller one is occupied, the result of halftoning is the smaller of the gray scale of the device that outputs the message, otherwise The results for the adjustment of the output message indicates the gray level of the device plus a smaller, i.e. larger person. The above steps can be implemented by the following virtual code: int CovertToHalftoneValue (int R, int G, int B) {int rank = R * 30 + G * 59 + B * 11; if (Rand () < = Halftonelnfo [rank] .outchancel) return Halftonelnfo [rank] .outvaluel; else return HalftoneInf〇 [rank] .outvaluel + 1;
第19頁Page 19
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW88108058A TW436712B (en) | 1999-05-18 | 1999-05-18 | Processing method of halftone image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW88108058A TW436712B (en) | 1999-05-18 | 1999-05-18 | Processing method of halftone image |
Publications (1)
Publication Number | Publication Date |
---|---|
TW436712B true TW436712B (en) | 2001-05-28 |
Family
ID=21640734
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW88108058A TW436712B (en) | 1999-05-18 | 1999-05-18 | Processing method of halftone image |
Country Status (1)
Country | Link |
---|---|
TW (1) | TW436712B (en) |
-
1999
- 1999-05-18 TW TW88108058A patent/TW436712B/en not_active IP Right Cessation
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5729632A (en) | Reproduction apparatus and method for adjusting rendering with toners of different particle sizes | |
JP4765635B2 (en) | High quality halftone processing | |
US20140253976A1 (en) | Hybrid Halftone Generation Mechanism | |
US8462390B2 (en) | Image processing method and apparatus | |
JP3957734B1 (en) | Program, information storage medium, 2D code generation system, 2D code | |
US20100103464A1 (en) | Image processing apparatus and image processing method | |
JP2009100230A (en) | Image processing apparatus and method thereof | |
TW436712B (en) | Processing method of halftone image | |
US8861034B2 (en) | Method and apparatus for generating multi-bit depth halftone amplitude-modulation dots | |
JP4479663B2 (en) | Image processing apparatus, image processing method, and image processing program for halftone processing using fixed cells | |
JP2006245674A (en) | Image forming apparatus and gradation expressing method | |
JP4525916B2 (en) | Image forming apparatus, image forming method, image processing apparatus, and image processing method | |
JP2000332995A (en) | Method for generating image data and recording medium | |
CN102098416B (en) | Frequency modulation and amplitude modulation network control method and device | |
US20130265611A1 (en) | Hybrid Halftone Generation Mechanism | |
JP2001309188A (en) | Image processing unit and image processing method | |
CN102131037A (en) | Halftone image production method and image processing system | |
CN113436087B (en) | Image binarization and display method, storage medium and terminal equipment | |
JPS60226279A (en) | Half tone recording device | |
JP5633364B2 (en) | Image processing device | |
US20020060812A1 (en) | Image processing method and image processing apparatus | |
Zhuge et al. | Halftoning via Error Diffusion using Circular Dot-overlap Model | |
JP4594712B2 (en) | Image data generation device, development matrix selection device, image data generation processing program, image data generation method, etc. | |
Chandu et al. | Hybrid halftoning using direct multi-bit search (DMS) screen algorithm | |
JP2002101307A (en) | Method and system for generating half tone output image |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
GD4A | Issue of patent certificate for granted invention patent | ||
MK4A | Expiration of patent term of an invention patent |