使用 Python 将 3D Luts .cube 文件应用到图像中

Art*_*rDK 1 python image-processing lookup-tables

我正在寻找一种方法来做到这一点,我看过 OpenCV 但至少我只能找到用它应用1D Luts 文件的方法(256 长)。有谁知道如何使用 python 将3D Luts (64x64x64) 应用于图像?谢谢。

小智 6

这对我有用。

$ pip install pillow pillow-lut
Run Code Online (Sandbox Code Playgroud)

然后使用 Adob​​e Photoshop 安装中的随机 .cube 文件:

from PIL import Image
from pillow_lut import load_cube_file

lut = load_cube_file("NightFromDay.CUBE")
im = Image.open("image.png")
im.filter(lut).save("image-with-lut-applied.png")
Run Code Online (Sandbox Code Playgroud)

  • 哇!,这比我想象的要简单得多。在这里成功了,谢谢! (2认同)