[Tuxpaint-devel] New Magic tool: "Color Sep." (color separation) -- comments appreciated
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Bill K. <nb...@so...> - 2023-02-22 23:51:50
|
I've created a new magic tool that allows you to separate one channel of a picture's color from another, via translation. For example, the red/cyan option, when separating horizontally, is useful to make anaglyphic pictures you can view with 3D glasses. Here's a simple example: https://twitter.com/TuxPaintTweets/status/1628278912446009344 And here's a video of it in action: https://twitter.com/TuxPaintTweets/status/1628295483470024704 Currently, I let you choose a color to determine how the colors separate. If the color you pick contains more red than the other two colors (blue & green), or conversely more of the other two colors (i.e., cyan), then it will be a Red/Cyan separation. If the color is fairly monochrome (black, grey, white), it will default to the Red/Cyan setting. Alternatively, I could just make three distinct tools, and deactivate the color selections, if that seems less confusing. Thoughts? A couple more things to consider, that I'd love feedback on... The Blue/Yellow (blue vs. red + green) separation is fairly difficult to notice, but I'm assuming that's because human eyes are the least sensitive to blue. (Maybe even more so for me, as a male?) I'm leaning towards keeping it as an option, to provide as much variety as possible, though. It reads individual pixels from the snapshot (input) canvas twice, from two different offset positions, and then applies the results (mixing different combinations of one or the other input pixels' red/green/blue values) to the output canvas. It does this for _every pixel_, even as you're dragging the mouse around. I'm curious whether this performs okay for everyone. I could make a preview that's much lower resolution, and then upon release, it would process every single pixel. It uses Tux Paint magic API's "getpixel", so when the offset is off the edge of the canvas (as it literally always be, at least in one direction), it smears. (See the video.) That seems okay to me. As you drag, rather than moving one channel the direction of the mouse, it moves one channel half that direction, and the other two half in the opposite direction. (See the video.) If you simply click & release (no drag), it will offset horizontally a small amount. The 3D frog picture (static image linked above) was created with the following steps: 1. pick frog, shrink size & place it 2. red/cyan offset (click+release) 3. enlarge frog & place it again 4. repeat steps 2 & 3 a few more times The most-recently placed frog appears "close" to when I use my red (left lens) / blue (right lens) 3D glasses. The ones I placed longest ago appear "far away". It really had me giggling when I tested it out. It worked perfectly! >:-D (Bonus silly image: https://twitter.com/billkendrick/status/1628298259327488001) I was thinking there might be ways for me to separate other color combinations, but I'm not sure the best way of doing this. Perhaps using percentages? (This is why I based the separation mode on the currently-chosen color.) Maybe if I figure that out, I could have two tools: * 3D Glasses + Red/cyan mode only + Therefore, color options disabled + Only translates horizontally (ignores vertical motion) * Color Separation + Any color combination + Therefore. color options enabled + Translations in both dimensions (horizontal & vertical) I can never leave well enough alone, can I? ;) -- -bill! Sent from my computer |