Page 1 of 2

temporary color picker

Posted: 19 May 2013, 11:45
by Joost
Wouldn't it be handy to have the possibility for a "temporary color picker" (I mean the tool: color:pick)?

For example: In photoshop you can hold the alt button to pick a color. If you release the alt button you go back to your last tool. It's a real fast way of working in my opinion.
In tvpaint if you use "color:pick" you HAVE TO pick a color (or hit the escape button). Sometimes this is not really handy.

I'n not saying that you have to change the color picker how it is now, but it would be nice to have the option for a "temporary color picker".

Re: temporary color picker

Posted: 19 May 2013, 13:18
by idragosani
+1. This is especially handy when you are blending colors and you need to go back and forth a lot with different values

Re: temporary color picker

Posted: 19 May 2013, 15:29
by Svengali
I like that idea. YOU can make any key into a "live" color picker key.

Create a button and embed the following code. Then assign that button to a shortcut key. Anytime you want to sample a color, point/hover over a pixel, click the shortcut key and the APen will assume that color. Holding down the key and moving your cursor will continuously update your APen color until you release the key.

Code: Select all

FOR i = 1 to 100
	tv_GetMouse
	parse result X Y
END
tv_GetPixelDisplay X Y
parse result PR PG PB PA
tv_SetAPen PR PG PB
sven

Re: temporary color picker

Posted: 19 May 2013, 16:00
by idragosani
Oh, I will give this a shot!

Re: temporary color picker

Posted: 20 May 2013, 10:53
by elmisilhumano
Joost wrote:Wouldn't it be handy to have the possibility for a "temporary color picker" (I mean the tool: color:pick)?

For example: In photoshop you can hold the alt button to pick a color. If you release the alt button you go back to your last tool. It's a real fast way of working in my opinion.
In tvpaint if you use "color:pick" you HAVE TO pick a color (or hit the escape button). Sometimes this is not really handy.

I'n not saying that you have to change the color picker how it is now, but it would be nice to have the option for a "temporary color picker".
+1 as default feature.

Re: temporary color picker

Posted: 20 May 2013, 13:17
by Sewie
Thanks Sven! Your script does exactly what Joost describes!
I made this my default color picker.

Re: temporary color picker

Posted: 20 May 2013, 13:26
by idragosani
Sewie wrote:Thanks Sven! Your script does exactly what Joost describes!
I made this my default color picker.
Yep, script works for me, too. Can't assign just the ALT or CTRL key (which is what I am used to in Gimp & MyPaint and I guess PS although I don't use it), but the C key works well enough.

Re: temporary color picker

Posted: 20 May 2013, 14:01
by Svengali
So simple, so useful. I'm glad Joost suggested it. It's something I'll use a lot. :D

Sven

Re: temporary color picker

Posted: 21 May 2013, 07:33
by Lukas
Nice!

But is it possible to only have it pick colors on mouse-down?

I find it hard to pick the right pixel by hovering.

Re: temporary color picker

Posted: 21 May 2013, 08:51
by Joost
Thanks Sven,

It is a smart tool!
But the problem with this tool is that it's hard to pick exact the right color, because I miss a visible switch of the tool when you hold the button (change into a eyedropper like in photoshop), and like Lukas said it would be more handy to click with your pen to grab the right color.

But thanks a lot for your help.

Re: temporary color picker

Posted: 21 May 2013, 14:40
by Svengali
IF you have an unsteady hand, the best choice is the COLOR:Pick shortcut I guess.

One problem for me (in the original script) is that (unlike COLOR:Pick) if you have a cutbrush currently visible, the cutbrush likely obscures the very color area you are trying to pick from.

But I'm listing another embed code that, like COLOR:Pick, hides the the cutbrush, but offers a DOT cursor instead of an arrow... you click your stylus tip to select the color.

Maybe with the next release the programmers might take a minute to implement a "live eyedropper" or something.

Code: Select all

