網頁

《巴里·林登》Barry Lyndon《亂世兒女》by Stanley Kubrick - 韓德爾《薩拉邦德舞曲》(Sarabande),使用 NASA 蔡司(Zeiss)50mm f/0.7 鏡頭 最大光圈鏡頭拍攝 1975

Barry Lyndon《亂世兒女》 Stanley Kubrick,    使用 NASA 蔡司(Zeiss)50mm f/0.7 鏡頭 最大光圈鏡頭拍攝 1975




《巴里·林登》(Barry Lyndon,又譯《亂世兒女》)是史丹利·庫柏力克(Stanley Kubrick)於 1975 年執導的史詩歷史劇情片,被譽為影史上最偉大的視覺傑作之一。這部電影改編自威廉·梅克比斯·薩克萊 1844 年的小說《雷德蒙·巴里的運氣》。

以下是關於這部電影的幾個關鍵看點:

1. 革命性的攝影技術

  • 燭光攝影:庫柏力克為了追求極致的真實感,堅持不使用人工輔助光拍攝室內戲。他使用了從 NASA 借來的蔡司(Zeiss)50mm f/0.7 鏡頭,這是當時世界上最大光圈的鏡頭,專為阿波羅計畫拍攝月球背面而設計。這使得電影能夠在純燭光的環境下完成拍攝,呈現出如古典油畫般的質感。

  • 古典美學:電影的每一幀都像是一幅 18 世紀的風景或肖像畫,深受庚斯博羅(Thomas Gainsborough)和霍加斯(William Hogarth)等大師的畫作影響。

2. 故事大綱

影片分為兩部分,講述了 18 世紀一名愛爾蘭年輕人雷德蒙·巴里(Redmond Barry)的一生:

  • 第一部分:講述巴里如何從一個貧窮的愛爾蘭青年,經歷戰爭、投機和冒險,最終憑藉心機與運氣,入贅豪門,改名為巴里·林登,晉身英國貴族階層。

  • 第二部分:講述他在獲得名利後的墮落與不幸。他與繼子布林登勳爵的衝突、婚姻的破裂以及揮霍無度,最終導致了他的潦倒與失敗。

3. 主題探討

  • 社會階級與野心:電影深刻揭示了 18 世紀歐洲社會嚴苛的階級制度,以及一個人試圖跨越階層時所面臨的虛無與代價。

  • 宿命論:在庫柏力克的鏡頭下,巴里雖然努力鑽營,但命運似乎早已註定。電影中冷靜、客觀的旁白進一步強化了這種旁觀歷史更迭的宿命感。

4. 音樂運用

庫柏力克巧妙地改編了古典音樂,包括韓德爾的《薩拉邦德舞曲》(Sarabande),這首曲子也成為了本片的靈魂,貫穿全片營造出莊嚴且悲劇的氛圍。

5. 相關影片參考

如果你想更深入地了解這部電影的製作細節與影評,可以參考以下影片:


這支傳奇的蔡司 Zeiss Planar 50mm f/0.7 鏡頭,其「0.7」的數值並非憑空而來,而是嚴格遵循光學幾何公式計算的結果。

1. f/0.7 是如何計算出來的?

光圈值(f-number,記作 $N$)的定義是:鏡頭的焦距$f$)除以其入瞳直徑$D$)。

$$N = \frac{f}{D}$$

對於這支 50mm 鏡頭:

  • 焦距 ($f$):50mm

  • 光圈值 ($N$):0.7

  • 計算直徑 ($D$)$D = \frac{f}{N} = \frac{50}{0.7} \approx 71.4\text{ mm}$

這意味著該鏡頭的有效進光孔徑直徑約為 71.4 公釐。在攝影光學中,當 $f/\text{number}$ 小於 1.0 時,代表其進光孔徑已經大於其焦距,這在光學設計上是極大的挑戰。


2. 鏡頭的物理尺寸

