Pseudorandom binary mask for animated dissolve effect

113 Views Asked by At

I'd like to create an animated binary dissolve effect:

black text "Dissolve" 50% dissolved on white background

The image was created with The GIMP's Dissolve Layer mode at 50% and blends the originally solid black text into the white background. The mask appears random, but I think it's not really, as at its maximum, every pixel in the mask needs to be set (the text then would be completely gone).

They say

"Dissolve" mode corresponds to randomly dithering the alpha channel to the set {0.0, 1.0}:

COMPOSITE(a1,c1, a2,c2,Dissolve) = chose pseudo-randomly between
                                (1.0,c2) with probability a2
                                 (a1,c1)  with probability 1-a2

How can such (pseudorandom) mask with variable density (probability) be generated? Just add random pixels until the desired density is achieved? Is there "an exact" method?

My initial toy data was this:

mask         new bits
00000000
          <- 01010000  
01010000
          <- 10001000  
11011000
          <- 00100001  
11111001
          <- 00000110  
11111111

That would be four "unique" frames for 8 bits of data, so 2 bits per frame.

The desired mask size is in the order of display resolutions, let's say 640x480, with 30 transition frames.

The "mask" frames may change, i.e. previous bits may move ("randomly", same count but different positions), but then of course the "new bits" need to be placed in still available spots.

Any minor hints and major rewrites with the proper terminology appreciated (please forgive the vague question, it originates from an idea regarding my question on https://computergraphics.stackexchange.com/questions/5104/pixel-dispersion-dissolving-algorithms).