DistancePNGQUANT | Image Quantization Library (image-q)

TODO: check quality of this distance equation TODO: ask author for usage rights taken from: http://stackoverflow.com/questions/4754506/color-similarity-distance-in-rgba-color-space/8796867#8796867 https://github.com/pornel/pngquant/blob/cc39b47799a7ff2ef17b529f9415ff6e6b213b8f/lib/pam.h#L148

### Hierarchy

- DistancePNGQUANT

### Implements

- IDistanceCalculator

## Index

### Constructors

- constructor

### Properties

- _maxDistance
- _whitePoint

### Methods

- _colordifference_ch
- calculateNormalized
- calculateRaw
- setWhitePoint

## Constructors

### constructor

- new DistancePNGQUANT(): DistancePNGQUANT

- - Defined in distance/pngQuant.ts:20

  #### Returns DistancePNGQUANT

## Properties

### Private _maxDistance

_maxDistance: number

- Defined in distance/pngQuant.ts:20

### Private _whitePoint

_whitePoint: object

- Defined in distance/pngQuant.ts:19

#### Type declaration

- ##### a: number

- ##### b: number

- ##### g: number

- ##### r: number

## Methods

### Private _colordifference_ch

- _colordifference_ch(x: number, y: number, alphas: number): number

- - Defined in distance/pngQuant.ts:35

  #### Parameters

  - ##### x: number

  - ##### y: number

  - ##### alphas: number

  #### Returns number

### calculateNormalized

- calculateNormalized(colorA: Point, colorB: Point): number

- - Defined in distance/pngQuant.ts:31

  #### Parameters

  - ##### colorA: Point

  - ##### colorB: Point

  #### Returns number

### calculateRaw

- calculateRaw(r1: number, g1: number, b1: number, a1: number, r2: number, g2: number, b2: number, a2: number): number

- - Defined in distance/pngQuant.ts:44

  #### Parameters

  - ##### r1: number

  - ##### g1: number

  - ##### b1: number

  - ##### a1: number

  - ##### r2: number

  - ##### g2: number

  - ##### b2: number

  - ##### a2: number

  #### Returns number

### setWhitePoint

- setWhitePoint(r: number, g: number, b: number, a: number): void

- - Defined in distance/pngQuant.ts:26

  #### Parameters

  - ##### r: number

  - ##### g: number

  - ##### b: number

  - ##### a: number

  #### Returns void

Generated using TypeDoc