loading

REST API extended with AI features

We’re glad to inform you that our REST API endpoints were extended to mirror the new AI features of the web editor.

Expand image with AI

With the release of the Expand image with AI in the web editor, there is a new REST endpoint to mirror the same functionality. Let’s say that you have a 800×600 image that you want to expand with AI:

curl -X POST -F 'apikey=yourapikey' -F 'expand={"width":1200,"height":800}' -F '[email protected]' https://pixoeditor.com/api/image > output.jpeg

With this simple command, you will get the image expanded with AI to 1200×800 pixels.

The Expand API is rich – read the full documentation to see all possibilities.

Generate and place image with AI

The existing Sticker API was extended with AI-generation feature:

curl -X POST -F 'apikey=yourapikey' -F 'stickers=[{"prompt":"butterfly with yellow wings", "style": "photography"}]' -F '[email protected]' https://pixoeditor.com/api/image > output.jpeg

The above command generates a realistic photo of a butterfly with yellow wings, on a transparent background, and places it in the center of the input image. Use the Sticker placement options to define a more precise placement.

Replace background with AI-generated one

The existing Background Replacement API was extended with AI-generation feature too:

curl -X POST -F 'apikey=yourapikey' -F 'background={"type":"replacement", "prompt": "dark green forest", "style": "photography"}' -F '[email protected]' https://pixoeditor.com/api/image > output.jpeg

The above command will replace the existing background of the input image, with a AI-generated dark green forest.

Mask faces and car plates

This is a really useful one for sensitive content. With a single call, you can detect all faces and/or car plates with AI, and mask them automatically, using 3 different styles:

  • blur
  • pixelate
  • solid color
curl -X POST -F 'apikey=yourapikey' -F 'mask={"detect":["faces","carplates"],"mask":{"type":"blur"}}' -F '[email protected]' https://pixoeditor.com/api/image > output.jpeg

See the full Mask documentation here.

Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *