module CrImage::Operation::HistogramEqualize

Overview

Provides methods for histogram and histogram equalization. Follows method outlined here

If an image is particularly dark or particularly bright with low contrast, the Operation::Contrast#contrast method will only make the image darker or lighter. For images like these, equalizing the image along its histogram will produce better results.

A dark image of Mt. Fuji
image.contrast(10).save("contrast.jpg")
image.histogram_equalize.save("equalized.jpg")
Darker image of Mt. Fuji A higher contrast image of Mt. Fuji

This method does not work well when a given method has a bimodal distribution of color pixels. For example:

Woman in black turtleneck on white background in grayscale Highly pixelated and poor quality photo of woman in black turtleneck on white background in grayscale

Direct including types

Defined in:

cr-image/operation/histogram.cr

Instance Method Summary

Instance Method Detail

def histogram(channel_type : ChannelType) : Histogram #

[View source]
def histogram_equalize : self #

[View source]
def histogram_equalize! : self #

[View source]