mrdoob / texgen.js

JavaScript Texture Generator
http://texgenjs.org/
MIT License
1.8k stars 130 forks source link

Added Normalize #25

Closed DGruenwald closed 9 years ago

DGruenwald commented 9 years ago

The normalize filter maps the colors of the image to values between 0 and 1, so that the lowest point is at 0 and the highest at 1. This is especially useful for gradient maps.

For example, by default sines are generated from -1 to 1. After normalization the high points are still at 1 but the low points are now at 0 and everything in between has been modified accordingly:

sine normalized sine

mrdoob commented 9 years ago

Oh, I was aware of the -1 to 1 sines situation but couldn't come up with a solution for it. This is nice! :)

mrdoob commented 9 years ago

Many thanks!