這支鏡頭並非一般的消費級鏡頭,為了達到如此誇張的光圈,它的體積與重量都非常驚人:

  • 外殼直徑:約 76 公釐 (76mm)

  • 長度:約 165 公釐 (165mm)(包含後方的特殊轉換套件)。

  • 重量:約 1850 公克 (1.85kg)

  • 鏡片結構:採用 8 枚 6 組 的設計。

3. 鏡片的「厚度」與特殊性

關於「厚度」,這支鏡頭最特殊的地方在於它的**後焦距(Flange Focal Distance)**非常短:

  • 極薄的後端距離:最後一片鏡片距離感光元件(底片)僅約 5 公釐 (5mm)

  • 設計原理:這支鏡頭本質上是在 70mm f/1 鏡頭的基礎上,加上了一個類似「強效縮焦鏡(Speed Booster)」的後組鏡片,將光線強制匯聚到更小的面積上。因此,它的後組鏡片非常巨大且極度靠近底片,這也是為什麼庫柏力克必須大改他的攝影機(BNC 攝影機)才能塞下這顆鏡頭,甚至連反光鏡都必須拆除。

4. 0.7 的極限意義

在空氣中,理論上普通鏡頭的光圈極限是 f/0.5(這是由數值孔徑 $NA \le 1$ 決定的)。f/0.7 已經非常接近物理極限。相比於常見的 f/1.4 鏡頭,f/0.7 的進光量是其 4 倍(即多了兩檔光圈),這正是它能在純燭光下拍攝的關鍵。


當年庫柏力克(Stanley Kubrick)為了在《巴里·林登》中使用它,究竟克服了哪些「不可能的任務」:

1. 攝影機的「毀滅性」改裝

這顆鏡頭原本是為阿波羅計畫設計的靜態相機鏡頭,並不是給電影攝影機用的。

  • 拆除反光鏡:因為 f/0.7 鏡頭的後組鏡片離底片僅有 5mm,電影攝影機內部的旋轉反光快門(Mirror Shutter)會直接撞上鏡頭。庫柏力克被迫拆除了攝影機的取景系統,這意味著攝影師在拍攝時根本無法從觀景窗看到畫面

  • 盲拍與外置監視器:拍攝時必須透過外接的視訊輔助器來對焦和構圖,這在 1970 年代是非常前衛且困難的技術。

2. 極端的對焦挑戰:景深只有幾公釐

f/0.7 的光圈帶來了海量進光,但也帶來了極淺的景深。

  • 誤差容許度:在室內燭光戲中,演員如果稍微前傾或後仰幾公分,臉部就會完全模糊。

  • 精準測量:對焦員(Focus Puller)不能靠眼睛看,必須用捲尺精確測量演員與鏡頭的距離,並在地面貼滿標記。演員的動作必須像排練好的舞蹈一樣精確。

3. 光學設計的奧秘

蔡司 Planar 50mm f/0.7 的設計並非單一結構,它實際上是「強強聯手」。

  • 它的前組是一個 70mm f/1.1 的鏡頭。

  • 蔡司在後方增加了一個縮焦組(Collimator組件),將 70mm 的影像縮小到 35mm 底片的尺寸上,焦距縮減至 50mm,同時將光圈「推」高到了 f/0.7。這原理類似於現代數位相機使用的 Speed Booster(減焦增光轉接環),只不過那是 50 年前的頂級手工光學實驗。

4. 為什麼現在沒人做了?

雖然 f/0.7 視覺效果驚人,但它也有副作用:

  • 畫質偏軟:全開光圈時,畫面邊緣會有明顯的像差和解析度下降,呈現出一種朦朧的夢幻感。

  • 現代感光度提升:現在的數位感光元件(如 ISO 12800 甚至更高)已經不需要靠這種「光學怪物」來捕捉弱光。

