Skip to content

Power Law Transformation

Jeet edited this page Jul 26, 2022 · 1 revision

Power-Law or Gamma Transformation shows completely different treatment for gamma values less than 1 and more than 1

Command Line

Original image:

Original Image

Levels = 128, Gamma = 0.8:

$loomis -command power_law -levels 128 -gamma 0.8 testdata/green-bee-eater-grayscale.jpg

Levels = 128, Gamma = 0.8

Levels = 128, Gamma = 2.5:

$loomis -command power_law -levels 128 -gamma 2.5 testdata/green-bee-eater-grayscale.jpg

Levels = 128, Gamma = 2.5

Levels = 128, Gamma = 3.5:

$loomis -command power_law -levels 128 -gamma 3.5 testdata/green-bee-eater-grayscale.jpg

Levels = 128, Gamma = 3.5

NOTE: The whitewashing of values at higher gamma tells me there is a scaling bug in my code while handling higher values of intensities after transformation.

Library Usage

newImage := pkg.PowerLawTransformation(image, levels, gamma)

image is of type image.Image
levels is an integer representing number of intensities (2-255)
gamma is a float. Values less than 1 are allowed

Clone this wiki locally