4

I am using image-js.

I have looked at the documentation and I do not see a function called normalize or histogram stretching. However I do see some histogram functions. Can I use the histogram functions to do a normalization on a grayscale PNG array of height values?

The image array is values of heights from range 0 - 255 black being lowest height white highest. I am using this array to create a grayscale heightmap image.

Clarify:

By normalize I mean normalizing an image colors in this case the grayscale. Like this project but using image-js https://www.npmjs.com/package/@jimp/plugin-normalize

The normalization I want to accomplished is described in this GIMP doc and listed below

From GIMP: 8.10. Normalize

The Normalize command scales the brightness values of the active layer so that the darkest point becomes black and the brightest point becomes as bright as possible, without altering its hue. This is often a “magic fix” for images that are dim or washed out. “Normalize” works on layers from RGB, Grayscale, and Indexed images.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
dan
  • 2,857
  • 6
  • 34
  • 60
  • What **exactly** do you mean by "normalize" in the first place? In the context of image processing you could be referring to any of dozens (if not hundreds?) of different factors that could be normalized. Brightness? Gamut? In what color space? Etc... – Dai Oct 16 '21 at 13:22
  • Normalize an image colors in this case the grayscale. Like this project but using image-js https://www.npmjs.com/package/@jimp/plugin-normalize – dan Oct 16 '21 at 13:41
  • that doesn't explain what you consider "normalize". **A LOT** of things are considered "normalize". – Christoph Rackwitz Oct 16 '21 at 13:56

0 Answers0