How does AI local retouching match the lighting? Use PixPix to seamlessly integrate new objects into the original image.

12 min read
How does AI local retouching match the lighting? Use PixPix to seamlessly integrate new objects into the original image.

After AI performs local retouching, the edges of the new object may appear clean and its details sufficiently sharp, yet it still looks as if it were pasted onto the photo. The issue often lies not in clarity, but in its failure to follow the original scene’s lighting rules.

What truly needs to be matched is not just a vague “natural light,” but rather where the main light source originates, how soft the shadows are, whether the environment leans cool or warm, which side of the material the highlights fall on, and how the object interacts with the surface it rests upon.

This article uses an original case study to demonstrate how to digitally add amber glass perfume to a warm-toned vanity scene in PixPix: first analyze the lighting, then define the selection area and prompt, and finally verify each element—shadows, highlights, color temperature, and reflections—in sequence. This example serves only to illustrate the method and does not represent a comprehensive model comparison or actual measurement results.

Quick conclusion: Match relationships first, then pursue details.

Whether local retouching appears natural can be judged according to the following order:

  1. Does the scale and perspective of the new object fit within the original scene?

  2. Does the object make believable contact with the surface it rests on?

  3. Do the direction and softness/hardness of the primary shadow align with those of nearby objects?

  4. Do the highlights appear on the side facing the light source?

  5. Do the object’s color temperature and environmental reflections belong to the same spatial context?

  6. Only at the very end should you check sharpness, noise, and edge quality after magnification.

If the object’s orientation, shadows, or color temperature don’t hold up, further sharpening will only make the errors more obvious.

Before writing your prompt, first extract five types of lighting cues from the original image.

Main light direction

Look for the clearest projections, nose shadows, bright edges along cup rims, or illuminated surfaces of furniture in the scene. These can help determine whether the main light comes roughly from the left, right, above, or against the light.

Don’t rely solely on a single small highlight. Metals, glass, and glossy plastics reflect their surroundings, so localized highlights don’t necessarily indicate the main light’s position. A more reliable approach is to observe the highlights and shadows of multiple objects simultaneously.

Light softness/hardness

The sharper the shadow edges, the smaller or more direct the light source usually is; wider shadow transitions typically suggest a larger, more diffused light source. Window light behind curtains, overcast conditions, and large softboxes tend to produce softer transitions, while direct sunlight or small point sources may create harder shadows.

During local retouching, the new object must not adopt a shadow language that contradicts the scene. For example, if all shadows in the original image are softly diffused, but a newly added bottle exhibits sharply defined studio-style shadows, this will immediately reveal traces of compositing.

Color temperature and ambient color

First identify white, gray, or light-colored surfaces in the original image, observing whether they lean toward yellow, pink, blue, or remain nearly neutral. Then examine whether dark areas receive reflections from walls, tabletops, or outdoor environments.

Matching color temperature doesn’t mean applying a uniform filter across the entire object. Sides facing warm light can appear warmer, while shadowed sides may still be influenced by cooler ambient light. In scenes with multiple light sources, color variations are acceptable, but the dominant lighting relationship must remain explainable.

Light source height and shadow length

Higher main lights generally cause primary shadows to lie closer to the object, whereas lower sidelights tend to produce longer shadows. Here, we’re not precisely calculating lamp positions based on shadow lengths, but rather assessing whether the newly added object casts shadows clearly out of place within the scene.

Contact and reflection

When an object rests on a surface, a small area of shadow typically appears near its base; glass, metal, or glossy materials may also pick up colors from surrounding windows, dark walls, and countertops.

The shadow near the contact point indicates “it really belongs here,” while the broader shadow pattern reveals “where the light is coming from.” These two functions serve different purposes, so simply adding a uniform black border around the base of a bottle cannot replace genuine light and shadow effects.

First establish scene constraints for the original case study.

The original image of the case is set as a warm-toned dressing table: a light beige travertine countertop occupies the lower portion of the frame, while a window in the upper-left corner casts diffused, warm afternoon light. The existing jewelry tray casts a soft shadow toward the right rear. On the right side of the scene, there’s an empty space that requires the addition of a bottle of unbranded amber glass perfume.

Scene anchors that must remain unchanged include:

  • Countertop texture and horizontal perspective;

  • Direction of window light entering from the upper-left;

  • Existing shadows extending toward the right rear;

  • Overall warm beige tone with low contrast;

  • Background, jewelry tray, and framing remain unchanged.

New identity anchors for the added perfume include:

  • Vertical, rounded-corner rectangular amber glass bottle;

  • Thick, transparent base of the bottle;

  • Short, matte black cap;

  • No logo, no labels, no packaging text;

  • The entire bottle rests fully on the countertop, without hovering.

