---
title: Editing images — Kling IMAGE 4.0 | Runware Docs
url: https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images
description: "How to edit a photo with Kling IMAGE 4.0: recoloring a product to HEX values, replacing a studio background, retouching haze and color casts, and adding motion blur."
---
### [Introduction](https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images#introduction)

A product that comes in four colorways **needs one photo, not four shoots**. Send the photo you have, describe the change, and Kling IMAGE 4.0 renders the photo again with that change made. The shoes below went in off-white and came back in a navy and orange colorway set by HEX values.

**Off-white**:

![A pair of off-white knit running shoes with white midsoles and pale gray laces on a light gray backdrop](https://runware.ai/docs/assets/source-shoes.BBwnpK50_Z2kotuD.jpg)

> **Prompt**: An e-commerce packshot of a pair of running shoes on a plain light gray backdrop, one shoe in side profile facing right and the other angled behind it showing the toe. Knit uppers in off-white, a white foam midsole, a pale gray heel tab and pale gray laces, plain side panels with no branding. Soft even studio lighting, a subtle contact shadow under each shoe. Photoreal product photography, crisp knit texture, no text, no logos.

**Navy and orange**:

![The same pair of running shoes with navy knit uppers, orange laces and heel tabs and white midsoles, on the same gray backdrop](https://runware.ai/docs/assets/output-shoes.e1taUkMe_Z2jK6zY.jpg)

> **Prompt**: Change only the colors of the shoes. Make the knit uppers HEX #1F3A5F, the laces and heel tabs HEX #FF7A1A, and keep the midsoles white. Keep the knit texture, the shape of each shoe, the backdrop, the shadows, the framing and the lighting exactly as they are, so the image looks as if this colorway was the one photographed.

**Each HEX value names one part of the shoe**, and the last sentence of the prompt lists what stays: the knit, the shape, the backdrop and the light.

This guide covers the request, how to write an instruction, replacing a studio background, retouching haze and color casts, and adding camera effects. Building a new image out of several inputs is covered in [reference images](https://runware.ai/docs/models/klingai-image-4-0/guides/reference-images).

### [The request](https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images#the-request)

An edit is a generation request **with the photo attached** in `inputs.referenceImages`. The instruction goes in `positivePrompt`:

**TypeScript**:

```typescript
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: 'klingai:kling-image@4.0',
  positivePrompt: 'Change only the colors of the shoes. Make the knit uppers HEX #1F3A5F, the laces and heel tabs HEX #FF7A1A, and keep the midsoles white. Keep the knit texture, the shape of each shoe, the backdrop, the shadows, the framing and the lighting exactly as they are, so the image looks as if this colorway was the one photographed.',
  inputs: {
    referenceImages: [
      'https://assets.runware.ai/guides/klingai-image-4-0/editing-images/source-shoes.jpg'
    ]
  },
  width: 2336,
  height: 1760
})
```

**Python**:

```python
import asyncio
import os

from runware import Runware

async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "klingai:kling-image@4.0",
            "positivePrompt": "Change only the colors of the shoes. Make the knit uppers HEX #1F3A5F, the laces and heel tabs HEX #FF7A1A, and keep the midsoles white. Keep the knit texture, the shape of each shoe, the backdrop, the shadows, the framing and the lighting exactly as they are, so the image looks as if this colorway was the one photographed.",
            "inputs": {
                "referenceImages": [
                    "https://assets.runware.ai/guides/klingai-image-4-0/editing-images/source-shoes.jpg"
                ]
            },
            "width": 2336,
            "height": 1760
        })

asyncio.run(main())
```

**cURL**:

```bash
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "imageInference",
      "taskUUID": "c3d9e1f4-6a2b-4c87-9e05-1b7f4a8d2c66",
      "model": "klingai:kling-image@4.0",
      "positivePrompt": "Change only the colors of the shoes. Make the knit uppers HEX #1F3A5F, the laces and heel tabs HEX #FF7A1A, and keep the midsoles white. Keep the knit texture, the shape of each shoe, the backdrop, the shadows, the framing and the lighting exactly as they are, so the image looks as if this colorway was the one photographed.",
      "inputs": {
        "referenceImages": [
          "https://assets.runware.ai/guides/klingai-image-4-0/editing-images/source-shoes.jpg"
        ]
      },
      "width": 2336,
      "height": 1760
    }
  ]'
```

**CLI**:

```bash
runware run klingai:kling-image@4.0 \
  positivePrompt="Change only the colors of the shoes. Make the knit uppers HEX #1F3A5F, the laces and heel tabs HEX #FF7A1A, and keep the midsoles white. Keep the knit texture, the shape of each shoe, the backdrop, the shadows, the framing and the lighting exactly as they are, so the image looks as if this colorway was the one photographed." \
  inputs.referenceImages.0=https://assets.runware.ai/guides/klingai-image-4-0/editing-images/source-shoes.jpg \
  width=2336 \
  height=1760
```

**JSON**:

```json
{
  "taskType": "imageInference",
  "taskUUID": "c3d9e1f4-6a2b-4c87-9e05-1b7f4a8d2c66",
  "model": "klingai:kling-image@4.0",
  "positivePrompt": "Change only the colors of the shoes. Make the knit uppers HEX #1F3A5F, the laces and heel tabs HEX #FF7A1A, and keep the midsoles white. Keep the knit texture, the shape of each shoe, the backdrop, the shadows, the framing and the lighting exactly as they are, so the image looks as if this colorway was the one photographed.",
  "inputs": {
    "referenceImages": [
      "https://assets.runware.ai/guides/klingai-image-4-0/editing-images/source-shoes.jpg"
    ]
  },
  "width": 2336,
  "height": 1760
}
```

- `inputs.referenceImages` takes the photo as a URL, a UUID (a previous generation's, or one uploaded via Media Storage), a data URI or base64. Each image needs **at least 300 pixels on both sides**, an aspect ratio between 2:5 and 5:2, and a size of up to 30 MB.
- Leave the size out and the edit **keeps the photo's aspect ratio** at the 2K tier. `resolution` picks `4K` or `8K` instead, still in the photo's ratio.
- Send `width` and `height` when the result has to **line up with the source**, as every before and after on this page does. Use the pair at the photo's own ratio.

### [Writing the instruction](https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images#writing-the-instruction)

An instruction has **a change and a keep list**. The shoe prompt, clause by clause:

**[Target]** Change only the colors of the shoes, **[Change]** Make the knit uppers HEX #1F3A5F, the laces and heel tabs HEX #FF7A1A, and keep the midsoles white, **[Keep]** Keep the knit texture, the shape of each shoe, the backdrop, the shadows, the framing and the lighting exactly as they are, **[Result]** so the image looks as if this colorway was the one photographed

**"Only the colors" fences the change** to one property of one object, and every HEX value has a named part to land on. "Keep the midsoles white" matters as much as the new colors, since a part the instruction never mentions is a part the model may recolor along with the rest.

The keep list **names categories**. "The backdrop" and "the lighting" cover everything in them without describing the photo back to the model. The last clause, "as if this colorway was the one photographed", asks for an image that reads as a real photo rather than a recolored one.

A keep list holds **what the photo shows**, and the model still draws it again. The shape of each shoe, the backdrop and the light carried over, while the knit on the toe came back with a different pattern of holes. When everything outside the change has to match the source pixel for pixel, composite the edited area back over the original.

### [Replacing a studio background](https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images#replacing-a-studio-background)

One instruction can clear a green screen and its whole rig. **Ask for the relight as well**, so the subject takes the light of the new place instead of keeping the studio's.

**Studio**:

![A woman in a teal sports bra and black leggings holding a lunge on a rubber mat in front of a green screen, with lighting trusses and softboxes at the top of the frame](https://runware.ai/docs/assets/source-studio.B6iAlJCl_Zyahi0.jpg)

> **Prompt**: A behind-the-scenes photo from a fitness video shoot. A woman in her thirties with a high ponytail, in a teal sports bra and black leggings, holds a lunge with her hands on her hips on a black rubber floor mat. Behind her and to the left, a large green screen fills most of the frame, with aluminum lighting trusses and two white softbox lights visible along the top edge. Flat studio lighting from the front. Full-length shot at waist height, 35mm lens. Photoreal, no text, no logos.

**Rooftop**:

![The same woman holding the same lunge on a wooden deck on a rooftop terrace at sunrise, with a skyline of glass towers behind her and warm light from the right](https://runware.ai/docs/assets/output-rooftop.CfSfpTS-_Z241z89.jpg)

> **Prompt**: Replace the green screen, the lighting trusses and the softboxes with a city rooftop terrace at sunrise: a low concrete parapet, a few potted grasses and a skyline of glass towers in soft morning haze. Replace the rubber mat with a weathered wooden deck. Keep the woman, her face, her ponytail, her outfit and her lunge exactly as they are. Relight her with warm low sunlight from the right to match the new scene, with a soft rim light on her shoulders and a contact shadow on the deck at her feet.

Name **everything that has to go**. "The green screen, the lighting trusses and the softboxes" covers each studio element by name, and "replace the rubber mat" swaps the floor too, since a studio mat on a rooftop would give the composite away. The relight sentence then **places the light and the shadow**: warm sun from the right, a rim on her shoulders and a contact shadow on the deck.

### [Retouching](https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images#retouching)

Retouching **changes how the photo looks and keeps everything in it in place**. Kling suggests opening with the full keep list, "without changing any content, objects, composition or camera position", and then naming the one correction to make.

#### [Removing haze](https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images#removing-haze)

**Hazy**:

![A hotel pool terrace with sun loungers, olive trees and a pergola, washed out by gray haze with low contrast and soft detail](https://runware.ai/docs/assets/source-hazy.DRjgq_CX_Z11DdUm.jpg)

*Haze added to a clean photo for this example*

> **Prompt**: A real estate listing photo of a boutique hotel pool terrace in the late afternoon. A long rectangular pool with turquoise water, a row of white sun loungers with folded striped towels, potted olive trees and lavender along a whitewashed wall, a bougainvillea pergola on the right, and a view of distant green hills beyond a low glass balustrade. Clear air, deep blue sky, crisp detail on the stone tiles. Shot from a corner at standing height, 24mm lens. Photoreal architectural photography, no people, no text, no logos.

**Clear**:

![The same pool terrace with the haze removed, showing turquoise water, crisp stone tiles and clear green hills under a blue sky](https://runware.ai/docs/assets/output-dehazed.BTNyztZL_Z28P6NI.jpg)

> **Prompt**: Without changing any content, objects, composition or camera position, improve the image only by removing haze. Remove the gray low-contrast mist and the diffused glare, restore clear depth to the hills, and raise micro contrast so the tiles, the loungers and the leaves look crisp. Keep the light direction, the exposure and the colors of every object. Avoid oversharpening, halos and an HDR look.

End a retouch with **what to avoid**. "Avoid oversharpening, halos and an HDR look" names the ways a dehaze can overshoot, so the result stays a listing photo instead of an over-processed one.

#### [Correcting a color cast](https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images#correcting-a-color-cast)

**Magenta cast**:

![A headshot of a man with salt-and-pepper hair and a trimmed beard in a charcoal blazer, with a strong magenta cast over his skin and white shirt](https://runware.ai/docs/assets/source-cast.C9Xm02AC_ZDUa3G.jpg)

*Color cast added to a clean photo for this example*

> **Prompt**: A professional headshot for a company team page. A man in his fifties with light olive skin, short salt-and-pepper hair and a trimmed beard, wearing a charcoal blazer over a white open-collar shirt, smiling slightly at the camera. A softly blurred modern office with plants behind him. Soft daylight from a large window on the left, neutral white balance, natural skin tones. Head and shoulders, eye level, 85mm lens. Photoreal corporate portrait photography, no text, no logos.

**Corrected**:

![The same headshot with natural skin tones and a white shirt, the magenta cast removed](https://runware.ai/docs/assets/output-corrected.uUX4ONAX_ZIQePM.jpg)

> **Prompt**: Without changing any content, the man, his pose, his expression, his clothing, the composition or the camera position, correct only the color. Remove the magenta cast from his face, neck and hands and restore natural neutral skin tones, and neutralize the white balance across the whole image so the white shirt reads white. Keep the light direction, the shadows and the skin texture. Avoid smoothing the skin or raising the saturation.

Give the model **a neutral to aim for**. "So the white shirt reads white" is a reference point inside the photo, which is how a colorist would balance it. "Avoid smoothing the skin" keeps the correction from turning into a beauty retouch.

The face is **drawn again as well**. Its brows and the lines around the eyes differ from the source in detail, so compare a retouched portrait with the original before it replaces it.

### [Camera effects](https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images#camera-effects)

An edit can add **what a camera would have done** to a sharp photo, such as the motion blur of a tracking shot. Hold the content fixed and describe the effect as the camera's movement:

**Sharp**:

![A road cyclist in a black and orange jersey riding down a city avenue lined with glass towers, everything in sharp focus](https://runware.ai/docs/assets/source-cyclist.B8mTj_8Z_1JSQHV.jpg)

> **Prompt**: A sharp action photo for a cycling apparel brand. A road cyclist in a black and orange jersey and a white helmet rides fast down the middle of a wide city avenue lined with glass office towers and young trees, crouched low over the handlebars. Everything is in focus, from the rider to the buildings and the parked scooters along the curb. Bright morning sun from the left. Shot from a low angle at the rider's side, 35mm lens, the rider in the center third. Photoreal sports photography, no text, no logos.

**Tracking shot**:

![The same cyclist kept sharp while the avenue, buildings and parked scooters behind him streak with horizontal motion blur](https://runware.ai/docs/assets/output-tracking.DbFWNb8D_Zt0xiJ.jpg)

> **Prompt**: Without adding, removing or moving anything, and without changing the composition or the camera position, turn the photo into a high-speed tracking shot. Keep the cyclist sharp, and add realistic horizontal motion blur to the avenue, the buildings, the trees and the parked scooters, as if the camera moved alongside the rider at the same speed with a slow shutter. Streak the highlights slightly in the direction of travel.

Describe **what caused the effect**. "As if the camera moved alongside the rider at the same speed with a slow shutter" tells the model which parts stay sharp and which way the blur runs, which "add motion blur" alone leaves open.

### [Tips](https://runware.ai/docs/models/klingai-image-4-0/guides/editing-images#tips)

1. **Name the change, then list what stays.** Categories such as "the backdrop" and "the lighting" are enough for the keep list.
    
2. **Put each HEX value on a named part.** Say which parts keep their color too, or they may change along with the rest.
    
3. **Send the source's own size to line up a before and after.** Leave the size out and the edit still keeps the photo's ratio.
    
4. **Ask for a relight when the background changes.** Light direction, a rim and a contact shadow keep the subject from looking pasted in.
    
5. **Open retouches with "without changing any content".** Then name the one correction, and close with what to avoid.
    
6. **Describe camera effects as camera movement.** The movement decides what blurs and in which direction.
    
7. **Compare fine detail with the source.** An edit redraws the frame, so a knit pattern or a face can change in detail even when the keep list names it.