Another adaptive gamma correction implementation

Still a bit unhappy with the results of automatic (adaptive) gamma correction I’m continuing to experiment by writing the implementation of papers in regard to this topic. This time I found a paper with promising results and the title » An adaptive gamma correction for image enhancement « [1].


  1. Transformation results
  2. Implementation
  3. Opinion
  4. References

In the following I do refer to the implemented transformation as AGCIE.

Transformation results

All photos (these are photos I’ve taken) have been scaled and cropped to 1600x1200px and converted to PNG.

1original 1.agagcwd [3] 1.agiagcwd [2] 1.agcagcie [1]
3original 3.agagcwd [3] 3.agiagcwd [2] 3.agcagcie [1]
4original 4.agagcwd [3] 4.agiagcwd [2] 4.agcagcie [1]
6original 6.agagcwd [3] 6.agiagcwd [2] 6.agcagcie [1]
7original 7.agagcwd [3] 7.agiagcwd [2] 7.agcagcie [1]
10original 10.agagcwd [3] 10.agiagcwd [2] 10.agcagcie [1]
12original 12.agagcwd [3] 12.agiagcwd [2] 12.agcagcie [1]
13original 13.agagcwd [3] 13.agiagcwd [2] 13.agcagcie [1]
15original 15.agagcwd [3] 15.agiagcwd [2] 15.agcagcie [1]
16original 16.agagcwd [3] 16.agiagcwd [2] 16.agcagcie [1]
17original 17.agagcwd [3] 17.agiagcwd [2] 17.agcagcie [1]
18original 18.agagcwd [3] 18.agiagcwd [2] 18.agcagcie [1]


The implementation is available under MIT license written in PHP using \Imagick at Github


It’s not as bright as AGCWD and – if you ignore the first three pictures (which have been classified as low contrast bright) on which this method massively failed – still brighter than my previous implementation (IAGCWD). Again, I prefer the results of the AGCWD.


Please mind that AGCIE, AGCWD, IAGCWD are not official abbreviations – it’s just what I used in my blog articles and in the implementation code.

  1. AGCIE:
    Rahman, Shanto & Rahman, Md. Mostafijur & Abdullah-Al-Wadud, M & Al-Quaderi, Golam Dastegir & Shoyaib, Mohammad. (2016). An adaptive gamma correction for image enhancement. EURASIP Journal on Image and Video Processing. 35. 10.1186/s13640-016-0138-1.
  2. IAGCWD:
    Cao, Gang & Huang, Lihui & Tian, Huawei & Huang, Xianglin & Wang, Yongbin & Zhi, Ruicong. (2017). Contrast Enhancement of Brightness-Distorted Images by Improved Adaptive Gamma Correction. CAEE. 10.1016/j.compeleceng.2017.09.012.
  3. AGCWD:
    S. Huang, F. Cheng and Y. Chiu, „Efficient Contrast Enhancement Using Adaptive Gamma Correction With Weighting Distribution,“ in IEEE Transactions on Image Processing, vol. 22, no. 3, pp. 1032-1041, March 2013. doi: 10.1109/TIP.2012.2226047

No Comments

Post a Comment