Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions imagick/magick_wand_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,20 @@ func (mw *MagickWand) ChopImage(width, height uint, x, y int) error {
return mw.getLastErrorIfFailed(ok)
}

// CLAHEImage is a variant of adaptive histogram equalization in which the contrast amplification is limited,
// so as to reduce this problem of noise amplification.
//
// width: the width of the tile divisions to use in horizontal direction
// height: the height of the tile divisions to use in vertical direction
// numberBins: number of bins for histogram ("dynamic range") (usually 256).
// clipLimit: contrast limit for localised changes in contrast. A limit less than 1 results in standard
// non-contrast limited AHE

func (mw *MagickWand) CLAHEImage(width, height uint, numberBins, clipLimit float64) error {
ok := C.MagickCLAHEImage(mw.mw, C.size_t(width), C.size_t(height), C.double(numberBins), C.double(clipLimit))
return mw.getLastErrorIfFailed(ok)
}

// ClampImage Restricts the color range from 0 to the quantum depth
func (mw *MagickWand) ClampImage() error {
ok := C.MagickClampImage(mw.mw)
Expand Down
Loading