实施Adobe Photoshop的“级别"使用ffmpeg的功能 [英] Implement Adobe Photoshop's "Levels" feature using ffmpeg

查看:145
本文介绍了实施Adobe Photoshop的“级别"使用ffmpeg的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Adobe photoshop中,我使用了色阶"功能来调整图像的阴影,中间调和高光.我需要使用ffmpeg的优雅解决方案来实现相同的效果.ffmpeg实现将帮助我以编程方式执行该操作.

我尝试使用ffmpeg上可用的色彩平衡滤镜.

ffplay -i输入-vf colorbalance = rs = -0.75:gs = -0.75:bs = -0.75:rm = -0.875:gm = -0.875:bm = -0.875:rh = -1:gh= -1:bh = -1

在photoshop中,通过以下设置,我可以达到预期的效果,

 阴影-199中间调-中点亮点-255 

解决方案

颜色级别

使用

原始,Photoshop,ffmpeg

  ffmpeg -i input.jpg -vf"colorlevels = rimin = 199/255:gimin = 199/255:bimin = 199/255" -frames:v 1 output.jpg 

由于您只是直接调整输入黑点,因此只需要调整示例中所示的 * min 选项.

曲线

如果您熟悉Photoshop中的Curves,则可以保存预设并使用

In Adobe photoshop, I used the "Levels" feature to adjust Shadows, Midtones and Highlights of an image. I need an elegant solution using ffmpeg to implement the same effect. A ffmpeg implementation will help me perform the operation programmatically.

I've tried using the colorbalance filter available on ffmpeg.

ffplay -i input -vf colorbalance=rs=-0.75:gs=-0.75:bs=-0.75:rm=-0.875:gm=-0.875:bm=-0.875:rh=-1:gh=-1:bh=-1

In photoshop I'm able to achieve the expected results with the following settings,

Shadows - 199
Midtones - midpoint
Highlights - 255

解决方案

colorlevels

Use the colorlevels filter and interpolate the values to match Photoshop:



Original, Photoshop, ffmpeg

ffmpeg -i input.jpg -vf "colorlevels=rimin=199/255:gimin=199/255:bimin=199/255" -frames:v 1 output.jpg

Since you're only directly adjusting the input black points you only need to adjust *min options as shown in the example.

curves

If you're familiar with Curves in Photoshop you can save the preset and load the ACV file with the curves filter:

ffmpeg -i input.jpg -vf "curves=psfile=file.acv" -frames:v 1 output.jpg

这篇关于实施Adobe Photoshop的“级别"使用ffmpeg的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