hip-1.0.1.1: Haskell Image Processing (HIP) Library.

Copyright(c) Alexey Kuleshevich 2016
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Graphics.Image.IO.Histogram

Description

 

Synopsis

Documentation

data Histogram Source

A single channel histogram of an image.

Constructors

Histogram 

Fields

hBins :: Vector Int

Vector containing pixel counts. Index of a vector serves as an original pixel value.

hName :: String

Name of the channel that will be displayed in the legend.

hColour :: AlphaColour Double

Color of a plotted line.

getHistograms :: forall arr cs e. (SequentialArray arr Gray e, SequentialArray arr cs e, Elevator e) => Image arr cs e -> [Histogram] Source

Create a histogram per channel with 256 bins each.

getHistogram :: (SequentialArray arr Gray e, Elevator e) => Image arr Gray e -> Histogram Source

Generate a histogram with 256 bins for a single channel Gray image.

displayHistograms :: [Histogram] -> IO (Maybe ThreadId) Source

Display image histograms using an external program. Works the same way as displayImage.

>>> frog <- readImageRGB "images/frog.jpg"
>>> displayHistograms $ getHistograms frog

writeHistograms :: FilePath -> [Histogram] -> IO () Source

Write histograms into a PNG image file.

>>> frog <- readImageRGB "images/frog.jpg"
>>> writeHistograms "images/frog_histogram.png" $ getHistograms frog