{"openapi":"3.1.0","info":{"title":"Pixelmath API","version":"0.1.0","description":"A fully local image resize/crop/DPI calculator toolkit: print-resolution math, effective DPI, aspect-ratio identification and crop math, resize/upscale-risk math, cover-fit crop, megapixel calculation, print-size-at-DPI tables, and DPI-quality tiers.\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://pixelmath.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"hr@unifydynamics.com","url":"https://connectorbay.com/pixelmath/docs"},"termsOfService":"https://connectorbay.com/pixelmath/terms"},"servers":[{"url":"https://pixelmath.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/pixelmath/docs"},"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/pixels_for_print":{"post":{"operationId":"pixels_for_print","summary":"Computes the pixel dimensions needed to print at a given physical size and DPI (pixels = inches x DPI), plus","description":"Computes the pixel dimensions needed to print at a given physical size and DPI (pixels = inches x DPI), plus\n    the resulting megapixel count. Use for \"what resolution do I need to print an 8x10 at 300 dpi\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"width_in":{"description":"Target print width in inches.","examples":[8],"exclusiveMinimum":0,"maximum":1000,"title":"Width In","type":"number"},"height_in":{"description":"Target print height in inches.","examples":[10],"exclusiveMinimum":0,"maximum":1000,"title":"Height In","type":"number"},"dpi":{"description":"Target print resolution in dots per inch.","examples":[300],"exclusiveMinimum":0,"maximum":10000,"title":"Dpi","type":"number"}},"required":["width_in","height_in","dpi"],"title":"pixels_for_printArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/effective_dpi":{"post":{"operationId":"effective_dpi","summary":"Computes the actual DPI a given pixel count works out to at a target print size, using the lower (limiting)","description":"Computes the actual DPI a given pixel count works out to at a target print size, using the lower (limiting)\n    of the width- and height-based DPI figures when the aspect ratio doesn't match exactly. Use for \"what's the\n    effective dpi of a 3000x2000 image printed at 10x8\", \"is my image high-res enough for this print size\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"width_px":{"description":"Image width in pixels.","examples":[3000],"exclusiveMinimum":0,"maximum":200000,"title":"Width Px","type":"integer"},"height_px":{"description":"Image height in pixels.","examples":[2000],"exclusiveMinimum":0,"maximum":200000,"title":"Height Px","type":"integer"},"print_width_in":{"description":"Intended print width in inches.","examples":[10],"exclusiveMinimum":0,"maximum":1000,"title":"Print Width In","type":"number"},"print_height_in":{"description":"Intended print height in inches.","examples":[6.67],"exclusiveMinimum":0,"maximum":1000,"title":"Print Height In","type":"number"}},"required":["width_px","height_px","print_width_in","print_height_in"],"title":"effective_dpiArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/aspect_ratio_identify":{"post":{"operationId":"aspect_ratio_identify","summary":"Simplifies a width/height pair into a reduced integer ratio (when both are whole numbers) and names the","description":"Simplifies a width/height pair into a reduced integer ratio (when both are whole numbers) and names the\n    closest common aspect ratio (1:1, 4:3, 3:2, 16:9, 21:9, portrait equivalents, ...). Use for \"what aspect ratio\n    is 1920x1080\", \"simplify the ratio 4000:3000\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"width":{"description":"Width in any unit (pixels, inches, ...).","examples":[1920],"exclusiveMinimum":0,"title":"Width","type":"number"},"height":{"description":"Height in the same unit.","examples":[1080],"exclusiveMinimum":0,"title":"Height","type":"number"}},"required":["width","height"],"title":"aspect_ratio_identifyArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/aspect_ratio_crop":{"post":{"operationId":"aspect_ratio_crop","summary":"Computes the largest centered crop box of a source image matching a target aspect ratio, plus the offsets","description":"Computes the largest centered crop box of a source image matching a target aspect ratio, plus the offsets\n    and percent of original area kept. Use for \"crop 4000x3000 to 16:9\", \"crop this image to a square\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"source_w":{"description":"Source image width in pixels.","examples":[4000],"exclusiveMinimum":0,"maximum":200000,"title":"Source W","type":"integer"},"source_h":{"description":"Source image height in pixels.","examples":[3000],"exclusiveMinimum":0,"maximum":200000,"title":"Source H","type":"integer"},"target_ratio":{"description":"'W:H' (e.g. '16:9') or a decimal (e.g. 1.778).","examples":["16:9"],"title":"Target Ratio","type":"string"}},"required":["source_w","source_h","target_ratio"],"title":"aspect_ratio_cropArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/resize_calculator":{"post":{"operationId":"resize_calculator","summary":"Computes the missing dimension from a target width, height, or scale percentage while preserving aspect","description":"Computes the missing dimension from a target width, height, or scale percentage while preserving aspect\n    ratio, plus the scale factor and an upscale quality-risk flag. Use for \"resize 4000x3000 to 1200 wide\", \"scale\n    this image down to 50%\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"source_w":{"description":"Source width in pixels.","examples":[4000],"exclusiveMinimum":0,"maximum":200000,"title":"Source W","type":"integer"},"source_h":{"description":"Source height in pixels.","examples":[3000],"exclusiveMinimum":0,"maximum":200000,"title":"Source H","type":"integer"},"target_w":{"anyOf":[{"exclusiveMinimum":0,"maximum":200000,"type":"integer"},{"type":"null"}],"default":null,"description":"Target width in pixels — give exactly one of target_w/target_h/scale_pct.","title":"Target W"},"target_h":{"anyOf":[{"exclusiveMinimum":0,"maximum":200000,"type":"integer"},{"type":"null"}],"default":null,"description":"Target height in pixels.","title":"Target H"},"scale_pct":{"anyOf":[{"exclusiveMinimum":0,"maximum":10000,"type":"number"},{"type":"null"}],"default":null,"description":"Scale as a percentage of the original (e.g. 50 for half size, 200 for double).","title":"Scale Pct"}},"required":["source_w","source_h"],"title":"resize_calculatorArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/cover_fit_crop":{"post":{"operationId":"cover_fit_crop","summary":"Computes the crop-then-scale needed to exactly fill a target pixel box without distortion — the 'cover' fit","description":"Computes the crop-then-scale needed to exactly fill a target pixel box without distortion — the 'cover' fit\n    commonly used for thumbnails and avatars. Use for \"crop and scale 4000x3000 to fit exactly 1080x1080\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"source_w":{"description":"Source image width in pixels.","examples":[4000],"exclusiveMinimum":0,"maximum":200000,"title":"Source W","type":"integer"},"source_h":{"description":"Source image height in pixels.","examples":[3000],"exclusiveMinimum":0,"maximum":200000,"title":"Source H","type":"integer"},"target_w":{"description":"Exact target width in pixels.","examples":[1080],"exclusiveMinimum":0,"maximum":200000,"title":"Target W","type":"integer"},"target_h":{"description":"Exact target height in pixels.","examples":[1080],"exclusiveMinimum":0,"maximum":200000,"title":"Target H","type":"integer"}},"required":["source_w","source_h","target_w","target_h"],"title":"cover_fit_cropArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/megapixel_calculator":{"post":{"operationId":"megapixel_calculator","summary":"Computes total megapixels and the simplified aspect ratio from pixel dimensions. Use for \"how many","description":"Computes total megapixels and the simplified aspect ratio from pixel dimensions. Use for \"how many\n    megapixels is a 6000x4000 image\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"width_px":{"description":"Image width in pixels.","examples":[6000],"exclusiveMinimum":0,"maximum":200000,"title":"Width Px","type":"integer"},"height_px":{"description":"Image height in pixels.","examples":[4000],"exclusiveMinimum":0,"maximum":200000,"title":"Height Px","type":"integer"}},"required":["width_px","height_px"],"title":"megapixel_calculatorArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/print_size_table":{"post":{"operationId":"print_size_table","summary":"Computes required pixel dimensions for a list of print sizes (or common defaults: 4x6 through 24x36 plus","description":"Computes required pixel dimensions for a list of print sizes (or common defaults: 4x6 through 24x36 plus\n    A4/A3/A5) at a given DPI. Use for \"pixel dimensions for common print sizes at 300 dpi\", \"what resolution do I\n    need for an A4 print at 300 dpi\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"dpi":{"description":"Print resolution in dots per inch.","examples":[300],"exclusiveMinimum":0,"maximum":10000,"title":"Dpi","type":"number"},"sizes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"description":"Sizes as 'WxH' inches (e.g. '8x10') or names ('A4', 'A3', 'A5'); omit for common defaults.","title":"Sizes"}},"required":["dpi"],"title":"print_size_tableArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/dpi_class_info":{"post":{"operationId":"dpi_class_info","summary":"Classifies a DPI value into a commonly cited quality tier: screen-only, low-end print, standard print,","description":"Classifies a DPI value into a commonly cited quality tier: screen-only, low-end print, standard print,\n    high-quality photo print, or fine-art print. Use for \"is 150 dpi good enough to print\", \"what does 300 dpi mean\n    for quality\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"dpi":{"description":"A DPI value.","examples":[150],"exclusiveMinimum":0,"maximum":10000,"title":"Dpi","type":"number"}},"required":["dpi"],"title":"dpi_class_infoArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/pixelmath_glossary":{"post":{"operationId":"pixelmath_glossary","summary":"Definitions of image-resolution terms: DPI, PPI, resolution, aspect ratio, resampling/interpolation,","description":"Definitions of image-resolution terms: DPI, PPI, resolution, aspect ratio, resampling/interpolation,\n    upsampling, downsampling, raster image, megapixel, native resolution. Use for \"what does DPI mean\", \"what's the\n    difference between DPI and PPI\", \"what's upsampling\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"term":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"A specific term to look up; omit to list all.","title":"Term"}},"title":"pixelmath_glossaryArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}