# Post Processing

> Post Processing is an endpoint that can enhance images using a variety of techniques including grain, blur, sharpen, and more.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/post-processing`
- **Model ID**: `fal-ai/post-processing`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: stylized, utility



## Pricing

- **Price**: $0.001 per 1

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`image_url`** (`string`, _required_):
  URL of image to process
  - Examples: "https://storage.googleapis.com/falserverless/web-examples/post-process/postpro-input.jpg"

- **`enable_grain`** (`boolean`, _optional_):
  Enable film grain effect
  - Default: `false`

- **`grain_intensity`** (`float`, _optional_):
  Film grain intensity (when enabled) Default value: `0.4`
  - Default: `0.4`
  - Range: `0` to `1`, step: `0.01`

- **`grain_scale`** (`float`, _optional_):
  Film grain scale (when enabled) Default value: `10`
  - Default: `10`
  - Range: `1` to `100`

- **`grain_style`** (`GrainStyleEnum`, _optional_):
  Style of film grain to apply Default value: `"modern"`
  - Default: `"modern"`
  - Options: `"modern"`, `"analog"`, `"kodak"`, `"fuji"`, `"cinematic"`, `"newspaper"`

- **`enable_color_correction`** (`boolean`, _optional_):
  Enable color correction
  - Default: `false`

- **`temperature`** (`float`, _optional_):
  Color temperature adjustment
  - Default: `0`
  - Range: `-100` to `100`

- **`brightness`** (`float`, _optional_):
  Brightness adjustment
  - Default: `0`
  - Range: `-100` to `100`

- **`contrast`** (`float`, _optional_):
  Contrast adjustment
  - Default: `0`
  - Range: `-100` to `100`

- **`saturation`** (`float`, _optional_):
  Saturation adjustment
  - Default: `0`
  - Range: `-100` to `100`

- **`gamma`** (`float`, _optional_):
  Gamma adjustment Default value: `1`
  - Default: `1`
  - Range: `0.2` to `2.2`

- **`enable_chromatic`** (`boolean`, _optional_):
  Enable chromatic aberration
  - Default: `false`

- **`red_shift`** (`integer`, _optional_):
  Red channel shift amount
  - Default: `0`
  - Range: `-20` to `20`

- **`red_direction`** (`RedDirectionEnum`, _optional_):
  Red channel shift direction Default value: `"horizontal"`
  - Default: `"horizontal"`
  - Options: `"horizontal"`, `"vertical"`

- **`green_shift`** (`integer`, _optional_):
  Green channel shift amount
  - Default: `0`
  - Range: `-20` to `20`

- **`green_direction`** (`GreenDirectionEnum`, _optional_):
  Green channel shift direction Default value: `"horizontal"`
  - Default: `"horizontal"`
  - Options: `"horizontal"`, `"vertical"`

- **`blue_shift`** (`integer`, _optional_):
  Blue channel shift amount
  - Default: `0`
  - Range: `-20` to `20`

- **`blue_direction`** (`BlueDirectionEnum`, _optional_):
  Blue channel shift direction Default value: `"horizontal"`
  - Default: `"horizontal"`
  - Options: `"horizontal"`, `"vertical"`

- **`enable_blur`** (`boolean`, _optional_):
  Enable blur effect
  - Default: `false`

- **`blur_type`** (`BlurTypeEnum`, _optional_):
  Type of blur to apply Default value: `"gaussian"`
  - Default: `"gaussian"`
  - Options: `"gaussian"`, `"kuwahara"`

- **`blur_radius`** (`integer`, _optional_):
  Blur radius Default value: `3`
  - Default: `3`
  - Range: `0` to `31`

- **`blur_sigma`** (`float`, _optional_):
  Sigma for Gaussian blur Default value: `1`
  - Default: `1`
  - Range: `0.1` to `10`

- **`enable_vignette`** (`boolean`, _optional_):
  Enable vignette effect
  - Default: `false`

- **`vignette_strength`** (`float`, _optional_):
  Vignette strength (when enabled) Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `10`

- **`enable_parabolize`** (`boolean`, _optional_):
  Enable parabolize effect
  - Default: `false`

- **`parabolize_coeff`** (`float`, _optional_):
  Parabolize coefficient Default value: `1`
  - Default: `1`
  - Range: `-10` to `10`

- **`vertex_x`** (`float`, _optional_):
  Vertex X position Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`vertex_y`** (`float`, _optional_):
  Vertex Y position Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`enable_tint`** (`boolean`, _optional_):
  Enable color tint effect
  - Default: `false`

- **`tint_strength`** (`float`, _optional_):
  Tint strength Default value: `1`
  - Default: `1`
  - Range: `0.1` to `1`

- **`tint_mode`** (`TintModeEnum`, _optional_):
  Tint color mode Default value: `"sepia"`
  - Default: `"sepia"`
  - Options: `"sepia"`, `"red"`, `"green"`, `"blue"`, `"cyan"`, `"magenta"`, `"yellow"`, `"purple"`, `"orange"`, `"warm"`, `"cool"`, `"lime"`, `"navy"`, `"vintage"`, `"rose"`, `"teal"`, `"maroon"`, `"peach"`, `"lavender"`, `"olive"`

- **`enable_dissolve`** (`boolean`, _optional_):
  Enable dissolve effect
  - Default: `false`

- **`dissolve_image_url`** (`string`, _optional_):
  URL of second image for dissolve Default value: `""`
  - Default: `""`

- **`dissolve_factor`** (`float`, _optional_):
  Dissolve blend factor Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`enable_dodge_burn`** (`boolean`, _optional_):
  Enable dodge and burn effect
  - Default: `false`

- **`dodge_burn_intensity`** (`float`, _optional_):
  Dodge and burn intensity Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`dodge_burn_mode`** (`DodgeBurnModeEnum`, _optional_):
  Dodge and burn mode Default value: `"dodge"`
  - Default: `"dodge"`
  - Options: `"dodge"`, `"burn"`, `"dodge_and_burn"`, `"burn_and_dodge"`, `"color_dodge"`, `"color_burn"`, `"linear_dodge"`, `"linear_burn"`

- **`enable_glow`** (`boolean`, _optional_):
  Enable glow effect
  - Default: `false`

- **`glow_intensity`** (`float`, _optional_):
  Glow intensity Default value: `1`
  - Default: `1`
  - Range: `0` to `5`

- **`glow_radius`** (`integer`, _optional_):
  Glow blur radius Default value: `5`
  - Default: `5`
  - Range: `1` to `50`

- **`enable_sharpen`** (`boolean`, _optional_):
  Enable sharpen effect
  - Default: `false`

- **`sharpen_mode`** (`SharpenModeEnum`, _optional_):
  Type of sharpening to apply Default value: `"basic"`
  - Default: `"basic"`
  - Options: `"basic"`, `"smart"`, `"cas"`

- **`sharpen_radius`** (`integer`, _optional_):
  Sharpen radius (for basic mode) Default value: `1`
  - Default: `1`
  - Range: `1` to `15`

- **`sharpen_alpha`** (`float`, _optional_):
  Sharpen strength (for basic mode) Default value: `1`
  - Default: `1`
  - Range: `0.1` to `5`

- **`noise_radius`** (`integer`, _optional_):
  Noise radius for smart sharpen Default value: `7`
  - Default: `7`
  - Range: `1` to `25`

- **`preserve_edges`** (`float`, _optional_):
  Edge preservation factor Default value: `0.75`
  - Default: `0.75`
  - Range: `0` to `1`

- **`smart_sharpen_strength`** (`float`, _optional_):
  Smart sharpen strength Default value: `5`
  - Default: `5`
  - Range: `0` to `25`

- **`smart_sharpen_ratio`** (`float`, _optional_):
  Smart sharpen blend ratio Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`cas_amount`** (`float`, _optional_):
  CAS sharpening amount Default value: `0.8`
  - Default: `0.8`
  - Range: `0` to `1`

- **`enable_solarize`** (`boolean`, _optional_):
  Enable solarize effect
  - Default: `false`

- **`solarize_threshold`** (`float`, _optional_):
  Solarize threshold Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`enable_desaturate`** (`boolean`, _optional_):
  Enable desaturation effect
  - Default: `false`

- **`desaturate_factor`** (`float`, _optional_):
  Desaturation factor Default value: `1`
  - Default: `1`
  - Range: `0` to `1`

- **`desaturate_method`** (`DesaturateMethodEnum`, _optional_):
  Desaturation method Default value: `"luminance (Rec.709)"`
  - Default: `"luminance (Rec.709)"`
  - Options: `"luminance (Rec.709)"`, `"luminance (Rec.601)"`, `"average"`, `"lightness"`



**Required Parameters Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/web-examples/post-process/postpro-input.jpg"
}
```

