Table of Contents

Enum PixelMath

Namespace
Egami.Operations
Assembly
Egami.dll

An arithmetic operation with a constant, for Arithmetic(PixelMath, float, ColorChannels): ImageMagick's -evaluate operators.

public enum PixelMath

Fields

Add = 0

v + value.

Divide = 3

v / value; dividing by 0 divides by the smallest positive number instead.

Log = 5

log(value · v + 1) / log(value + 1): brightens shadows, more strongly as value grows.

Max = 7

The larger of v and value.

Min = 6

The smaller of v and value.

Multiply = 2

v · value.

Pow = 4

v raised to the power value.

Set = 8

value, whatever v is.

Subtract = 1

v − value.

Examples

// Lift the shadows with a log curve, then cap the highlights; values are on a 0 to 1 scale, as ImageMagick's -evaluate.
photo.Apply(ops => ops
    .Arithmetic(PixelMath.Log, 3)
    .Arithmetic(PixelMath.Min, 0.95f), Ct);