LoopFlag = 1
tv_LockMouse 6    // 6 turns cursor temporarily into a dot... LockMouse momentarily hides the cutbrush if there is one
While LoopFlag
	tv_WaitButton
	parse result Action X Y
	IF Action == 2
		tv_GetPixelDisplay X Y
		parse result PR PG PB PA
		tv_SetAPen PR PG PB
		LoopFlag = 0
	END
END
tv_UnLockMouse
Personally, I'll probably use both options assigned to two adjacent keys.
Sven

edit: One more variation of color picking options

Many brushes I use are created in black, white and shades of gray but used in LumaInvert mode rather than color mode, so the APen color replaces anything that is black and the BPen color replaces anything that is white and any gray tones will be some mix of APen and BPen colors. Thus, from one brush, full palette color variation.

So, I decided to make it possible to sample from my drawing and update APen OR BPen color so that any Black/white LumaInvert brush would automatically assume the new color(s).

Below is the same script modified so that I can use the lower-barrel-switch on the stylus to capture BPen color (actually, I must simultaneously click the stylus tip to capture the BPen color - so:

To use: I first click the color-picker shortcut key and see an arrow cursor. If I just click with the stylus tip, the sampled color gets stored as APen color but if I hold down the lower barrel switch while clicking with the stylus tip the sampled color gets stored in the BPen color.

Code: Select all

LoopFlag = 1
tv_LockMouse 5   // turns cursor temporarily into an arrow... LockMouse momentarily hides the cutbrush if there is one
While LoopFlag
   tv_WaitButton
   parse result Action X Y

  IF Action == 2   // clicking stylus tip samples APen
    tv_GetPixelDisplay X Y
    parse result PR PG PB PA
    tv_SetAPen PR PG PB
    LoopFlag = 0
  END
  IF Action == 4   // detects lower barrel switch is depressed and clicking stylus tip samples BPen
    tv_GetPixelDisplay X Y
    parse result PR PG PB PA
    tv_SetBPen PR PG PB
    LoopFlag = 0
  END
END
tv_UnLockMouse

Re: temporary color picker

Posted: 21 May 2013, 15:19
by Sewie
Svengali wrote:...
One problem for me (in the original script) is that (unlike COLOR:Pick) if you have a cutbrush currently visible, the cutbrush likely obscures the very color area you are trying to pick from.
...
Sven
But wouldn't that easily be solved by making a custombrush icon that looks like a cross-hair? Like looking through the viewfinder of a gun?

Re: temporary color picker

Posted: 21 May 2013, 16:16
by Svengali
I guess that wasn't clear.

Normally in my Preferences/Display I have the Hide Tools Preview box unchecked which keeps my current cutbrush visible, under my cursor, for stamping/ pasting purposes.

In the image below I want to choose some specific gray pixel from the gradation, but the cutbrush (X shape under the cursor) obscures exactly where I'm going to pick. When I'm in COLOR:PIck mode, the cutbrush is hidden temporarily and my crosshair cursor becomes an arrow cursor which makes exact pixel picking easy.

In my first script, I can press the shortcut key to get the color under the cursor but the cutbrush won't let me see exactly what i'm picking, until it shows up in the APen color swatch.

So, when I have a big, clunky cutbrush attached under my cursor and picking precise color is critical, I'll use the COLOR:Pick shortcut key. Otherwise, when painting and sampling color "live" I'll use the live color picker script which will work just fine.
CutBrush obscures under Cursor.png
CutBrush obscures under Cursor.png (47.59 KiB) Viewed 39937 times
Sven

Re: temporary color picker

Posted: 07 Jan 2015, 12:35
by Kerenaa
I find Tvpaint handy. I can blend colors without going back and forth. The sript works for me as well. Using Alt or Ctrl key is easy.

Re: temporary color picker

Posted: 07 Jan 2015, 14:36
by Fabrice
Kerenaa wrote:I find Tvpaint handy. I can blend colors without going back and forth. The sript works for me as well. Using Alt or Ctrl key is easy.
Hi Kerenaa,
Please can you introduce yourself ? You seems outside of topic.