This information should be divided into two categories: “must retain the original” and “selection needs to be generated.” Otherwise, the model might inadvertently alter the overall lighting of the entire photo to adapt to the new product.

左侧纱帘暖窗光照亮洞石台面和黄铜首饰托盘、右侧预留补绘空间的原始场景

Caption: In the original scene, window light comes from the upper-left, while the brass tray and wall reflections provide directional guidance, as well as cues regarding softness/hardness and color temperature for subsequent retouching.

Complete localized retouching in PixPix

Currently, PixPix officially lists localized retouching as one of its image-editing capabilities, explaining that image editing can be used for partial modifications, image enlargement, background replacement, and quality enhancement. While the specific interface may vary across versions, light-matching can follow the production logic outlined below.

Leave room for shadows when selecting the area

If the selection is too small—just enclosing the perfume bottle’s outline—the model won’t have enough space to generate a realistic cast shadow. If it’s too large, it could end up reworking the countertop texture and adjacent objects.

A more appropriate selection range should include:

  • The complete outline of the perfume bottle itself;

  • The contact area near the bottle’s base;

  • The right-rear countertop where the shadow is expected to extend;

  • A small amount of surrounding environment, used to capture color and texture.

The goal of the selection isn’t simply to make it larger—it should simultaneously encompass both the object itself and the resulting light-and-shadow effects it creates on its surroundings.

The first round of prompts should describe both the object and the light at once.

Simply writing “add a bottle of perfume” leaves the judgment of lighting entirely up to the model’s guesswork. It’s recommended to combine the subject, material, main light source, and shadows all within a single instruction.

General template

Add “Objects and Materials” within the selected area, positioning them at the “Contact Surface and Location.” Use soft/hard and cool/warm light originating from the “Direction,” with the object’s main illuminated surface located at the “Location,” and shadows extending toward the “Direction” while exhibiting a specific “Softness/Hardness.” Keep the original image’s “Background, Camera Position, Color Tone, and other unchangeable elements” intact.

This case can be written as:

Recreation suggestion prompt

Within the selected area, place a bottle of unbranded amber glass perfume—featuring a vertically rounded-rectangle body, a thick transparent base, and a short matte black cap—fully positioned on a light beige travertine tabletop. Utilize soft, warm afternoon light streaming through a sheer curtain‑covered window in the upper left; a broad yet restrained highlight appears on the left side of the bottle, while the glass’s shadowed areas reflect the warm tones of the tabletop. A contact shadow forms near the base, with the primary shadow gently extending to the right rear. Maintain the original background, jewelry tray, tabletop texture, camera position, and overall color tone unchanged, without adding logos, labels, or text.

This prompt is a recomposed suggestion for instructional purposes, not the original prompt from the reference article.

The first round addresses only the primary relationships.

In the first round, prioritize determining whether the bottle is resting on the surface, from which direction the light originates, and where the shadows fall. Do not simultaneously request changing the tabletop, adding floral elements, modifying the cap, or creating advertising text.

Introducing too many variables at once makes it difficult to pinpoint whether errors arise from the product structure, the selection area, lighting, or stylistic requirements.

琥珀玻璃香水带有右侧冷高光和向左前方硬影、与暖调场景不匹配的错误补绘

Caption: The incorrect version retains the correct bottle shape and placement, but the cold highlight on the right and the hard shadow in the front left clash with the warm window light of the original scene.

原始空场景、错误冷光补绘与正确暖光补绘从左到右排列的三联对比图

Caption: From left to right, these are the original scene, the incorrect lighting version, and the correct lighting version. When comparing, keep the product, camera position, and tabletop unchanged, observing only the interplay of light and shadow.

Replace “looks okay” with five checks.

用五个编号标出主光方向、瓶身高光、主要投影、接触暗部和环境反射的光线教学图

Caption: 1 represents the main light direction, 2 denotes the bottle’s highlight, 3 indicates the primary shadow, 4 shows the contact shadow, and 5 illustrates environmental reflections within the glass.

Shadow direction

First compare whether the perfume’s shadow and the jewelry tray’s shadow roughly point in compatible directions. In scenes with multiple light sources, weaker secondary shadows may exist, so there’s no need to mechanically pursue perfect parallelism; however, the most prominent shadow must still be explainable by the main light source.

Shadow softness/hardness

Compare the transition width at the edges of two shadow areas. If the existing shadow on the tabletop is soft, whereas the perfume’s shadow appears sharply defined like cut paper, only adjust the shadow region rather than recreating the entire perfume bottle.

Highlight location and shape

For glass bottles, highlights should not only appear on the side facing the main light but also reflect the light source’s shape. Large window lights tend to produce broader vertical highlights, while smaller light sources often create concentrated bright spots.

