Adding patterns and in depth talk about layer masks

Avery

Sleeping Dinosaur
Restaff
Joined
Oct 13, 2012
Messages
3,740
Reaction score
25,335
First Language
German
Primarily Uses
N/A
When I make tutorials I often use “layer masks” which are probably something that is not the most beginner friendly thing in the world. Not because they are difficult to use, just because they are a concept that might be a bit difficult to wrap your head around if you never heard of it.
So even if you avoided layer masks until now, there is one major reason to use them: they are non-destructive. That means, anything they do to your image can be undone in no time. Why that is so important is something we will talk about later.

What is a layer mask?
Imagine your image is projected onto the layer it is on by a projector. Now you put a transparent foil in front of the projector - nothing happens. That is the same, as if you would put an all white layer mask on an image: in short, an all white layer mask will have your layer be fully visible.
Now imagine I use a black marker, to draw on that foil - those parts will miss from the projection, as those black markings don’t let the light pass.
If I use a black marker that is not fully opaque (which would lead to grey, if used on a white layer mask), only some of the image comes through, resulting in a semi transparent area, the more opaque the “marker” was, the less we would see.
Now the great thing about this foil is that I can just pull it off, in case I realize I screwed up, and never ever altered anything on the layer I used it on. Or in case I like what I did but need it for a different layer as well, I can simply duplicate this foil and add it to the other layer as well.

How do we make and use a layer mask?
Let us say, we want to make this gentle guy here, Nature_2, be a striped cat with a white belly instead of an all black one:
Wx4swixAK7-FvfCmJ4e_tEGP3XPP2NyISgdfvd_gmKDRpi5BA9UotcwYDE7q3wcBQi9LyOQNcdPa-Sr8qeBVGb8DgAwqPn_BrQFneEDjNmcJmsQjTJOYN_ahzfY4CG7GrSnY7RdQVfJgx_rSnDTIxA

Before we do anything, we set the color mode from “indexed” to RGB, by going to “Image” - “Mode”. This will ensure we can have any color in this image, not just the preset color palette.
We of course then need to get the layers to put the masks on, so for white we usually start with a “Adjust color curve” to get the needed contrast and here I was also able to adjust the color to my liking via the other curves:
J028lne3JQPF_9jYLfxP0c8p55GFZrb7ZBEgSWIO23H0jysSimkH2RcyVrwfdfP7SVI29wXuHFVkQk0xNqOAZP65WVRA9UkVcQepWFZ6VSzNXQex-mlroIzBhYtwXSBzY6R8hgbNZwQs7AC6QgrCWw

Proceed with the brown layer and here are my results, a little moved so you can see I moved them to the side so you can see them in the order I have them:
AtqFi8XsykokGRmsvQsCWferB85sy0RbO3LhA3dTE4g32WsuRWN4BzciNvU1ko3XM7RXs38WkrHn094_C_JO-CQRH5TSHY_uhORE5CjCkBGMqKIU528FwW-kHIRqaR_hcU5E9ro8omVDaBs62GaLxA

Now we right click on the layer we want to start with - here white - and choose “add layer mask”. We could use the layers alpha channel or a premade selection, but in this and most of our RM dev cases, a solid layer mask is a good first step, and I personally like to start with a “blank canvas”, so all black.
H50clwbhu_x6foajSGbfSpggg630Cvsc_KPiKyW0ZxufLMYLy6OoFtWi2aa_MziBhqi0i2AQXo9dK-6YUqNTS-hkjqK8DtHPwqNevCgjX7l_UUzlCW1OL3Ufvcw1XbcGyhNsaeUDymWHbaqEc5vRwQ

After this addition, the layer is still there, but as explained above, nothing of it “shines” through the mask:
L1Z8aIaThPhirrpHd7FOybj8hL9c6xi16Uv4t715hev5LAqsM_ZQ97S1otFObTAYsusE9WM0LomXvbUqfYEVcBZMUMCPnuR7K4QKXfKuVVizG5fwHHP-uoE8oS-ZzGREVGBNIOGAQEWYEfcR6BKvbw

Now we ensure, that the “edit layer mask” box is ticked, which means if we now draw on this layer, we actually just touch the mask and not the real image.
LGBTxEaus8e6IE-OTIsj1FhW93wZi3uM7iACWc5M7HHTj-pWVT90mpPTkCpal8zIb_dGCOEE7LmO1gbdb0finsnX9QLT79c5vTR1tUYUON6K-OnYMLpi_E-Bfzn1BE_8AQDhc9T3Jaya-k40LOY67Q


On which we use a white pencil to draw in the “white belly”, we talked about before (or whatever you are going for).
This is my layer mask:
oqx6zggKG3uwNvYtl3agYIF3HYaV0j-1viNsMVD_NngswfDL-EpM-1wiXfBmzmNMxtvwYa1LI3jPDm8vh4JBQp9RwcIA5ifDYdzMBMh_pTOJCDmxoDQ6cGcsgFge7B2SsdL5gkDVEVxpydruFSfquA

and this is how the image looks like as of now:
hNI7zLikVcVeT0QmPWO-aSDiM-KEyD84Y6gAmrIkc9kWMwps3jAf4qUfaBkxgS_PyVwyWJ8LISTkOfF7aJn6gjHH1j48QMBXCpWTwT-i1FL7URNCvfQHZm9VNrStT-9I_zBTzjaMHnNXnIKPlkgnBw

If you want to check how your layer mask looks, you can either right click on the layer and use “show layer mask” or shift+click on the layer mask.

