A Julia package for enhancing and manipulating image contrast.

## Getting started

This package is part of a wider Julia-based image processing ecosystem. If you are starting out, then you may benefit from reading about some fundamental conventions that the ecosystem utilizes that are markedly different from how images are typically represented in OpenCV, MATLAB, ImageJ or Python.

The usage examples in the ImageContrastAdjustment.jl package assume that you have already installed some key packages. Notably, the examples assume that you are able to load and display an image. Loading an image is facilitated through the FileIO.jl package, which uses QuartzImageIO.jl if you are on MacOS, and ImageMagick.jl otherwise. Depending on your particular system configuration, you might encounter problems installing the image loading packages, in which case you can refer to the troubleshooting guide.

Image display is typically handled by the ImageView.jl package. However, there are some known issues with this package. For example, on Windows the package has the side-effect of introducing substantial input lag when typing in the Julia REPL. Also, as of writing, some users of MacOS are unable to use the ImageView.jl package.

As an alternative, one can display an image using the Makie.jl plotting package. There is also the ImageShow.jl package which facilitates displaying images in Jupyter notebooks via IJulia.jl.

Finally, one can also obtain a useful preview of an image in the REPL using the ImageInTerminal.jl package. However, this package assumes that the terminal uses a monospace font, and tends not to produce adequate results in a Windows environment.

Another package that is used to illustrate the functionality in ImageContrastAdjustment.jl is the TestImages.jl which serves as a repository of many standard image processing test images.

## Basic usage

Each contrast manipulation algorithm in ImageContrastAdjustment.jl is an AbstractHistogramAdjustmentAlgorithm.

Suppose one wants to enhance the contrast an image. This can be achieved by simply choosing an appropriate algorithm and calling adjust_histogram or adjust_histogram! in the image. The contrast will be automatically enhanced.

Let's see a simple demo:

using TestImages, ImageContrastAdjustment
img = testimage("cameraman")
alg = Equalization(nbins = 256)
img_adjusted = adjust_histogram(img, alg)
[ Info: Could not find cameraman in directory images/ . Checking if it exists in the online repository.
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   144    0   144    0     0    289      0 --:--:-- --:--:-- --:--:--   289

100   155  100   155    0     0    252      0 --:--:-- --:--:-- --:--:--   252

86  256k   86  223k    0     0   244k      0  0:00:01 --:--:--  0:00:01  244k
100  256k  100  256k    0     0   279k      0 --:--:-- --:--:-- --:--:-- 8360k

This usage reads as "adjust_histogram of the image img with algorithm alg"