API Documentation
  • Welcome!
  • Quick Start
  • API methods
  • Easy integration
  • Handling Large File Sets
  • Supported formats
  • Webhooks
  • Common usecases
    • Auto enhance image quality
    • Create business photo or avatar from face image
    • Face swap
    • Create beautiful product photo
    • Genarate image in high resolution
    • Remove background
    • AI Drawing to Image - Doodle
    • Real estate
    • Enhancing documents
    • Car dealer photo
  • Image processing
    • Resize and padding
    • Denoise and sharpen
    • Enhance lighting and colors
    • Enhance face details
    • Background removal and generation
    • Image generation
    • Inpainting and outpainting (uncrop)
    • Frame identification
    • Print
    • Captions
    • Additional parameters
    • Presets
  • Account & settings
    • Account information
  • storages
    • Description
    • AWS S3
    • AWS S3 IAM Configuration
  • Presets
    • E-commerce
    • Real-estate
    • Print/Photo
    • Digital Art
  • Technology
    • Algorithms
    • Upscale
    • Background removal
      • Remove BG recommendation
    • Sharpen & Noise reduction
    • Enhance Lighting
  • FAQ
Powered by GitBook
On this page
  • Inpainting
  • Outpainting (uncrop)
  1. Image processing

Inpainting and outpainting (uncrop)

PreviousImage generationNextFrame identification

Last updated 6 months ago

Inpainting

Inpainting is a technique used in image processing to fill in missing or damaged parts of an image in a way that blends seamlessly with the surrounding areas. This process can reconstruct removed elements or extend the background of an image while preserving the visual coherence of textures, colors, and patterns.

Inpainting is a part of background generation parameters

Parameter
Description

adapter_type

inpainting

ip_image2

url to mask image

Let's check the example. There is a generated image with some hand issues:

Quickly created mask:

{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/inpainting-example.png",
    "background": {
        "generate": {
            "description": "hands touching surfing board",
            "adapter_type": "inpainting",
            "ip_image2": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/inpainting-example-mask4.png",
            "controlnet_conditioning_scale": 0.5
        }
    }
}

And the result:

Outpainting (uncrop)

Outpainting, or "uncropping," is a technique used to expand an image beyond its original borders by generating new visual content that seamlessly extends the existing scene. Unlike inpainting, which fills in missing areas within an image, outpainting creatively imagines what might lie beyond the current frame, effectively "uncropping" it to add context or detail.

Let's make a horizontal image of the vertical one.

{
    "url": "https://deep-image.ai/api-example2.jpg",
    "width": 2000,
    "height": 1000,
    "fit": {
        "canvas": "outpainting"
    }
}

And the result:

Prompt or image description is generated by default so for this particular example is: "there is a boat that is sitting on the sand near a building".

We can use our prompt as well:

{
    "url": "https://deep-image.ai/api-example2.jpg",
    "width": 2000,
    "height": 1000,
    "fit": {
        "canvas": "outpainting"
    },
    "background": {
        "generate": {
            "adapter_type": "upscale",
            "description": "Boat on Mars with spaceships around."
        }
    }
}

And the result: