{"info":{"title":"grey-hound432/fast-image-resizer","version":"1.0.0"},"paths":{"/":{"post":{"summary":"Generate","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Output"}}},"description":"Successful Response"}},"operationId":"grey_hound432_fast_image_resizer_generate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Input"}}},"required":true}}}},"openapi":"3.1.0","components":{"schemas":{"Input":{"type":"object","title":"Input","required":["image"],"properties":{"image":{"type":"string","title":"Image","format":"uri","x-order":0,"description":"URL of the image to resize. It must be a flat RGB image (JPEG, WebP, or an RGB PNG): a file carrying an alpha channel (RGBA) or a colour palette - which covers most PNG and GIF screenshots, icons and logos - fails the run outright: 'cannot write mode RGBA as JPEG' for an alpha channel, 'cannot write mode P as JPEG' for a palette. Flatten such an image onto a solid background and re-save it as RGB before sending."},"width":{"type":"integer","title":"Width","default":512,"minimum":1,"x-order":1,"description":"Target width in pixels. With keep_aspect_ratio true (the default) this is the maximum width of the box the image is shrunk into, not the exact output width; with keep_aspect_ratio false it is the exact output width."},"height":{"type":"integer","title":"Height","default":512,"minimum":1,"x-order":2,"description":"Target height in pixels. With keep_aspect_ratio true (the default) this is the maximum height of the box the image is shrunk into, not the exact output height; with keep_aspect_ratio false it is the exact output height."},"keep_aspect_ratio":{"type":"boolean","title":"Keep Aspect Ratio","default":true,"x-order":3,"description":"How width and height are applied. true (the default) fits the image inside the width x height box while keeping its proportions - an 800x600 photo into a 200x200 box comes back 200x150 - and NEVER enlarges: asking for a box larger than the source returns the source at its original size, merely re-encoded to JPEG, as a successful and billable run. false stretches the image to exactly width x height, changing its proportions whenever the target box has a different aspect ratio."}}},"Output":{"type":"string","title":"Output","format":"uri","description":"URL of the resized image. It is always a JPEG regardless of the input's format, so transparency is not preserved."}}}}