Presentation is loading. Please wait.

Presentation is loading. Please wait.

多媒體安全 Macros Examples Gamma.txt 報告學生:碩專 2A 王朝鵬 (9624713) 指導教授:黃文楨 博士.

Similar presentations


Presentation on theme: "多媒體安全 Macros Examples Gamma.txt 報告學生:碩專 2A 王朝鵬 (9624713) 指導教授:黃文楨 博士."— Presentation transcript:

1 多媒體安全 Macros Examples Gamma.txt 報告學生:碩專 2A 王朝鵬 (9624713) 指導教授:黃文楨 博士

2 何謂 Gamma Value ? 簡單來說, Gamma 是對比的度量工具,亦即 中間色調數值的亮度,由如電腦螢幕等的裝 置產生,或者產生於拍攝的影像中。較高的 Gamma 值會產生整體上較暗的影像。 Windows 系統使用的 Gamma 值 ( 通常是 2.2) 比 Mac OS 系統為高 ( 通常是 1.8) ,結果相同 的影像在 Windows 系統上看來就明顯地比在 Mac OS 系統上暗。 提高 gamma 會讓提高整體影像的反差 所謂的 Gamma 是指亮度的變化曲線其數學關 係為 L=X^r ,類似底片的特性曲線,提高 gamma 會讓提高整體影像的反差。

3 Garma.txt 巨集 – 亮度調整 包含三個巨集: 1. Gamma 2. Reset Gamma 3. Show LUT 變數宣告: var gamma = 1;

4 (1) Gamma 1.macro “Gamma [F1]” { 2.getLut(r, g, b); 3.gamma = getNumber(“Gamma (0.1 - 5.0):”, gamma); 4.for (i=0; i<256; i++) { 5.r[i] = pow(r[i]/255, gamma)*255; } 6.setLut(r, r, r); 7.} 定義 F1 快速鍵 顯示輸入視窗並取得所輸入 的 Gamma 值,預設是 1 計算新的的 Gamma 值 重新以 R 陣列的值設定整個 LUT 表 讀取圖片的 LUT 表

5 (2) Reset Gamma 1.macro "Reset Gamma [F2]" { 2.getLut(r, g, b); 3.for (i=0; i<256; i++) { 4.r[i]=i; 5.} 6.setLut(r, r, r); 7.} 定義 F2 快速鍵 讀取圖片的 LUT 表 計算新的的 Gamma 值 重新以 R 陣列的值設定整個 LUT 表

6 (3) Show LUT 1.macro "Show LUT" { 2.run("Show LUT"); 3.} 呼叫內建功能顯示檢視表

7 Function – getLut() 用法: getLut(reds, greens, blues) 說明: Returns three arrays containing the red, green and blue intensity values from the current lookup table.

8 Function – getNumber() 用法: getNumber(“prompt”, defaultValue) 說明: Displays a dialog box and returns the number entered by the user. The first argument is the prompting message and the second is the value initially displayed in the dialog. Exits the macro if the user clicks on "Cancel" in the dialog. Returns defaultValue if the user enters an invalid number.

9 Function – setLut() 用法: setLut(reds, greens, blues) 說明: Creates a new lookup table and assigns it to the current image. Three input arrays are required, each containing 256 intensity values.

10 執行過程

11 轉換圖片格式為 32Bit 的灰階圖片

12 執行過程

13

14

15

16


Download ppt "多媒體安全 Macros Examples Gamma.txt 報告學生:碩專 2A 王朝鵬 (9624713) 指導教授:黃文楨 博士."

Similar presentations


Ads by Google