9.33 RGBto YUV
On this page:
9.33.1 Examples
9.33.1.1 A linear progression from greyscale to saturated

9.33 RGBtoYUV

This effect allows us to manipulate the YUV components of each pixel. So what we do is convert each pixel from RGB (our default color mode) to YUV, then manipulate each pixel in that color space, and finally convert back to RGB to be displayed on the screen.

 

Parameters

 

Default

 

Range    

 

Description

 

ProgramString

 

n/a

 

n/a

 

This parameter *must* be set to RGBtoYUV

 

 

 

 

 

NumParams

 

0

 

>= 0

 

This value *must* be set to 2

 

 

 

 

 

r0

 

0.0

 

[0.0, 1.0]

 

r0 is the value that is added to the Y component

 

 

 

 

 

g0

 

0.0

 

[0.0, 1.0]

 

g0 is the value that is added to the U component

 

 

 

 

 

b0

 

0.0

 

[0.0, 1.0]

 

b0 is the value that is added to the V component

 

 

 

 

 

r1

 

0.0

 

[0.0, 1.0]

 

r1 is the value that is multiplied to the Y component

 

 

 

 

 

g1

 

0.0

 

[0.0, 1.0]

 

g1 is the value that is multiplied to the U component

 

 

 

 

 

b1

 

0.0

 

[0.0, 1.0]

 

b1 is the value that is multiplied to the V component

Input pattern: (A)

Important note: r1, g1 and b1 are zero by default (that happens because RGBtoYUV is embedded within the FragmentProgram effect). We need to explicitly set all three of them to 1.0 even though we might not necessarily want to use them. The reason is simple: These values are *multiplied* with the YUV components. If we leave them as zero, we’ll have a situation where our YUV components all end up being zero by simply instantiating the RGBtoYUV effect.

9.33.1 Examples
9.33.1.1 A linear progression from greyscale to saturated
; muSE v2
; 
;  The awesome of awesome styles.
;  The user image start at greyscale and progressively becomes saturated.
 
(style-parameters)
 
(segment-durations 8.0)
 
(define muvee-global-effect (effect-stack
                                 (effect "CropMedia" (A))
                                 (effect "Perspective" (A))))
 
(define muvee-segment-effect (effect "FragmentProgram" (A)
                                        (param "ProgramString" RGBtoYUV)
                                        (param "NumParams" 2)
                                        (param "r1" 1.0)
                                        ; The value below is multiplied with the U component
                                        (param "g1" 0.0 (linear 1.0     2.0))
                                        ; The value below is multiplied with the V component
                                        (param "b1" 0.0 (linear 1.0     2.0))))

The user image starts as a completely grayscale picture. As the segment progresses along, the U and the V components are linearly incremented from 0.0 to 2.0. If you look at the YUV documentation, you’ll notice that if we set the U and V components to 0.0, this is equal to a greyscale conversion and if we increase the U and V component to twice or more their original value, it is equal to a saturation conversion of the image. This is exactly what this style does. The image below represents the final output for one segment, i.e. the saturated version of the image.