Jump to content

Feature Request: Locking RGB values


Go to solution Solved by Rick Brewster,

Recommended Posts

Is this possible as suggested? The drive is to sync 3 values by entering only once. I find myself filling 3 of the boxes with same value all the time.

 

image.png.94b8ecfd8c45e0d41903fdacf6b72898.png

Psuedo requirement (for convenience):

 

When lock is enabled;

 

  • G.ReadOnly = B.ReadOnly = true;
  • (Sub1) G.Value = B.Value = R.Value;
    • Hex and HSV values => Recalculate.
  • R.ValueChangeEvent => Goto (Sub1)
  • (Optional) => Only leave grayscale colors in palette.
    • greyScaleColors = palette.Where(color => color.R == color.G && color.R == color.B);

 

When lock is disabled (from enabled state);

  • G.ReadOnly = B.ReadOnly = false;
  • (Optional) => Reinitialize color palette with rgb colors.

 

 

Edited by Dolce Saito
  • Like 1
Link to comment
Share on other sites

  • Dolce Saito changed the title to Feature Request: Locking RGB values

I have a better idea, a checkbox on the HSV value to scale each channel value into 0-255.

G'MIC Filter Developer

 

I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me.

Link to comment
Share on other sites

2 hours ago, Reptillian said:

I have a better idea, a checkbox on the HSV value to scale each channel value into 0-255.

 

This feature request has nothing to do with HSV. (Paint.net moderators already stressed "enough" that HSV is there for convenience).

 

When working with grayscale, synchronizing RGB boxes would be an invaluable addition. It would simply increase productivity by 3 times.

Link to comment
Share on other sites

On 7/6/2023 at 9:45 PM, Dolce Saito said:

Is this possible as suggested? The drive is to sync 3 values by entering only once. I find myself filling 3 of the boxes with same value all the time.

 

It is so onerous to type them in?

  1. Double-click on the value in the Red RGB input box
  2. Type in the three digit value
  3. Hit TAB
  4. Retype the three digits
  5. Hit TAB
  6. Retype the three digits

Its a total of eleven key presses of four keys.

Link to comment
Share on other sites

7 minutes ago, Red ochre said:

Perhaps create your own palette, "96 shades of grey" ?😉

 

This is a fun coding exercise.

 

Here's my answer to doing this:

 

$ 96,1,1,1,"begin(const last_index=w-1;);round(x/last_index*255);" rep_output_pdn_pal greys

 

Which gives me a 96 color palette txt file. This is the output for the most part.

 

; paint.net Palette File: Grayscale 96
; Color Format - AARRGGBB
; Colors: 96
FF000000
FF030303
FF050505
FF080808
FF0B0B0B
FF0D0D0D
FF101010
FF131313
FF151515
FF181818
FF1B1B1B
FF1E1E1E
FF202020
FF232323
FF262626
FF282828
FF2B2B2B
FF2E2E2E
FF303030
FF333333
FF363636
FF383838
FF3B3B3B
FF3E3E3E
FF404040
FF434343
FF464646
FF484848
FF4B4B4B
FF4E4E4E
FF515151
FF535353
FF565656
FF595959
FF5B5B5B
FF5E5E5E
FF616161
FF636363
FF666666
FF696969
FF6B6B6B
FF6E6E6E
FF717171
FF737373
FF767676
FF797979
FF7B7B7B
FF7E7E7E
FF818181
FF848484
FF868686
FF898989
FF8C8C8C
FF8E8E8E
FF919191
FF949494
FF969696
FF999999
FF9C9C9C
FF9E9E9E
FFA1A1A1
FFA4A4A4
FFA6A6A6
FFA9A9A9
FFACACAC
FFAEAEAE
FFB1B1B1
FFB4B4B4
FFB7B7B7
FFB9B9B9
FFBCBCBC
FFBFBFBF
FFC1C1C1
FFC4C4C4
FFC7C7C7
FFC9C9C9
FFCCCCCC
FFCFCFCF
FFD1D1D1
FFD4D4D4
FFD7D7D7
FFD9D9D9
FFDCDCDC
FFDFDFDF
FFE1E1E1
FFE4E4E4
FFE7E7E7
FFEAEAEA
FFECECEC
FFEFEFEF
FFF2F2F2
FFF4F4F4
FFF7F7F7
FFFAFAFA
FFFCFCFC
FFFFFFFF

For the OP, you could copy and paste this into a .txt file and place it into palette folder, and then open PDN.

  • Upvote 2

G'MIC Filter Developer

 

I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me.

Link to comment
Share on other sites

10 hours ago, Ego Eram Reputo said:

 

It is so onerous to type them in?

  1. Double-click on the value in the Red RGB input box
  2. Type in the three digit value
  3. Hit TAB
  4. Retype the three digits
  5. Hit TAB
  6. Retype the three digits

Its a total of eleven key presses of four keys.

 

This is the reason for the suggestion, not the solution.

Think about doing this every 20 seconds for hours.

Link to comment
Share on other sites

4 hours ago, Tactilis said:


gmic ?

 

Yes. Can be done easily with Python too. One could split 255 colors into a set of 96 colors and save them as separate file. This is the only workaround for now.

