Hello! Help needed with specific BitmapData problem

Hi, this is my first post! I’ll try and help people, but right now it is me that needs help.
OK, so I’m making a game. I have three parallax layers for the background - the top two have transparency enabled and I’m copying all three layers to a host BitmapData in order.

It’s working fine, but I need to know how to do something very specific: I need to know how to copy from one of the layers by using its hue and saturation values, and blending its brightness with that of the BitmapData I’m copying it to. This also has to ignore the transparent pixels and just work on the semi-transparent ones.

I have no idea how to do this. I tried merge() but I think I was barking up the wrong tree. I suspect it may invole some complex ColourMatrix stuff.

Can anyone help me accomplish this very specific task?

Thanks everyone! (-: