Normal map generator
This normal map generator converts an image into a PNG normal map, with strength and blur controls and a lit Three.js cube showing the result.
Raised tiles. Drag the cube preview to turn it.
Sample height image loaded. Upload your own texture or adjust the light relief.
Read height from the image
The raised-tiles sample starts at 256 × 256 pixels. Its light tile centres become high points, and the dark gaps become grooves. The generator compares neighbouring pixel heights and encodes the resulting direction into red, green and blue. On a flat image, every direction points straight out: approximately RGB (128, 128, 255).
Upload a height map when you have one. For a photograph, painted light and shadow also become height changes, so watch the cube while tuning the strength. Transparent areas are filled black before the height calculation. Strength 0 produces a flat map; raising it makes small height differences affect the light more strongly.
Tune blur under moving light
Blur smooths the height image before its slopes are measured. Start at 0 for sharp pixel edges, then add 1 or 2 pixels if tiny variations look noisy. The cube uses a warm key light and a cool rim light, so different faces show the same map under different lighting. Pause rotation to compare a single edge, or drag the cube to turn it yourself.
The two flat previews show the source and the actual exported RGB map. The rotating view uses that same generated PNG as its material normal map. OpenGL and DirectX change the green convention, while the preview adjusts its Y scale to match. Choose the convention expected by your receiving material rather than editing the colors by eye.
Load the normal PNG in Three.js
Choose OpenGL above, save normal-map.png in your project and assign it to a material's normalMap. Normal textures describe directions, so keep the texture in its non-color data space. The preview uses Three.js 0.180.0, bundled locally under its MIT notice. Three.js documents these material inputs in MeshStandardMaterial.
const normal = new THREE.TextureLoader().load("./normal-map.png");
normal.colorSpace = THREE.NoColorSpace;
const material = new THREE.MeshStandardMaterial({
color: 0xc58c56, roughness: 0.6, normalMap: normal
});Choose the map workflow for your game
NormalMap-Online by cpetry also processes height maps in the browser, with a 3D preview and additional displacement and ambient-occlusion outputs. NormalMap AI offers a broader set of generated material maps. Compare those when your game needs a full material set.
This workspace keeps the source, RGB output and game-material preview together for one normal PNG. Export after checking the map on a rotating surface. For a game's first material, try the raised-tiles sample on a floor or wall, then use a matching color image for its surface color. A normal map adds lighting detail without changing that object's silhouette.
Questions
What is a normal map generator?
A normal map generator turns the height changes in an image into RGB surface directions that a 3D material uses for lighting. This tool reads light pixels as high and dark pixels as low, then previews the generated map on a lit Three.js cube.
How do I turn an image into a normal map?
Choose a PNG, JPEG or WebP, adjust Strength and Blur, inspect the cube and download Export normal PNG. Processing stays in the browser. Images above 1024 pixels on their longest side are resized for the working map; the export matches that working size.
What is the difference between OpenGL and DirectX normal maps?
They use opposite signs for the green channel's Y direction. OpenGL is the default here for Three.js. Selecting DirectX flips green in the exported PNG; the cube compensates for that convention so its surface still looks raised.
Does a normal map change the shape of the cube?
No. It changes the direction used for lighting each surface pixel. The cube's outline and geometry stay the same. Use displacement or extra mesh detail when a surface needs a raised silhouette.
Put your assets into a playable game. Try the ten game templates or get the kit.