但正因為這些技術上的「缺陷」與限制,才造就了《巴里·林登》那種宛如 18 世紀油畫般、溫潤且帶有呼吸感的電影美學。



To transition your code from a minimalist watercolor/pen style to the grand, dramatic oil painting styles of Thomas Gainsborough and William Hogarth, we need to adjust three main areas: the Model configuration, the Prompting, and the Post-processing (removing the "spiky" watercolor mask in favor of a classical canvas look).

Here is the updated code:

Python
import os
import torch
import gc
import random
from datetime import datetime
from PIL import Image, ImageOps, ImageFilter, ImageDraw, ImageChops, ImageFont
from diffusers import StableDiffusionXLImg2ImgPipeline

# 1. SETUP
# Removed the sketch LoRA as it conflicts with the heavy impasto/oil style
model_id = "stabilityai/stable-diffusion-xl-base-1.0"

pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
    model_id, torch_dtype=torch.float16, variant="fp16", use_safetensors=True
)
# Note: LoRA for sketching is removed to allow for thick oil textures
pipe.enable_sequential_cpu_offload()

dx = 1536
dy = 1024 

def add_classical_signature(image, name="Bruce Hsu"):
    """Adds a subtle, dark-toned classical signature."""
    overlay = Image.new("RGBA", image.size, (255, 255, 255, 0))
    draw = ImageDraw.Draw(overlay)
    font_path = "/usr/share/fonts/truetype/custom/Inkfree.ttf"
    font_size = 32
    
    try:
        font = ImageFont.truetype(font_path, font_size)
    except:
        font = ImageFont.truetype("/usr/share/fonts/truetype/liberation/LiberationSans-Italic.ttf", font_size)

    full_text = f"{name}"
    bbox = draw.textbbox((0, 0), full_text, font=font)
    tw, th = bbox[2] - bbox[0], bbox[3] - bbox[1]
    # Classical signatures are often tucked into the bottom right or left corner
    pos_x, pos_y = image.width - tw - 100, image.height - th - 60
    # Using a dark umber color common in oil paintings
    draw.text((pos_x, pos_y), full_text, font=font, fill=(60, 40, 30, 180)) 
    image.paste(overlay, (0, 0), overlay)
    return image

# 2. PROMPT - GAINSBOROUGH & HOGARTH OIL STYLE
# Gainsborough: Feathery brushwork, atmospheric landscapes, grand portraits.
# Hogarth: Rich detail, narrative depth, satirical realism, warm earth tones.
prompt = (
    "A grand oil painting in the style of Thomas Gainsborough and William Hogarth. "
    "Masterpiece, heavy impasto brushstrokes, visible oil paint texture on canvas, "
    "dramatic Chiaroscuro lighting, rich earthy pigments, umber and sienna tones. "
    "Feathery landscape backgrounds, atmospheric depth, 18th-century British portraiture style, "
    "detailed textures of fabric and nature, classical fine art."
)

negative_prompt = (
    "watercolor, pen sketch, ink lines, pencil, cartoon, digital art, "
    "flat color, bright neon, modern, photography, 3d render, "
    "white borders, minimalist, simple, distorted anatomy, blurry."
)

# 3. PROCESSING LOOP
file_date_str = datetime.now().strftime("%Y-%m-%d")
input_dir = './input_images'
# Change texture path to a canvas texture if you have one
texture_path = './canvas_texture.jpg' 
output_dir = './output_images/' + f"{file_date_str}_oil_painting"
os.makedirs(output_dir, exist_ok=True)

oil_texture = None
if os.path.exists(texture_path):
    oil_texture = Image.open(texture_path).convert("RGB").resize((dx, dy))

