Implementation of DIP Algorithms in JS

Transform an image \( f:X\times Y \to \{a,\dots, b\} \) to \( g:X\times Y \to \{c,\dots, d\} \)


Algorithm

  1. Step 1: \( min = Min\{f(x,y) | 0 \leq x \leq m-1, 0 \leq y \leq n-1 \} \)
  2. Step 2: \( g(x,y) = f(x, y) - min \)
  3. Step 3: \( max = Max\{g(x,y) | 0 \leq x \leq m-1, 0 \leq y \leq n-1 \} \)
  4. Step 4: \( g(x,y) = \dfrac{g(x, y)}{max} \)
  5. Step 5: \( g(x,y) = (d-c)\cdot g(x,y) \)
  6. Step 6: \( g(x,y) = g(x,y) + c \)

Demo

Base Image
Greyscale Image
Processed Image