Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Custom pixel design sequence based on color mapping

  • Dan Ebberts

    November 4, 2024 at 6:12 pm

    It sounds interesting, and I’d like to help, but I can’t picture what you have in mind. More detail might be helpful.

  • Emmet Brick

    November 4, 2024 at 9:46 pm

    Thanks for the responses. I prepared an infographic, and I hope it explains my idea a little bit more clearly. If you need any more explanation, let me know.

    Additionally, I included an edited file with a pixel GIF and matrices.

  • Dan Ebberts

    November 4, 2024 at 10:23 pm

    Wow. Off the top of my head, I think that would take some pretty complex rigging. It seems like your matrices of numbers would have to be individual layers, rather than a single layer with CC RepeTile applied. Each layer would have an opacity expression that uses sampleImage() to extract the color from its location on the pixel motion layer. Then it would check to see if the sampled color is within a small range of colors (you probably wouldn’t want to try and match a specific color exactly), and if so, set opacity to 100%, otherwise 0. I don’t know if that’s the best approach, or even practical, but theoretically, I think it would work.

  • Dan Ebberts

    November 5, 2024 at 12:11 am

    The sampleImage() opacity expression could look something like this for your “1” layers:

    mc = [.482,.933,.557]; // match color (bright green)
    t = .01; // tolerance
    L = thisComp.layer("pixel-motion.gif");
    c = L.sampleImage(position,[.5,.5],false,time);
    Math.abs(c[0]-mc[0])<t && Math.abs(c[1]-mc[1])<t && Math.abs(c[2]-mc[2])<t ? 100 : 0
  • Emmet Brick

    November 5, 2024 at 1:24 pm

    Yeah, it works perfectly! 🙂 Thanks a lot!

    I am going to do the basic setup for each matrix. I found some of your previous code for creating a grid, and it works. But my question is, is it possible to easily/quickly duplicate n-number elements without using ctrl+d

    origin = [0,0]; // center of upper-left element

    hDist = 32;

    vDist = 32;

    numCols = 16;

    myCol = (index-1)%numCols;

    myRow = Math.floor((index-1)/numCols);

    origin + [myCol*hDist,myRow*vDist]


  • Emmet Brick

    November 5, 2024 at 1:57 pm

    I found script 🤠

    https://www.dropbox.com/scl/fi/9i13zq3y2stiokgu8hrj9/Duplicate.jsx?rlkey=d5ae401wstk1lhjsgiqyb08ls&e=1&dl=0

    Let’s start creating! Thanks again, Dan!

  • Brie Clayton

    November 5, 2024 at 4:35 pm

    Thank you for solving this, Dan!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy