{
  "openapi": "3.1.1",
  "info": {
    "title": "Seamless Noise Texture Generator API",
    "version": "1.0.0",
    "summary": "Generate tileable Perlin, value, simplex or Voronoi noise as an 8- and 16-bit PNG.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://renderloomnoisetexture.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Generate tileable Perlin, value, simplex or Voronoi noise as an 8- and 16-bit PNG.",
        "description": "Pick Perlin, value, simplex or Voronoi (Worley) noise, set the cells per tile, octaves, persistence and an optional domain warp, and download a seamless grayscale PNG, a 16-bit height PNG and a 2 × 2 repeat that proves the tiling. The result opens as a graph in Renderloom Material Nodes.\n\nMethodology:\n- Noise is generated directly on the periodic tile, so it repeats without blending or mirroring. Perlin and value noise wrap their lattice indices modulo the cell count; simplex noise is sampled on a torus in 4-D (x and y each become a circle); Voronoi feature points repeat with the cell grid and the search covers 5 × 5 cells.\n- Octaves double the frequency and multiply the amplitude by the persistence. Fractal sum maps −1…1 to 0…1; turbulence sums absolute values; ridged sums (1 − |n|)². Contrast scales the result around its midpoint (around 0 for turbulence). Values are clamped to 0–1.\n- Seed 0 with Perlin noise uses Ken Perlin’s reference permutation: the generator reproduces his reference value noise(3.14, 42, 7) = 0.13691995878400012. Other seeds shuffle the permutation deterministically; Voronoi points use a 32-bit integer hash.\n- Voronoi distances are in cell widths (F1 is at most about 0.71 for jitter 0) and clamped to 0–1. The optional domain warp displaces the noise by a second Perlin field with wrap-around sampling.\n- The continuity check compares the steps across the wrap edges with the steps inside the tile. The 16-bit PNG stores the same values with 65536 levels for height maps.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "renderloom_noise_texture",
        "x-owner-app": "renderloom",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenderloomNoiseTextureInput"
              },
              "examples": {
                "example1": {
                  "summary": "Perlin fBm, 5 octaves",
                  "value": {}
                },
                "example2": {
                  "summary": "Ridged simplex with a domain warp",
                  "value": {
                    "kind": "simplex",
                    "style": "ridged",
                    "scaleX": 4,
                    "scaleY": 4,
                    "octaves": 6,
                    "warp": 0.06,
                    "seed": 9,
                    "size": 192
                  }
                },
                "example3": {
                  "summary": "Voronoi cell edges for stones or cracks",
                  "value": {
                    "kind": "worley-edge",
                    "scaleX": 8,
                    "scaleY": 8,
                    "jitter": 1,
                    "seed": 3,
                    "size": 128
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenderloomNoiseTextureResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "RenderloomNoiseTextureInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "title": "Noise type",
            "type": "string",
            "enum": [
              "perlin",
              "value",
              "simplex",
              "worley-f1",
              "worley-f2",
              "worley-edge",
              "worley-cells"
            ],
            "default": "perlin"
          },
          "style": {
            "title": "Octave style (Perlin, value, simplex)",
            "type": "string",
            "enum": [
              "fbm",
              "turbulence",
              "ridged"
            ],
            "default": "fbm"
          },
          "scaleX": {
            "title": "Horizontal cells per tile",
            "type": "integer",
            "minimum": 1,
            "maximum": 64,
            "default": 6
          },
          "scaleY": {
            "title": "Vertical cells per tile",
            "type": "integer",
            "minimum": 1,
            "maximum": 64,
            "default": 6
          },
          "octaves": {
            "title": "Octaves",
            "type": "integer",
            "minimum": 1,
            "maximum": 8,
            "default": 5
          },
          "persistence": {
            "title": "Persistence (gain per octave)",
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.5
          },
          "contrast": {
            "title": "Contrast",
            "type": "number",
            "minimum": 0.1,
            "maximum": 4,
            "default": 1
          },
          "jitter": {
            "title": "Voronoi jitter",
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.9
          },
          "warp": {
            "title": "Domain warp (fraction of the tile)",
            "type": "number",
            "minimum": 0,
            "maximum": 0.25,
            "default": 0
          },
          "seed": {
            "title": "Seed",
            "type": "integer",
            "minimum": 0,
            "maximum": 999999,
            "default": 0
          },
          "size": {
            "title": "Texture size (px)",
            "type": "integer",
            "minimum": 32,
            "maximum": 1024,
            "default": 256
          }
        },
        "required": []
      },
      "RenderloomNoiseTextureResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "size",
              "minimum",
              "maximum",
              "mean",
              "continuity",
              "texture",
              "texture16",
              "repeat",
              "projectFile",
              "openInApp"
            ],
            "properties": {
              "size": {
                "type": "integer"
              },
              "minimum": {
                "type": "number"
              },
              "maximum": {
                "type": "number"
              },
              "mean": {
                "type": "number"
              },
              "continuity": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "wrapMean",
                  "interiorMean",
                  "wrapMax",
                  "interiorMax",
                  "seamless"
                ],
                "properties": {
                  "wrapMean": {
                    "type": "number"
                  },
                  "interiorMean": {
                    "type": "number"
                  },
                  "wrapMax": {
                    "type": "number"
                  },
                  "interiorMax": {
                    "type": "number"
                  },
                  "seamless": {
                    "type": "boolean"
                  }
                }
              },
              "texture": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "artifactId",
                  "filename",
                  "mime",
                  "bytes",
                  "sha256",
                  "path"
                ],
                "properties": {
                  "artifactId": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "mime": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer"
                  },
                  "sha256": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string",
                    "description": "Download path on the same site (valid for about 2 hours)."
                  }
                }
              },
              "texture16": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "artifactId",
                  "filename",
                  "mime",
                  "bytes",
                  "sha256",
                  "path"
                ],
                "properties": {
                  "artifactId": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "mime": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer"
                  },
                  "sha256": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string",
                    "description": "Download path on the same site (valid for about 2 hours)."
                  }
                }
              },
              "repeat": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "artifactId",
                  "filename",
                  "mime",
                  "bytes",
                  "sha256",
                  "path"
                ],
                "properties": {
                  "artifactId": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "mime": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer"
                  },
                  "sha256": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string",
                    "description": "Download path on the same site (valid for about 2 hours)."
                  }
                }
              },
              "projectFile": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "artifactId",
                  "filename",
                  "mime",
                  "bytes",
                  "sha256",
                  "path"
                ],
                "properties": {
                  "artifactId": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "mime": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer"
                  },
                  "sha256": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string",
                    "description": "Download path on the same site (valid for about 2 hours)."
                  }
                }
              },
              "openInApp": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}