Skip to content

Image processor API

This specification defines the HTTP API used by Mankai remote image processors. A user adds the server’s base URL in Settings → Image Processing. Mankai reads the processor metadata, shows the server-defined configuration fields, and sends each reader image to the server when the processor is enabled.

For setup and everyday use in the app, see Image processing.

Method Path Authentication Purpose
GET / Never Return processor metadata and configuration
POST /process Optional Process one image
POST /auth/login Never Sign in when authentication is enabled
POST /auth/refresh Never Refresh an access token

The URL entered by the user is the base URL. For example, entering https://images.example.com/mankai makes the processing endpoint https://images.example.com/mankai/process.

Response — 200 OK

interface ImageProcessorInfo {
id: string // Stable server/processor identifier
name?: string
version?: string
description?: string
authors?: string[] // Default: []
repository?: string
authenticationEnabled?: boolean // Default: false
configs?: Config[] // Default: []
}
type ConfigType =
'text' | 'password' | 'number' | 'slider' | 'boolean' | 'select' | 'color'
interface Config {
key: string // Unique within this processor
name: string // User-facing label or localization key
description?: string
type: ConfigType
defaultValue: string | number | boolean
options?: string[] // Used by "select"
min?: number // Used by "slider"
max?: number // Used by "slider"
step?: number // Used by "slider"
supportsOpacity?: boolean // Used by "color", defaults to false
}

Example:

{
"id": "com.example.manga-denoise",
"name": "Manga Denoise",
"version": "1.0.0",
"description": "Removes scan noise while preserving line art.",
"authors": ["Example Lab"],
"repository": "https://example.com/manga-denoise",
"authenticationEnabled": false,
"configs": [
{
"key": "strength",
"name": "Strength",
"description": "Higher values remove more noise.",
"type": "slider",
"defaultValue": 0.5,
"min": 0,
"max": 1,
"step": 0.1
},
{
"key": "preserveText",
"name": "Preserve text",
"type": "boolean",
"defaultValue": true
}
]
}

The request uses multipart/form-data so the image remains binary. It contains exactly these named parts:

Part Content type Value
image image/png The current pipeline image as a PNG file
configs application/json All current server-defined configuration values
context application/json The reader display size in logical points

configs uses the same key/value shape as the JavaScript plugin configuration API:

interface ConfigValue {
key: string
value: string | number | boolean
}
type ConfigValues = ConfigValue[]

Example configs part:

[
{ "key": "strength", "value": 0.8 },
{ "key": "preserveText", "value": true }
]

The context part has this shape:

interface ProcessContext {
pointSize: {
width: number
height: number
}
}

The server must return the processed image directly with a 2xx status and an image/* Content-Type. PNG, JPEG, WebP, HEIF, and any other image format supported by the client platform are allowed. The response is passed to the next configured image processor, so the server should preserve enough resolution and image quality for subsequent processing and reading.

Set authenticationEnabled to true to make POST /process require JWT bearer authentication. Mankai then shows username and password fields and uses the same token flow as its HTTP plugins.

Request body

{
"username": "user",
"password": "secret"
}

Response — 200 OK

{
"accessToken": "short-lived JWT",
"refreshToken": "long-lived refresh token"
}

Request body

{
"refreshToken": "long-lived refresh token"
}

Response — 200 OK

{
"accessToken": "new short-lived JWT"
}