Ordered Dithering 에 해당하는 글1 개
2008.10.11   [멀티미디어공학]Ordered Dithering


[멀티미디어공학]Ordered Dithering
日新又日新 | 2008. 10. 11. 05:46
#2. Ordered Dithering

 1://------------------[simple dither algorithm start]--------------------
 2:// input : in_img,        output : out_img
 3:int pixel_x, pixel_y;
 4:int i, j;
 5:int level;
 6:int ordermatrix[4][4] = {{0, 8, 2, 10}, {12, 4, 14, 6}, {3, 11, 1, 9}, {15, 7,  13, 5} };
 7:for ( pixel_x = 0 ; pixel_x < XSIZE ; pixel_x++ ) {
 8:    for ( pixel_y = 0 ; pixel_y < YSIZE ; pixel_y++ ) {
 9:        level = in_img[pixel_x][pixel_y] / 16;
10:        i = pixel_x % 4;
11:        j = pixel_y % 4;
12:
13:        if ( level > ordermatrix[i][j] ) {
14:            out_img[pixel_x][pixel_y] = 255;
15:        } else {
16:            out_img[pixel_x][pixel_y] = 0;
17:        }
18:    }
19:}
20://------------------[simple dither algorithm end]--------------------


Simple Dithreing에 비해서 레벨 0일 때의 처리가 없음.
10~11 : Dither Matrix에서 비교할 대상 설정
13~17 : 현재 나눠진 레벨값을 Dither Matrix에서 비교대상과 비교하여 흑/백 결정
         -> 결과 파일에서의 픽셀크기가 변경되지 않음


 
 
 
트랙백 | 댓글



위치로그 : 태그 : 방명록 : 관리자
이우성's Blog is powered by Daum / Designed by SSen
관리자  |  글쓰기
BLOG main image
전, 이우성입니다. ( I am Woosung, Lee. ) ""
 Category
 Media
 TAGS
 Recent Entries
 Recent Comments
 Calendar
 Archive
 Link Site
 Visitor Statistics
+ Total :
+ Today :
+ Yesterday :
카피
rss