顯示具有 Java 標籤的文章。 顯示所有文章
顯示具有 Java 標籤的文章。 顯示所有文章

2009年12月2日 星期三

Brightness Calculator


The calculation of brightness is simple to do on single pixel. But there is no widget or tool for calculation of the average brightness of a photo. So, I wrote a simple tool for average brightness calculation, looking like as following:


The usage is simple, just clicking the "Add Files" button to pick a photo that Java supports and getting the average brightness of the photo in the table.

The link is here.

2009年3月20日 星期五

RGB to Gray Level 小工具

福克斯最近在研究如何在 OLED 上省電。經過一些調查發現,許多 OLED 上的省電方式多是採用灰階 (gray level) 的方式來當成參數計算。可是,福克斯之前並沒學過影像處理,就只好拜 google 大神。

在拜完後,發現了以下的這個公式:

gray level = 0.299 * R + 0.587 * G + 0.114 * B

這個公式真的很奇怪,據說是照自然界出現這三元色的比例算出來的。不過福克斯還是有點不大相信這件事。如果大家知道這三個數字是用什麼方式得到,還請跟福克斯說一聲囉。

以下就是這個小工具的畫面:


它的使用方式很簡單,只有兩個功能:
1. 轉灰階
2. 查看該點的灰階值


基本上,大家問說怎麼不做儲存,福克斯在這回答:原則上這個功能每個看圖軟體都有,而且他們多是採用 C 或 C++ 的方式寫出來的,所以效能會比較好,幹嘛不去用他們的來轉。福克斯做這個出來,僅是想做一個練習,並且開放一個範例實作出來而己。

如果大家有興趣,可以在這裡下載到原始碼