Tux Paint Gradient Fills
ฝัง
- เผยแพร่เมื่อ 5 ม.ค. 2025
- A quick demonstration of the Radial and Linear gradient modes of Tux Paint's Fill (bucket fill) tool. (A "gradient" is a smooth change between one point and another.)
These were added in Tux Paint 0.9.26, from June 2021. We've since also added a Shaped gradient fill option (in 0.9.29, from April 2023).
First, Tux Paint looks at the color you clicked, and finds all adjacent (touching) pixels of the same/similar color. It uses this to determine which parts of the drawing will be affected. When using the Solid fill (the only fill available prior to version 0.9.26), it would simply replace those parts of the drawing with the currently-selected color.
The Radial gradient first determines the distance between the leftmost and rightmost pixels, and the topmost and bottom-most pixels that will be changed, to calculate the center and radius of a circle. Then, every affected pixel is changed to be a combination of the original color, and the currently-selected color, based on the distance from the center. Square root is used here.
The Linear (line-based) gradient calculates the slope of the line between where you first clicked/tapped, and where you have dragged. The ratio of old color (all of it -- 100% -- where you clicked) and the currently-selected color to fill with (none of -- 0% -- where you've dragged) is calculated to come up with the final blended color.