Images

Make the normal map of an image, for 2.5D lighting: a lossless WebP of the same size and alpha as the image (transparent pixels are flat), in the OpenGL convention (red = right, green = up, blue = towards the viewer; Unity and Godot read it as is, Unreal expects green flipped). Pixel art gets one normal per art pixel, and the map of a seamless tile tiles the same way. An image you generated on Ludo is read with its type and pixel grid; for any other image pixel art is detected. Free, and limited to 20 calls per 5 minutes, 120 an hour and 1000 a day (HTTP 429 beyond). To get maps with new images or spritesheets, pass save_normals: true to the generation instead. The image is uploaded and validated, and an image larger than 15MB is rejected with HTTP 400. Requires an API key (user scope). The call returns 202 with a job id - poll `GET /assets/jobs/{id}`, honouring poll_after_ms or long-polling with wait=30, until status is succeeded; its result field is exactly the response documented for this operation. Synchronous responses are deprecated but still supported: pass `async: false` to block until the result is ready and receive it as the response body. Synchronous calls run on the same queue: the response carries an X-Ludo-Job-Id header, and a job still running after 15 minutes comes back as 202 with the job instead of an error. Each account may have up to 50 generations queued or running at once via the API; a request beyond that returns 429 (code PENDING_JOBS_LIMIT).

Changed on
post/assets/image/normal-map

Request

  • Base URL
    https://api.ludo.ai/api
  • Auth
    API key in header Authorization

Request body

imagestring required

URL or base64-encoded image, opaque or a cut-out. An image you generated on Ludo in the last 30 days, given by its URL, is read with its type and pixel grid.

request_idstring

Optional client-provided identifier, unique per request. Re-sending the same request_id returns the existing job instead of generating again.

asyncboolean

Defaults to true: the call returns 202 immediately with a job id to poll with getApiJob. Set false for a synchronous response (deprecated but supported): the call then blocks until the result is ready.

Response

Success

urlstring

URL of the image the map was made from.

normal_map_urlstring

URL of the normal map, a lossless WebP of the same size and alpha as the image.

Changes