for filename in os.listdir(input_dir):
    if filename.lower().endswith((".jpg", ".png", ".jpeg")):
        print(f"Generating Oil Painting: {filename}...")
        init_image = Image.open(os.path.join(input_dir, filename)).convert("RGB")
        init_image = init_image.resize((dx, dy))
        
        with torch.inference_mode():
            # Higher strength (0.75-0.80) is usually better for Oil to override the original photo texture
            generated_image = pipe(
                prompt=prompt,
                negative_prompt=negative_prompt,
                image=init_image,
                strength=0.78, 
                num_inference_steps=40, # Increased for more painterly detail
                guidance_scale=12.0,    # Increased for stronger style adherence
                height=dy, width=dx
            ).images[0]

        # We remove the "Spiky Mask" because oil paintings usually fill the whole canvas.
        # Instead, we apply a subtle vignette to mimic classical lighting.
        final_art = generated_image
        
        # Add signature
        final_art = add_classical_signature(final_art)
        
        # Apply canvas texture via Multiply or Soft Light if available
        if oil_texture:
            final_art = ImageChops.soft_light(final_art, oil_texture)

        final_art.save(os.path.join(output_dir, f"{filename}_oil.jpg"))

        gc.collect()
        torch.cuda.empty_cache()

Key Changes Explained:

  • Style Logic: I merged Gainsborough’s "feathery" brushwork (excellent for backgrounds and nature) with Hogarth's robust, narrative "theatrical" lighting.

  • LoRA Removal: The sketch-style-xl-lora was designed for thin ink lines. Oil painting requires thick "impasto" (layers of paint), so I removed the LoRA to prevent the AI from trying to draw outlines.

  • Strength & Guidance:

    • Strength (0.78): Oil paint is opaque. To make the photo look like a painting, the AI needs more freedom to "paint over" the original pixels.

    • Guidance Scale (12.0): Increased this to force the AI to follow the "Oil Painting" prompt more strictly.

  • Masking: I removed the create_aggressive_spiky_mask. Watercolor often sits in the middle of a white page, but 18th-century oil paintings are almost always "edge-to-edge" on canvas.

  • Texture: If you have a canvas_texture.jpg (cracked oil paint or woven fabric), the ImageChops.soft_light function will make it look like the paint is sitting on an old museum canvas.



the color palette to be specifically more "warm/golden" like Hogarth, or more "cool/blue-green" like Gainsborough's landscapes?

除了著名的韓德爾《薩拉邦德舞曲》(Sarabande)之外,庫柏力克在《巴里·林登》中還運用了大量極具代表性的古典音樂與愛爾蘭民謠,來襯托不同階段的劇情與氛圍:

1. 愛爾蘭民謠(展現巴里的出身與鄉愁)

  • 《Women of Ireland》(Mná na hÉireann):由愛爾蘭國寶級樂團 The Chieftains(酋長樂團) 演奏。這首曲子旋律優美而哀傷,多次出現在巴里早期在愛爾蘭的生活以及他與表姐初戀的情節中。

  • 《The Piper's Maggot Jig》:輕快的愛爾蘭風笛舞曲,展現了當時愛爾蘭鄉間的熱鬧氣氛。

2. 普魯士與英國軍樂(戰爭與軍旅生涯)

  • 《Hohenfriedberger Marsch》:由普魯士國王腓特烈大帝親自創作的軍樂。當巴里在七年戰爭中加入普魯士軍隊時,這首雄壯且規律的進行曲強化了軍隊的紀律與威嚴。

  • 《The British Grenadiers》:經典的英國步兵進行曲,出現在巴里早期加入英國軍隊的場景中。

3. 古典大師作品(貴族階層的奢華與優雅)

  • 舒伯特:E大調第二號鋼琴三重奏(Piano Trio No. 2 in E flat Major): 這首曲子是電影後半段最重要的樂曲之一,特別是第二樂章。它常出現在巴里與林登夫人的對戲中,其旋律帶有一種壓抑的憂鬱,暗示了這段婚姻背後的空虛與悲劇性。

  • 巴哈:雙小提琴協奏曲(Concerto for Two Violins in D Minor):用於表現貴族聚會中的優雅與規矩。

  • 莫札特:《依多美尼歐》(Idomeneo)中的進行曲:增加宮廷生活與儀式的莊重感。

  • 韋瓦第:大提琴協奏曲(Cello Concerto in E Minor):展現當時歐洲上流社會精緻、冷靜的藝術品味。

  • 派希埃洛(Giovanni Paisiello):《塞維亞理髮師》中的詠嘆調:出現在賭場或社交場合,營造出一種輕浮而浮華的巴洛克氛圍。

