[FFmpeg-user] How to add alpha channel to normal png image
Paul B Mahol
onemda at gmail.com
Sun Jun 28 13:11:25 CEST 2015
On 6/28/15, Paul B Mahol <onemda at gmail.com> wrote:
> On 6/28/15, qw <applemax82 at 163.com> wrote:
>> At 2015-06-28 17:11:03, "Paul B Mahol" <onemda at gmail.com> wrote:
>>>Dana 28. 6. 2015. 09:31 osoba "qw" <applemax82 at 163.com> napisala je:
>>>>
>>>> Hi,
>>>>
>>>>
>>>> PNG format supports alpha channel, but some png images don't have alpha
>>>channel. How to add alpha channel to those png images and set alpha
>>> value?
>>>>
>>>>
>>>
>>>See colorkey filter documentation.
>>>
>> I use the below command to run colorkey filter, and ffmpeg report there
>> is
>> no colorkey filter:
>> ffmpeg -i ./image.png -vf colorkey=green ./output.png
>>
>>
>> ffmpeg version 2.7.1 Copyright (c) 2000-2015 the FFmpeg developers
>> built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
>> configuration: --enable-gpl --enable-libx264
>> libavutil 54. 27.100 / 54. 27.100
>> libavcodec 56. 41.100 / 56. 41.100
>> libavformat 56. 36.100 / 56. 36.100
>> libavdevice 56. 4.100 / 56. 4.100
>> libavfilter 5. 16.101 / 5. 16.101
>> libswscale 3. 1.101 / 3. 1.101
>> libswresample 1. 2.100 / 1. 2.100
>> libpostproc 53. 3.100 / 53. 3.100
>> Input #0, png_pipe, from './transparent_3.png':
>> Duration: N/A, bitrate: N/A
>> Stream #0:0: Video: png, rgba(pc), 256x256, 25 tbr, 25 tbn, 25 tbc
>> [AVFilterGraph @ 0x1d1e900] No such filter: 'colorkey'
>> Error opening filters!
>>
>>
>> which version of ffmpeg has colorkey filter?
>>
>
> Git version.
>
But if image is simple I guess you could use geq filter to replace
alpha for similar colors.
More information about the ffmpeg-user
mailing list