Canonical: https://toolipedia.app/sdf-texture-generator

# Signed distance field texture generator

Upload a black and white glyph or shape and export a signed distance field image for game engines and shaders, with spread, size and channel options.

Breadcrumbs: Toolipedia > Image tools > Photo editing tools > Signed distance field texture generator

## About Signed distance field texture generator

A signed distance field stores, for every pixel, how far it is from the edge of a shape, so a small texture can be scaled up and still render with crisp edges in a game engine or shader. Upload a black and white glyph or icon, set the threshold, the output size and the spread, and the tool measures exact Euclidean distances inside and outside the shape. Value 128 is the edge, white is deeper inside and black is farther outside. Save a grey image or a white image with the distance in the alpha channel. A 256 pixel wide square has its deepest point 128 pixels from the edge.

## How to use Signed distance field texture generator
1. Choose a black and white picture, or one of the sample shapes, and say whether the shape is light or dark.
2. Set the output size and the spread in output pixels.
3. Check the rebuilt shape below the preview, then download the field as a PNG.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.

## Also known as
- signed distance field texture generator
- sdf generator online
- distance field from image
- sdf font atlas texture
- shader sdf shape texture
- make an sdf from a glyph

## Frequently asked questions

### What does the spread value mean?

It is the distance, in output pixels, that maps to the whole range from the edge to full white or black. A spread of 8 means pixels 8 or more steps inside read 1.0 and 8 or more steps outside read 0.0. Larger spreads allow bigger outlines and glows in the shader.

### Why make the output smaller than the input?

The distance is computed from the sharp, large picture and then sampled into a small texture. That gives accurate edges at a small size, so a 64 pixel field from a 512 pixel glyph can be enlarged without blur.

### How do I use the result in a shader?

Sample the texture, then use a smoothstep around 0.5 to get the shape. Use values below 0.5 for outlines and shadows. Check your engine for whether it expects the distance in the red channel or in alpha.

### Is Signed distance field texture generator free?

Yes. Signed distance field texture generator on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

## Related tools

More free tools that go well with Signed distance field texture generator:
- [Texture Map Generator](https://toolipedia.app/texture-map-generator)
- [Black and white photo](https://toolipedia.app/black-and-white-image)
- [Shift image with wraparound](https://toolipedia.app/shift-image-offset)
- [Crop an Image to a Shape](https://toolipedia.app/crop-an-image-to-a-shape)
- [RGB channel splitter](https://toolipedia.app/rgb-channel-splitter)