庫柏力克對音樂的選擇非常講究「歷史準確性」,他屏棄了當時好萊塢流行的原創配樂,轉而發掘 18 世紀當代或接近該時代的樂曲,這使得整部電影在視覺與聽覺上達成了一種高度統一的古典美學。


在《巴里·林登》中,庫柏力克並不僅僅是「模仿」18 世紀的風格,他是直接將當時兩位英國藝術巨匠——**湯瑪斯·庚斯博羅(Thomas Gainsborough)威廉·霍加斯(William Hogarth)**的視覺語彙,轉化成了電影的靈魂。

這兩位畫家的風格迥異,庫柏力克巧妙地利用他們的不同特質,來區分電影的不同階段與情感基調。

1. 威廉·霍加斯(William Hogarth):諷刺、敘事與道德敗壞

霍加斯被視為「英國繪畫之父」,他最著名的作品是「現代道德題材」系列(如《浪子回頭》A Rake's Progress)。

  • 視覺影響:電影後半段展現巴里在貴族圈中墮落、酗酒、欠債的情景,幾乎是直接從霍加斯的連環畫作中「搬」出來的。

  • 敘事結構:《巴里·林登》整部電影的結構其實非常符合霍加斯式的「進程(Progress)」——一個年輕人如何從純真走向社會,最終因為貪婪與虛榮而自我毀滅。

  • 諷刺美學:霍加斯擅長在擁擠、混亂的室內場景中加入細節來諷刺貴族的虛偽,庫柏力克在拍攝那些繁瑣的宮廷禮節與賭局時,借鑑了這種充滿戲劇衝突的構圖。

2. 湯瑪斯·庚斯博羅(Thomas Gainsborough):優雅、自然與階級象徵

與霍加斯的尖銳不同,庚斯博羅以優美的肖像畫風景畫著稱,他筆下的貴族總是顯得高貴而略帶憂鬱。

  • 視覺影響:電影中那些廣闊、靜謐的愛爾蘭和英國鄉間風景,以及林登夫人那種蒼白、憂傷且精緻的妝容,都深受庚斯博羅的影響(例如著名的《安德魯斯夫婦》Mr and Mrs Andrews)。

  • 光影與氛圍:庚斯博羅喜歡在晚間或燭光下作畫,追求一種柔和、自然的質感。這與庫柏力克使用 f/0.7 鏡頭追求的「燭光美學」不謀而合。

  • 服裝設計:電影獲得奧斯卡的服裝設計(由 Milena Canonero 操刀),許多靈感直接源自庚斯博羅畫作中絲綢布料的褶皺與色彩搭配。

庚斯博羅 vs. 霍加斯:電影中的對比

特質威廉·霍加斯 (Hogarth)湯瑪斯·庚斯博羅 (Gainsborough)
主要風格社會諷刺、寫實混亂貴族優雅、詩意風景
電影用途表現巴里的墮落、賭博與家庭衝突表現林登夫人的美、貴族的權威與自然景觀
情感基調辛辣、嘲諷、混亂憂鬱、寧靜、莊嚴
經典對應巴里在豪宅中頹廢倒下的場景巴里與夫人在花園散步的遠景

庫柏力克通過這兩位大師,將「寫實的諷刺」與「理想化的優雅」交織在一起,讓《巴里·林登》不僅是一部電影,更像是一本動起來的 18 世紀藝術史手冊。