Random static fill in Designer

Hi,

Is there a way to make a static random fill with specified colours?

As an example, I have a 100 pix, I want them to be randomly assigned a colour, from a selection of R,G and B. It's a static timeline/scene. Ideally I would like to have a button "generate" and keep clicking it until I find something I like. 

I am trying to create a digital camouflage pattern.

Importing a JPG is not good, as it gets fades. 

Parents
  • The custom preset could look like this:

    -- Randomly generate colours for each pixel
    -- Define properties
    property("RandomSeed",INTEGER,12345,0,65535,1) -- Should the output be greyscale
    
    --Create the random table
    math.randomseed(RandomSeed)
    local randomvalues = {}
    for i = 1, width do 
        randomvalues[i] = {}
        for j = 1, height do
            randomvalues[i][j] = {}
            randomvalues[i][j]["R"] = math.random(0,255)
            randomvalues[i][j]["G"] = math.random(0,255)
            randomvalues[i][j]["B"] = math.random(0,255)
        end
    end
    
    -- Pixel function
    function pixel(frame, x, y)
        a = randomvalues[x+1][y+1]["R"]
        b = randomvalues[x+1][y+1]["G"]
        c = randomvalues[x+1][y+1]["B"]
        return a,b,c
    end


    If you create this custom preset and place it on the timeline you can use the 'seed' to get an image you like (and this will persist if you open the file next time)

    Example file: https://we.tl/t-TEyYjQgrfF  (link only 7 days valid)

Reply
  • The custom preset could look like this:

    -- Randomly generate colours for each pixel
    -- Define properties
    property("RandomSeed",INTEGER,12345,0,65535,1) -- Should the output be greyscale
    
    --Create the random table
    math.randomseed(RandomSeed)
    local randomvalues = {}
    for i = 1, width do 
        randomvalues[i] = {}
        for j = 1, height do
            randomvalues[i][j] = {}
            randomvalues[i][j]["R"] = math.random(0,255)
            randomvalues[i][j]["G"] = math.random(0,255)
            randomvalues[i][j]["B"] = math.random(0,255)
        end
    end
    
    -- Pixel function
    function pixel(frame, x, y)
        a = randomvalues[x+1][y+1]["R"]
        b = randomvalues[x+1][y+1]["G"]
        c = randomvalues[x+1][y+1]["B"]
        return a,b,c
    end


    If you create this custom preset and place it on the timeline you can use the 'seed' to get an image you like (and this will persist if you open the file next time)

    Example file: https://we.tl/t-TEyYjQgrfF  (link only 7 days valid)

Children
Related