In [1]:
# %load ../../preconfig.py
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
plt.rcParams['axes.grid'] = False

#import numpy as np
#import pandas as pd
#import itertools

import logging
logger = logging.getLogger()

4 颜色、对比度、峡谷和LAB

颜色之间已经有很大差异的图片不太适合在LAB中修正。


In [2]:
plt.figure(figsize=(15,8))
plt.subplot(1,2,1)
plt.imshow(plt.imread('./res/fig4_1/ori.png'))
plt.subplot(1,2,2)
plt.imshow(plt.imread('./res/fig4_1/mod.png'))

plt.figure()
plt.subplot(1,3,1)
plt.imshow(plt.imread('./res/fig4_1/L.png'))
plt.subplot(1,3,2)
plt.imshow(plt.imread('./res/fig4_1/A.png'))
plt.subplot(1,3,3)
plt.imshow(plt.imread('./res/fig4_1/B.png'))


Out[2]:
<matplotlib.image.AxesImage at 0x117bfa978>

4.1 LAB的优势与不足

LAB的专长是把颜色和对比度分开来调整。

若在LAB中调整像那些老爷一样明艳的颜色,它们会超出色域。

调节LAB数值一般用来增加颜色的差异

4.2 色彩空间的对比分析

RGB

高光


In [3]:
plt.figure(figsize=(15,8))
plt.subplot(1,2,1)
plt.imshow(plt.imread('./res/fig4_5/ori.png'))
plt.subplot(1,2,2)
plt.imshow(plt.imread('./res/fig4_5/mod.png'))

plt.figure()
plt.subplot(1,3,1)
plt.imshow(plt.imread('./res/fig4_5/r.png'))
plt.subplot(1,3,2)
plt.imshow(plt.imread('./res/fig4_5/g.png'))
plt.subplot(1,3,3)
plt.imshow(plt.imread('./res/fig4_5/b.png'))


Out[3]:
<matplotlib.image.AxesImage at 0x1143c6080>

In [5]:
plt.figure(figsize=(15,8))
plt.subplot(1,2,1)
plt.imshow(plt.imread('./res/fig4_5/ori.png'))
plt.subplot(1,2,2)
plt.imshow(plt.imread('./res/fig4_6/mod.png'))

plt.figure()
plt.subplot(1,3,1)
plt.imshow(plt.imread('./res/fig4_6/l.png'))
plt.subplot(1,3,2)
plt.imshow(plt.imread('./res/fig4_6/a.png'))
plt.subplot(1,3,3)
plt.imshow(plt.imread('./res/fig4_6/b.png'))


Out[5]:
<matplotlib.image.AxesImage at 0x11c36c320>

好吧,RGB我更擅长点,花的时lsa|中尸日