Normal Map Generator
Operator: Abdulla Al Fahad. How tools are built and checked
A normal map stores, for every pixel, which way the surface tilts, so a flat quad can be lit as if it had bumps. Red holds the tilt to the right, green the tilt up or down, and blue the part that points out of the surface, which is why most normal maps look lavender. From one photograph there is no real depth to measure, so the page treats brightness as height: dark pits, light peaks. That works well for brick, bark, leather and fabric, where shading follows relief, and poorly for a printed pattern, whose colours say nothing about height.
Key features
- Six maps from one photo: colour (albedo), height, normal, ambient occlusion, roughness and displacement
- Height controls: invert, blur from 0 to 8 px, and a detail gain from 0 to 2 against a coarse copy of the height
- Normals from a Sobel or Scharr filter with a strength from 0.1 to 10 and an OpenGL or DirectX green channel
- AO from cavities below their blurred surroundings, roughness from a luminance curve with a minimum, maximum and contrast, and displacement with black and white points
- A seamless option applied before the maps are made, a 2 × 2 tile preview of any map, and a WebGL plane or sphere under an orbiting light
- Output sizes of 256, 512, 1024, 2048 or 4096 px squares (crop or stretch) or the photo's own shape, with per-map PNGs and a ZIP of all six
- All blur radii and the AO radius defined at 1024 px and scaled to the actual size, so a small preview and a 4096 px export look alike
How each map is derived from the photo
Height is the luminance 0.2126 R + 0.7152 G + 0.0722 B. After the optional invert and blur, the detail control mixes the height with a version blurred at 8 px (at 1024 px): above 1 it exaggerates fine texture against the broad shape, below 1 it flattens it.
The slope at each pixel comes from the 3 × 3 filter you chose, divided by 8 for Sobel or 32 for Scharr and multiplied by 0.04 × strength × the long side in pixels. That scaling makes strength mean the same slope at 512 and at 4096 px. The vector (-slope x, slope y, 1) is normalised and stored as (n + 1) / 2 × 255.
Green is the one place engines disagree. OpenGL convention, used by Blender, Unity and Godot, points green up; DirectX convention, used by Unreal, points it down. Flipping the setting changes only the green channel.
How it works
The seamless step cross-fades the photo with a copy shifted by half its width and height, using a weight that is 1 in the middle and 0 at the borders. At a border the output is the shifted copy, whose opposite edges were neighbours in the original, so the left edge continues into the right one. The price is a soft double exposure in the transition zone, which is why this works best on irregular textures.
With seamless on, the blur, the slope filter and the AO all wrap around the edges, so there is no seam in the normals either.
Typical uses
- A photo of a flagstone path, 4000 × 3000 px, cropped to 1024 × 1024 and made seamless. The roughness curve is set so the dark mortar gaps come out rougher than the stones.
- A leather jacket scan for a game prop: blur at 2 px removes pores that would only add noise, and strength 3 gives stitching visible relief.
- A cracked-plaster wall photographed at noon: detail 0.5 and blur 3 px stop the hairline cracks turning into deep canyons in the normal map.
- A tileable wood floor for an architectural render, exported at 2048 px with the DirectX green channel for Unreal.
Building one
- Drop a photo of a flat surface taken straight on, in even light.
- Choose the size and the green-channel convention for your engine.
- Switch on Make seamless first if the material will repeat, and watch the 2 × 2 tiles view.
- Adjust blur, detail and strength on the Normal view until the relief reads correctly, then check it on the 3D view.
- Download the six maps as a ZIP, or one PNG at a time from the buttons beside it.
Example
A photo of a brick wall (illustrative), 3000 × 2000 px, for a Godot material
Size 1024 (cropped square), Make seamless on, Scharr filter, strength 1.5, blur 1 px, green channel OpenGL, then Download all maps as a ZIPWhat is saved
brick-wall_maps.zip with six 1024 × 1024 PNGs: brick-wall_albedo.png, _height.png, _normal.png, _ao.png, _roughness.png and _displacement.png
For a DirectX engine such as Unreal, switching the green channel and exporting again changes only brick-wall_normal.pngThings to check before you rely on it
Brightness is not height. A white painted line on dark asphalt becomes a raised ridge, and a shadow becomes a groove; use Invert height and the blur to reduce this, but there is no setting that removes it.
A power-of-two size is not enforced for Original shape; the page warns when the output is not a power of two, because many engines resize or refuse to mipmap such textures.
- To confirm your engine's convention, export a normal map of any photo with a clear raised feature and look at it lit from the top: if the feature looks dented, flip the green channel.
- Photos with baked-in shadows turn into false relief; flatten the lighting in a photo editor first, or lower the detail control to 0.5.
Common errors and how to fix them
- The 3D view says it could not start WebGL 2
- The maps, tiles and downloads still work; only the lit preview needs WebGL 2.
- A 4096 px export fails or the tab reloads
- That size needs about 1 GB of memory for the six maps. Export 2048 px, or one map at a time.
Best practices
- Make the maps from the seamless result and use the exported colour map too, because the seamless step alters the albedo as well as the relief.
- Judge strength on the sphere view, where a wrong value shows as a plastic or a blurry surface faster than on the flat map.
- Keep the roughness range wide and then narrow it on the sphere, since photos rarely carry roughness information.
Frequently asked questions
Should I pick Sobel or Scharr?
Both are divided by their own weight sum, so strength means the same slope with either. Scharr weights the middle of each row 10 to 3 where Sobel weights it 2 to 1, which makes it respond a little more to fine grain. Start with Sobel and switch to Scharr if small relief looks flat.
Can a photo give a true height in millimetres?
No. The displacement map is a relative 0 to 1 height from brightness, and you set its real depth in the engine or renderer.
Why does the preview use my colour map when the seamless option is on?
Because the seamless step is applied to the colour image before every map is made, the preview and the exported colour PNG show the tile-ready version, not the original photo.