在摄影与摄像领域,“过曝”是一个我们经常听到的术语。大多数情况下,我们需要避免过曝,以防止细节丢失,从而对图片产生负面影响。
那么,什么是过曝呢?过曝即过度曝光,当光线强度超出相机记录能力时,便会出现过曝现象。值得注意的是,过曝并非光的固有特性,而是由于记录设备(如相机)的动态范围限制所致。
那么,在过曝情况下,设备是否完全没有记录下任何信息呢?事实并非如此。此时记录的信息是明确的,而且异常丰富,远超我们的想象。
假设图像色彩空间为RGB,当三原色中的任何一个通道值达到255(在计算机中,每个颜色通道的表示范围为0-255)时,计算机便会判定图像过曝。
例如,当RGB中的R通道值为固定值255时,无论GB值如何变化,都会被视为过曝。从理论上讲,此时可能会有多达256×256=65536种色彩组合呈现过曝状态。同理,当G或B通道值为255时,也会出现过曝的色彩组合。其中,RGB值均为255的白色,是我们大多数人所理解的典型过曝情况。
笔者因此特意使用C#编写了一段程序来生成三张RGB通道分别取值为255的图片。运行程序后,按下WIN+Shift+S键进行截图并保存(请注意,保存图片时应使用PNG无损压缩格式,以避免JPG格式压缩图片色彩空间),得到如下图片:
随后,我们在Adobe Camera Raw(ACR)中打开这些图片。在关闭右上角的“高光裁剪警告”功能时,图片显示正常;而当我们打开该功能后,便会看到当三原色中某一通道值达到255时,出现了明显的大面积过曝提示。
最后总结:过曝是指光线强度超出了相机传感器所能记录的范围,这个范围非常广泛,并不仅限于白色。
附:文中所用的代码如下:
<Window x:Class="DrawColor.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DrawColor"
mc:Ignorable="d"
Title="过曝色彩展示(在RGB三原色中,只要有一个值达到255,就被图像编辑软件判定为过曝)" Height="685" Width="1650" Background="#808080" >
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DrawColor
{
public partial class MainWindow : Window
{
const int SideLength = 2; // 每个方块的边长
const int GridSize = 256; // 整个网格的大小(包括0-255的范围)
public MainWindow()
{
InitializeComponent();
DrawRgbRed();
DrawRgbGreen();
DrawRgbBlue();
}
private void DrawRgbRed()
{
Canvas finalCanvas = new Canvas
{
Width = GridSize * SideLength,
Height = GridSize * SideLength
};
for (int y = 0; y < GridSize; y++)
{
for (int x = 0; x < GridSize; x++)
{
Rectangle rectangle = new Rectangle
{
Width = SideLength,
Height = SideLength,
Fill = new SolidColorBrush(Color.FromArgb(
255, // Alpha
255, // R
(byte)x, // G
(byte)y // B
))
};
Canvas.SetLeft(rectangle, x * SideLength);
Canvas.SetTop(rectangle, y * SideLength);
finalCanvas.Children.Add(rectangle);
}
}
this.colorGrid.Children.Add(finalCanvas);
}
private void DrawRgbGreen()
{
Canvas finalCanvas = new Canvas
{
Width = GridSize * SideLength,
Height = GridSize * SideLength
};
for (int y = 0; y < GridSize; y++)
{
for (int x = 0; x < GridSize; x++)
{
Rectangle rectangle = new Rectangle
{
Width = SideLength,
Height = SideLength,
Fill = new SolidColorBrush(Color.FromArgb(
255, // Alpha
(byte)x, // R
255, // G
(byte)y // B
))
};
Canvas.SetLeft(rectangle, x * SideLength);
Canvas.SetTop(rectangle, y * SideLength);
finalCanvas.Children.Add(rectangle);
}
}
this.colorGrid.Children.Add(finalCanvas);
}
private void DrawRgbBlue()
{
Canvas finalCanvas = new Canvas
{
Width = GridSize * SideLength,
Height = GridSize * SideLength
};
for (int y = 0; y < GridSize; y++)
{
for (int x = 0; x < GridSize; x++)
{
Rectangle rectangle = new Rectangle
{
Width = SideLength,
Height = SideLength,
Fill = new SolidColorBrush(Color.FromArgb(
255, // Alpha
(byte)y, // R
(byte)x, // G
255 // B
))
};
Canvas.SetLeft(rectangle, x * SideLength);
Canvas.SetTop(rectangle, y * SideLength);
finalCanvas.Children.Add(rectangle);
}
}
this.colorGrid.Children.Add(finalCanvas);
}
}
}