If there’s a bright window on the left side of the scene, yet the strongest highlight on the bottle appears only on the right, re-examine the light direction or reflective environment.

Color temperature and environmental reflections

A warm-toned travertine tabletop will impart a subtle warm reflection to the shadowed areas of clear glass. If the new perfume has an overall cool blue hue, even with correctly oriented shadows, it will appear as though it came from another photograph.

When making corrections, simply adjust the selection area to align with the surrounding environment—do not recolor the entire original image into the same orange tone.

Contact, occlusion, and material

Check whether the bottle’s base makes continuous contact with the tabletop, if the contact shadow is short and natural, and whether the tabletop texture penetrates the bottle. Glass edges should exhibit reasonable refraction and background displacement, but do not allow the travertine texture to pass through completely unchanged.

琥珀玻璃香水匹配左上方暖窗光、右后方柔和投影与自然接触暗部的修正结果

Caption: The corrected version ensures that the bottle’s highlight, color temperature, contact shadow, and primary shadow all harmonize with the original scene’s warm window light from the upper left.

A second, small-scale correction is more manageable than redoing the entire image.

If the product structure is already correct and only one localized issue remains, the second selection should cover only the problem area and its necessary adjacent surroundings.

Symptoms

Second selection area

Key points for correction instructions

Incorrect shadow direction

Bottle base and main projection area

Keep the perfume unchanged, reconstruct a soft projection toward the rear-right

The bottle body overall appears too cool

The bottle body and a small portion of the background

Maintain the structure while matching the warm afternoon light and the reflection from the travertine stone

Highlights are too harsh

The sunlit side of the bottle

Change the concentrated highlight into a wider, softer band of window light

The bottle base appears to be floating

The bottle base and its contact surface

Add natural, subtle shadows close to the bottle base

The tabletop texture is broken

A small area at the junction

Continue the travertine texture and perspective without altering the bottle body

Do not write “only adjust shadows” as a long prompt that includes background, color, material, and composition. Fix one major issue at a time—it’s easier to preserve what already works.

Why should enlargement be left until the end?

High‑resolution enlargement can enhance edges and textures, but it cannot correct incorrect lighting directions, perspective, or contact relationships. If you enlarge before checking the lighting, any flawed highlights, artificial textures, or unnatural edges may become even more noticeable.

A more reliable sequence is:

Local retouching → Lighting and shadow review → Minor adjustments → 100% inspection → Finally, enhance image quality.

After enlarging, re-examine the glass edges, the cap seam, shadow transitions, and tabletop texture. Breaks that aren’t visible in thumbnails may become apparent when viewing the product page at full size.

Common issues

Why do objects in the selection area always appear to float?

A common reason is that the selection doesn’t cover the contact surface and projection area, or the prompt only describes the object itself without explaining how it rests on the surface. Expand the selection near the bottle base and clearly define the shadow areas and main projections.

Do I need to specify lighting in every retouching prompt?

When adding or replacing elements that will be affected by ambient lighting, it’s advisable to explicitly state the main light direction, softness/hardness, and color temperature. For simply removing minor blemishes, there’s usually no need to repeat the entire lighting description.

The shadow direction is correct—so why does it still look pasted on?

Continue checking the shadow’s softness or hardness, the highlight placement, color temperature, contact shadows, and environmental reflections. If any of these clearly don’t belong in the original scene, it will disrupt the overall coherence.

Why are glass and metal harder to retouch than matte objects?

Because they not only display their own colors but also reflect or refract the surrounding environment. The prompt should describe the primary material and lighting conditions, and during review, verify that the colors of bright windows, dark walls, and countertops appear appropriately on the object.

When should you abandon local adjustments and start over?

If an object’s scale, perspective, structural integrity, and lighting are all incorrect at once, continuing patch‑by‑patch corrections can easily accumulate new inconsistencies. At this point, return to an earlier version of the original image, narrow the scope of the task, and begin a fresh round of initial retouching.

Summary

To make AI‑generated additions blend naturally into the original image, you can standardize the process as follows:

Read the main light → Record its softness/hardness and color temperature → Reserve selection areas for contact shadows and projections → Describe the object and lighting → Check projections, highlights, color temperature, and reflections → Make small‑scale secondary adjustments → Finally zoom in.

When using local retouching in PixPix, first preserve the original image’s camera position, background, and lighting anchors, then generate only the localized changes needed. Rather than endlessly adding adjectives like “realistic,” “natural,” or “high‑end,” clearly defining where the light originates and how it falls onto the object and tabletop will yield images more suitable for subsequent design stages.

AI Image Tool Built for E-commerce Teams

For new product launches, advertising, and promotional campaigns, use AI to generate product images, scene visuals, ad creatives, and short video assets — making content production faster.