Share your useful formulas here!

The formulas that ship with PM are very basic. So why not share some of your own that you think may be beneficial for other people?

I’ll start. Paint Single Color mode is nice, but what if you need to stamp brushes in different colors that still have the shading (or the closest approximation of it using your palette) of the original? This is similar to how grayscale brushes work in software like Photoshop.

The way it works, is that it first averages all RGB channels (which makes it workable with any brush, not just ones that were made with it in mind), then it multiplies colors of each channel by the foreground color, then it divides everything by 255, otherwise it wouldn’t work as everything would come out white.

These are brush formulas for both RMB and LMB (made it so it works with the bg color as well):

And here it is in action:

obraz

As you can see, in case of the first image, I’ve used 3 pixel-wide grayscale brush to make cracks. Then I’ve used the brick as a brush to make the second brick, the green one. I didn’t have to change anything other than the drawing color to make both happen.

Please share your formulas as well!

5 Likes

Bumping this old thread because I just now discovered the formula editor and I love it!. Made something very simple but very nice.
In indexed mode it’s just:

(256 +a +fg -bg) mod 256
(256 +a -fg +bg) mod 256
on LMB and RMB respectively

All it does is cycle every pixel through the palette by the same amount, but you can quickly set how far to step by picking foreground and background colours, so if I make a button in greyscale, I can pick a medium grey from the image as BG colour, then pick any colour in the middle of any gradient as the foreground colour, then stamping down a brush will recolour everything in a single operation! Right mouse works like an undo, if you get FG and BG mixed up and the colours shift the wrong way on left click, right click will restore it, then right click again to get what you wanted.

Super handy for my workflow. :slight_smile:

(I tried to give this formula away earlier this year hate to bump an old thread but here it goes.)

Often I find that I want to change the color from one object to another and stencil or paint bucket are just too slow.
Try this trick, In mode select formula then go to tools and settings add this will open up the dialog for programming the brush. Now enter in in the “left mouse buttton"if(a==bg,fg,a)** and enter in in the” right mouse button"if(b==fg,bg,b).
Now when you select the foreground color as the one you want to change to and the background color you want to change from it will work and it will not effect anything that is’nt the background color.

2 Likes