how does the colour brush in paintshop pro work?

Started by
2 comments, last by swiftcoder 11 years, 1 month ago

Ive used gimp, and im pretty sure I know how the brush works in gimp. newcolour=originalcolour(r,g,b )*(1.0f-brushpower)+brushcolour(r,g,b )*brushcolour.

But paintshop pro is different... and better, I want to code the brush in paintshop pro, but I have no idea except what I want it to look like.


Heres a picture of the brush at 1% opacity, and paintshop pro really nails it better than gimp and my program.
The strokes are exactly the same colour!!!

brushex.png


so what could be the secret to getting the brush to look like this?

I tried working the brush with hsl instead of rgb, but it didnt seem to get the effect...

Advertisement

I could imagin the drawing is done in linear space, while yours and gimps blending works in srgb space.

another point might be the internal precision, especially when you blend a lot of layers on top, the quality loss due to rounding can be quite noticeable, having 16bit internal precision can be quite beneficial.

(newer CPUs have instructions to convert float16 to float32 aka half to float, this could speed your rendering up).

brushes aint brushes.

i think ive got it!

you do use hsl instead of rgb, treat black as saturation 1, not 0. then interpolate saturation 3 times the speed of brightness and just clamp the hue. (the real version would need to interpolate hue, will get to that later)

brushex2.png

its similar... anyway. yeh def. not rgb space.
im very pleased, skin comes out really well out of black in psp, now i can try it in my program. Precision isnt important i dont think im pretty sure psp is only 8 bit, 8 bit precision ends up distorting the colours a bit and i actually prefer it that way funnily enough. :)

yeh def. not rgb space

RGB is a really poor space for just about every sort of calculation :)

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement