This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Using a blend mode with opacity control

Tags: None
(comma "," separated)
delfine
Registered Member
Posts
30
Karma
0
Hi, I've just discovered a feature that has made me incredibly happy. I've found that transitions can be stretched over an entire clip and used with blend modes between two stacked clips. This option of blending layers has been something I've been looking for in an editor for a long time, and it turns out to be very simple and painless in Kdenlive, just drag and drop.

But ... I can't find any way to control either the track opacity, the clip opacity or the transition opacity once I have the two blended tracks. And if I use the Composite transition to control the opacity, it won't let me add another transition to control the blend mode.

Am I missing something right under my nose? Does anyone know of a way to be able to use both a blend mode and opacity control?
delfine
Registered Member
Posts
30
Karma
0
So far the only way I've found is by duplicating the video clip, but this is kind of a clunky workaround. I'm sure I'm missing something.

Video 1 > overlayimage.png
softlight transition
Video 2 > myvideo.avi
composite transition at 50%
Video 3 > myvideo.avi (copy)

Then shift > select all and ctrl-G to group so they all function as one clip.

Does anyone know a better way?
Inapickle
Registered Member
Posts
157
Karma
3
I've recently started using KDenLive 15.08.1 on Kubuntu 15.10 (AMD 64).

Like the above poster, whilst I am delighted to see that all of the common blend/mixing modes are represented in KDenLive, it is frustrating to find that the only way (as it would appear) to apply them to an entire clip with opacity control is by creating a three-layer "sandwich" using a "composite" layer to control the opacity of the blend operation above it. Seems a very convoluted way of doing things, and especially if one wishes to apply one blend type over another, as is often the case.

Could the developers not see fit to incorporate opacity control for all of the blend modes, not just "composite" ? They have much wider application than just transition effects.
TheDiveO
Registered Member
Posts
595
Karma
3
OS
Inapickle
Registered Member
Posts
157
Karma
3
Yes, I was delighted to find this morning that action is being taken on that request.
TheDiveO
Registered Member
Posts
595
Karma
3
OS
My experience of the past year is that Kdenlive development has been improved much. The developers are taking care of problems, but they need clear and concise bug reports for this. But it pays off for all of us. I've files a bunch of reports in the past half year and many of them have been fixed quickly, some even lightning fast.
Inapickle
Registered Member
Posts
157
Karma
3
Plus, in this case, there appears to be a ready solution. I had no idea what the frei0r.cairoblend transition is about.
TheDiveO
Registered Member
Posts
595
Karma
3
OS
I asked for keyframable opacity and jbm was so kind as to implement it too. This is something I can immediately use in my current project. Great. :) :)
Inapickle
Registered Member
Posts
157
Karma
3
I'm just trying to understand how this works. So you're saying that the requested changes (both yours and mine) have now been implemented and that it possible to access them now by recompiling KDenLive ? I thought I would have to wait until the next release. So how do I do that? I have absolutely no experience in recompiling anything.
User avatar
ttguy
Moderator
Posts
1152
Karma
6
OS
Inapickle wrote:it possible to access them now by recompiling KDenLive ? I thought I would have to wait until the next release. So how do I do that? I have absolutely no experience in recompiling anything.

You could try https://community.kde.org/Kdenlive/Deve ... ild_script
What linux distro are you on?
Inapickle
Registered Member
Posts
157
Karma
3
Kubuntu 15.10 (AMD 64)
TheDiveO
Registered Member
Posts
595
Karma
3
OS
I'm on Kubuntu 15.10 64bit too.

If the script method does not work, simply follow the step-by-step instructions here: https://community.kde.org/Kdenlive/Development/KF5 It's slightly more involved but it allows you to keep the stock Kdenlive side-by-side with your freshly compiled Kdenlive. You can install your compiled Kdenlive into a separate folder, together with newer MLT and ffmpeg. For me, this has been proven to be much better than getting broken stock Kdenlive setups...

Please take note of the discussion page associated with the above page. I've added some notes about additional packages that need to be installed in order to compile on (K)Ubuntu 15.10.
Inapickle
Registered Member
Posts
157
Karma
3
Thanks both,

I've got a bit distracted with this "full luma range" testing thing, so now is probably not a good time to try it. But I'll give it a go after.

Cheers.
Inapickle
Registered Member
Posts
157
Karma
3
Having just switched from Sunab's ppa to the developmental (master) branch repository - ppa:kdenlive/kdenlive-master - I find that the requested opacity control for the blend modes is now implemented in KDenLive 16.07.70 and made available through the Cairo Blend transition effect.

On testing however, it appears that a number of the blend modes are producing chromatic aberrations. I am posting below a series of screen shots (off the project monitor) that demonstrate the issue. The test system was as follows.