G'MIC Filter Developer

 

I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me.

Link to comment
Share on other sites

22 hours ago, Dolce Saito said:

This is the reason for the suggestion, not the solution.
 

Think about doing this every 20 seconds for hours.


OK, here's a simple solution to save you lots of effort:

1. Type a value in the R field
2. Press Shift+Enter


This AutoHotkey script:

1. Gets the value entered in the R field (the cursor must be in that field when you press Shift+Enter)

2. Tabs to the G field and enters the value

3. Tabs to the B field and enters the value

4. Tabs back to the R field so you can immediately change the value if required

It works really well.

 

 

Spoiler
; AutoHotKey script: 'Global Hotkeys.ahk'
;
; Create a shortcut to this .ahk script file in the Windows Startup folder, which can be
; found by entering shell:startup in Windows Explorer's address bar.
; The usual location is:
; C:\Users\<users_folder>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
;

; Require the use of AHK v2.0 or later
#Requires AutoHotkey v2

; Allow only one instance of the script to be active.
; If the script is re-run (e.g. after editing the .ahk), the currently running
; instance will be replaced with the new version
#SingleInstance Force

; -----------------------------------------------------------------------------
; Hotkey Shift+Enter
; Copies the current value in the Colors RGB R field to the G and B fields
; Tabs back to the R field
;
; The cursor must be in the R field when Shift+Enter is pressed

#HotIf WinActive("ahk_exe paintdotnet.exe")
+Enter::
{
	Val := ControlGetText(ControlGetFocus())
	Send "{Tab}"
	Sleep 50
	ControlSetText(Val, ControlGetFocus())
	Send "{Tab}"
	Sleep 50
	ControlSetText(Val, ControlGetFocus())
	Send "+{Tab}+{Tab}"
}

 


Notes:
1. I use ControlGetText and ControlSetText instead of doing a copy and paste so that I don't change the contents of the clipboard.

2. A short sleep is needed after sending Tab to move to the next field otherwise ControlSetText may fail to update the control.  I found that 5-10ms was reliable, so added a safety factor by making it 50ms.

 

3. I could have added checks to ensure that the cursor was in the R field of the Colors window when Shift+Enter was pressed but that would have complicated the script unnecessarily.


 

Edited by Tactilis
Fix typo
  • Upvote 2
Link to comment
Share on other sites

8 hours ago, Lemonade said:
##HotIf WinActive("ahk_exe paintdotnet.exe")

Removed one # from the beginning of the line.


Thanks for finding that @Lemonade
It was a silly copy/paste error when I extract this single HotIf block from my 'Global Hotkeys.ahk' script that contains all my hotkey definitions. I've edited my post above to fix it.

  • Upvote 1
Link to comment
Share on other sites

  • Solution

Suggested feature is also very niche, and would require a lot of work on my part. Sorry but it's definitely not in any current plans, nor is it likely to be.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

19 minutes ago, Dolce Saito said:

Suggested feature is very easy to use, solves a problem and never requires you to depend anything other than paint.net ecosystem.


Agreed. But it's not currently part of paint.net and might not be for a long time (UPDATE: or in fact ever), depending on Rick's priorities.

You said earlier that having a means of having the same value for RGB entered automatically "would simply increase productivity by 3 times."

Using AutoHotKey to do that is trivially easy.

But you have stated "however installing AutoHotkey is not an option"

Out of interest, why is it not an option?



 

Edited by Tactilis
Update added after Rick's post
Link to comment
Share on other sites

2 hours ago, Dolce Saito said:

however installing AutoHotkey is not an option.

 

and...

2 hours ago, Rick Brewster said:

Sorry but it's definitely not in any current plans, nor is it likely to be.

 

....which leads me back to my original suggestion:

On 7/8/2023 at 9:33 AM, Ego Eram Reputo said:
  1. Double-click on the value in the Red RGB input box
  2. Type in the three digit value
  3. Hit TAB
  4. Retype the three digits
  5. Hit TAB
  6. Retype the three digits

 

Link to comment
Share on other sites

Or even ...

 

  • Double-click on the value in the Red RGB input box
  • Type in the three digit value
  • Press Shift+Home (select to beginning of text) and then Ctrl+C (copy to clipboard)
  • Hit TAB (next UI control)
  • Ctrl+V (Paste)
  • Hit TAB
  • Ctrl+V

 

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Or all with the left hand (and hardly any hand movement if you use your pinky finger for the Ctrl key):

  • Double-click on the value in the Red RGB input box
  • Type in the three digit value
  • Press Ctrl+A (select all) and then Ctrl+C (copy to clipboard)
  • Hit TAB (next UI control)
  • Ctrl+V (Paste)
  • Hit TAB
  • Ctrl+V


But the OP said:

 

On 7/8/2023 at 9:10 AM, Dolce Saito said:

Think about doing this every 20 seconds for hours.


...so I worry about them getting RSI, which I why I offered:

1. Type a value in the R field
2. Press Shift+Enter

 

which is any easy solution if they would just give AutoHotkey a try.

@Dolce Saito I'm happy to answer any questions if you need help.

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...