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
  1. Image processing

Denoise and sharpen

PreviousResize and paddingNextEnhance lighting and colors

Last updated 9 months ago

Image can be enhanced in few ways, it can be denoised and it can be sharpened (deblurred).

Enhancement
Description

denoise

Reduces the image noise

Noise removal

deblur

Sharpen the image

Out of focus blur reduction

clean

Cleans the image without changing resolution

face_enhance

Enhance face details

light

Enhance lighting and colors

color

Enhance lighting and colors

white_balance

Enhance Lighting

Version of model for denoise or deblur can be parametrized.

There are two models: v1 and v2. v2 which is newer, handles better heavily blurry and noisy pictures. By default v1 is used.

It is not recommended to use that for good quality pictures though.

"denoise_parameters": {
    "type": "v2"
}
"deblur_parameters": {
    "type": "v2"
}

Let's check some examples.

Noise removal

{
    "enhancements": ["denoise"],
    "denoise_parameters": {
        "type": "v2"
    }
}
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["denoise"],
         "denoise_parameters": {
           "type": "v2"
         }
      }'
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["denoise"],
                       "denoise_parameters": {
                           "type": "v2"
                       }}
    api_response = api_instance.rest_api_process_result_post(process_payload)

Out of focus blur reduction

We can also make sharper blurry image like this:

{
    "enhancements": ["deblur"]
}
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["deblur"]
      }'
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["deblur"]}
    api_response = api_instance.rest_api_process_result_post(process_payload)

Those two options can be specified together.

Let's check the results on that image:

{
    "enhancements": ["deblur", "denoise"]
}
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["deblur", "denoise"]
      }'
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["deblur", "denoise"]}
    api_response = api_instance.rest_api_process_result_post(process_payload)

Cleaning the image

Image can also be "cleaned" from artifacts and previously poorly upscaled image.

"enhancements": ["clean"]
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["clean"]
      }'
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["clean"]}
    api_response = api_instance.rest_api_process_result_post(process_payload)

Resolution of the image remains the same but image should be in better quality.