**Full Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/web-examples/post-process/postpro-input.jpg",
  "grain_intensity": 0.4,
  "grain_scale": 10,
  "grain_style": "modern",
  "gamma": 1,
  "red_direction": "horizontal",
  "green_direction": "horizontal",
  "blue_direction": "horizontal",
  "blur_type": "gaussian",
  "blur_radius": 3,
  "blur_sigma": 1,
  "vignette_strength": 0.5,
  "parabolize_coeff": 1,
  "vertex_x": 0.5,
  "vertex_y": 0.5,
  "tint_strength": 1,
  "tint_mode": "sepia",
  "dissolve_factor": 0.5,
  "dodge_burn_intensity": 0.5,
  "dodge_burn_mode": "dodge",
  "glow_intensity": 1,
  "glow_radius": 5,
  "sharpen_mode": "basic",
  "sharpen_radius": 1,
  "sharpen_alpha": 1,
  "noise_radius": 7,
  "preserve_edges": 0.75,
  "smart_sharpen_strength": 5,
  "smart_sharpen_ratio": 0.5,
  "cas_amount": 0.8,
  "solarize_threshold": 0.5,
  "desaturate_factor": 1,
  "desaturate_method": "luminance (Rec.709)"
}
```


### Output Schema

The API returns the following output format:

- **`images`** (`list<Image>`, _required_):
  The processed images
  - Array of Image



**Example Response**:

```json
{
  "images": [
    {
      "url": "",
      "content_type": "image/png",
      "file_name": "z9RV14K95DvU.png",
      "file_size": 4404019,
      "width": 1024,
      "height": 1024
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/post-processing \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://storage.googleapis.com/falserverless/web-examples/post-process/postpro-input.jpg"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/post-processing",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/web-examples/post-process/postpro-input.jpg"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/post-processing", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/web-examples/post-process/postpro-input.jpg"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/post-processing)
- [API Documentation](https://fal.ai/models/fal-ai/post-processing/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/post-processing)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