Now we proceed with the brown layer, it also needs a layer mask that has white parts where the brown fur stays and black parts for everything else:
SYS7_kUOFHDrpednkMP5SnUO9BQj5xjgHq9g9xSIlJlv2LEWIFGux5K26huvD372piDuduJtUcxWMxBqzsRjaKmpunAmFN5JuELwRUFSnEOS5cfrnfRBDItbZzBFFMdQFI_yPgPMkqO67ETmrP2j2g

Now imagine, we might have used the eraser instead of a layer mask and now decided, that we would want some additional white spots, we can just draw them in on the layer mask, if we erased these parts, they would be gone and if we did not save the layer unedited somewhere, we had to try to get it recolored to exact the same shade again so these spots would not stand out - not ideal.
LGqHpDoJjuI0mHiyqdY1i46__mSRlXpMV2Hc1G6n9M-LBpxLr3WhBGlzZiXfIF8_ljr-6UBi33XfDA7r89RBxfJ1XanfQUR6Mxr-QUEcNxM5UssdKqDdI796qRWkXtkhgTx2y83WD8CRBjKloKaLsA

Now there is a problem left: the outlines were not solid, but have anti aliasing by default, and the recoloring lead to some weird color differences and more solid lines, as there multiple semi transparent pixels add up.
How do we tackle such a problem?
We use the “select by color” tool on the transparent background of the default, unedited Nature_2 layer that is our bottom layer. On that selection, we use “Select”- “Grow selection” and then, for MZ busts, 2 is a good value:
DFg0uLX2lb8YUB8io-EIfmtbDBl9ibz2iBRDuoy7KL1crKM8ZmSFiKlwoI5kzrVGbKed6yDvf7p5a-HLzUdb1fYbmZ-bmAVloNlRu9MLYklgx2lODWGjh24ZK-v4ce0JUzN7aZu3VDy8UkePha20JQ

The result is this:
LyWOim-01xoiodUP8Lq7Re-6WUqYf1zrjoWv_kJMUrjmPLfItomnGFM3nTG6E-hip05LWr9N9SAM18OM5w7EL_pytJDX7ycUvp_29A2aOlYzPcFNXN8LW3fKyK3IG2_DzP5OHKphtHINXwQ0MeJdSA

We have all the transparent areas selected, +2 pixels, which means, we have selected the part that should be all black on every layer mask but (in this case not existing one) one bot the bottom layer.
We now bucket fill (fill wole selection) this part on these layer masks with black, and - tada!
OMvEjySXa8V-wpqqm5P7Rzn3nNFxgtb92S789sPjT8j2ClsCrNklCbvjbL4WW0ZpZfDEeWULjl7CnShT1WC4I5aB9Y7r4kSDhJzgtGIDoU8aLFexj7mqCmAZhOvyM-nXkLHbzUuD7y9NWW7-AU6m-A

or as full picture:
QvUpyYg7_c58mLPGrMW42DofWJJaN3-EYb6pxBvaVCtnTGFxohHhHIj4XufQq7knU8LC69AzibRnmmWP17Acoyx7W4ERjLJPoFt_k1nGYrxXhT82GVVpUe1toyw7pXNUPh4hxb3DbpS_Ge4x6bOTTw

Such “dying in a pattern” just works on a solid color, so if that cat already was black and white as in MV, we would have a much harder time giving them such a makeover.

That being said, this method is also great to give your heroes multi-colored hair, dye a pattern into clothing or add scars to faces!
W6qLSzqJXo5dlwxKUDchty2k7efExmPOhNyYuKf0IiQimpf4h43qMuskmtTHJbBkM0VO8dSqmEyLq6pwkG7wEVGQ6iUI_idXJK6JPyFCIQm4kAawwuY14psHDuC7T-aKFNShHazRDbKBKRJkr2i8pg

For example, here I did it all at once!
And without any problems, I could scribble onto the layer masks, until I got everything I wanted to be there and got rid of everything that I did not!

So hopefully this motivated you to add layer masks into your edit routine, they are a ofter underused tool that helps a lot!
 

ShadowDragon

Realist
Regular
Joined
Oct 8, 2018
Messages
7,805
Reaction score
3,193
First Language
Dutch
Primarily Uses
RMMV
I use layerMask sometimes, but its not exactly equal if they use Photoshop,
but is close.

the only thing I do a slightly different just in case, I copy the image, hide it,
and work on the copy one, to set a layer mask, if something goes wrong,
I always have a backup.

but there are some things I didn't know off, but I did more text effects than
graphics, but this has some cool things I need remember, as it can be used on
loads of things with little work.

thanks again for a usefull tutorial with tips :)
 

Latest Threads

Latest Profile Posts

Just completed another cutscene. Huge one for the story. I'm so enthusiastic about where this game is going.
Man, the enemies in the new Sonic Frontiers update are totally roided up. I wanted a little more difficulty myself, but Sonic Team turned the dial a bit too far.

At least the new tracks for roaming Ouranos Island as Amy, Knuckles, and Tails slap hard.
mz_quest_victory_scene.gif


This battle victory screen has been pretty fun to work on. Not only can party members set new personal records for their contributions to the fight, but when they do, the party remarks on the accomplishment!
When you love all your children equally, but the world sees it differently.
popular.png
Found an old, unfinished project of mine, where you fight movie screenplays as an up-and-coming actress.
Turns out I used VX way back when. I may need to remake this in MZ, the premise was kinda hilarious.
1696205441250.png
1696205637522.png

Forum statistics

Threads
134,981
Messages
1,252,582
Members
177,865
Latest member
donghoreplicaturbowatch
Top