1. KDenLive 16.07.70 running on Kubuntu 15.10 (AMD 64)
2. Test clip - for this series of examples, a 1080/29.97p.mts clip from a Canon HF-G10 AVCHD camcorder that had been transcoded to Matroska.mkv (HuffYUV). Project profile set accordingly.
3. Loaded the clip on the timeline and aligned to the track (Video 1) head.
4. Duplicated and co-aligned the clip on track Video 2
5. Applied Cairo Blend transition between the two tracks, spanning the full length of the clip.
6. Selected the desired blend mode and adjusted the opacity using the slider.
7. Observed the result at the set opacity and took a screen shot of the frame off the Project Monitor view.

To enable comparison with what could be considered the "expected" result, the same blend operations were performed on the same test clip (converted to RGB with Rec709 coefficients) using a scripted AVISynth function that utilizes the same blend mode formulas as those used in GIMP and gives identical results to the Gimp blend operations. The composite images below show the result obtained with the KDenLive blend mode as the top frame and the result obtained with the AVISynth function as the bottom frame.

The results were as follows:

1. Here is the result obtained with the "Normal" blend mode applied. As expected, since the two clips are identical, this blend operation has no effect and the result is identical to the original frame with no effect applied:

http://i.imgur.com/KY8Fd9N.jpg

Note: The Lighten and Darken blend modes also have no changing effect when the clips are identical.

2. The blend modes Overlay, Hardlight, Softlight, Screen and Color Dodge all demonstrated the chromatic aberration and in a similar pattern. When set at opacities ranging from 0 - 49% there was no chromatic aberration and the expected blend outcome was observed. At 50% opacity however the chromatic aberration became evident and became more severe/extensive as the opacity was increased through to 100%. It appeared to be localized to the brightest areas. Here are the respective frame shots taken at 25% and 75% opacity:

Overlay
25% Opacity: http://i.imgur.com/1IK2bOZ.jpg
75% Opacity: http://i.imgur.com/vPP7SDs.jpg

Hardlight :
25% Opacity: http://i.imgur.com/Th62a0X.jpg
75% Opacity: http://i.imgur.com/63iiqdi.jpg

Note: Hardlight is merely Overlay-commuted and so is expected to give the same result when the two clips are identical

Softlight:
25% Opacity: http://i.imgur.com/7R8yjw3.jpg
75% Opacity: http://i.imgur.com/Uup8CFN.jpg

Screen:
25% Opacity: http://i.imgur.com/rfW8B2N.jpg
75% Opacity: http://i.imgur.com/xFmrjGG.jpg

Color Dodge:
25% Opacity: http://i.imgur.com/n76MaG2.jpg
75% Opacity: http://i.imgur.com/QbsUBIy.jpg

Note: Ignoring the chromatic aberration, the KDenLive Color Dodge blend mode does give a slightly different result to the AVISynth version (which is identical to the Gimp version and also Photoshop). So possibly KDenLive uses a slightly different blend formula.

3. The 'Add' blend mode also produced the chromatic aberration, but in this case it manifested and progressively increased in severity from 0 - 100%:

25% Opacity: http://i.imgur.com/HoWCOEC.jpg
75% Opacity: http://i.imgur.com/ZVlzRl0.jpg

Note: It was assumed here that the "Add" blend mode in KDenlive is equivalent to what is called "Linear Dodge" or "Additive" in other imaging programs.

4. No such chromatic aberration was observed with the Multiply, Color Burn, Exclusion and Difference blend modes at any opacity, which is not surprising as these blend modes produce a darker image:

Multiply 75% Opacity: http://i.imgur.com/XvnD9J9.jpg
Color Burn 75% Opacity: http://i.imgur.com/qdMhAZb.jpg
Exclusion 75% Opacity: http://i.imgur.com/M11OwNS.jpg
Difference: 50% Opacity: http://i.imgur.com/E8Xs0Ic.jpg

Similar results were obtained with other test clips.

However, these chromatic aberrations are not seen when the equivalent blend modes, individually listed under Transitions, are applied in the same way.

Given the observed pattern of results it seems reasonable to suggest that the source of the chromatic aberrations is a bug in the Cairo Blend opacity computations, possibly generating (non-truncated) off-the-scale (>255) luminance values which give rise to these spurious colours. Purely speculation.

I will file a bug report in due course referencing this post and observations.

Last edited by Inapickle on Wed Mar 30, 2016 12:43 pm, edited 4 times in total.
TheDiveO
Registered Member
Posts
595
Karma
3
OS
Thank you for checking and discovering this problem! I vaguely remember seeing similar bleeds when playing around with cairoblend bit thought it was my mistake. This bug may need to be send upstream instead, not exactly sure, but it could be a bug in MLT or cairo.


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], Sogou [Bot]