-
Notifications
You must be signed in to change notification settings - Fork 1
/
Colority - Interactive tool to colour
executable file
·65 lines (56 loc) · 3.53 KB
/
Colority - Interactive tool to colour
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
####### Colority tool to colour
####### Version 0.2
####### Created by Anderson Prado (AndeOn), andeons.com
####### Licensed under the GNU GENERAL PUBLIC LICENSE, Version 2
### Depends on G'mic 1.6.0.1 or above, Zenity
### Install in ~/.local/share/nautilus/scripts
### Set Permissions of script to "Allow executing file as program"
### You need to be running Nautilus 1.0.3+ or above to use scripts menu.
zSelected_file="$1"
zName=$(basename ${zSelected_file%.*})
zChoices=$(zenity --width=400 --height=300 --window-icon=$zSelected_file --list --title="Colority - Interactive Tool to Colour" --text="<i>Just a simple GUI dialog script to use the Gmic filter <b>Colorize</b> [Interactive]</i> \n\n Choose an option bellow to colour the image:\n " --column= "1. Default" "2. Use a custom palette (.gpl file)" );
case "$?" in
0)
case "$zChoices" in
"1. Default")
zenity --no-wrap --info --window-icon=$zSelected_file --title="Actions and Shortcuts to interactive window" --text="<b>The action list to be used in interactive image window to manage your colorization:</b>
- <b>Left mouse button</b> creates a new colored control point (or moves an existing one).
- <b>Right mouse button</b> over a control point deletes it.
- <b>Right mouse button</b> anywhere else picks a color from the image.
- <b>Mouse wheel</b>, or keys '<b>CTRL+arrows UP/DOWN</b>' zoom view in/out.
- '<b>CTRL+mouse wheel', 'SHIFT+mouse wheel</b>' or arrow keys move image in zoomed view.
- Key '<b>SPACE</b>' updates the extrapolated color field.
- Key '<b>TAB</b>' switches between markers view modes.
- Key '<b>BACKSPACE</b>' deletes the last control point added.
- Key '<b>PAGE UP</b>' increases image contrast.
- Key '<b>PAGE DOWN</b>' decreases image contrast.
- Key '<b>PAGE DOWN</b>' decreases image contrast.
- Key '<b>R</b>' toggles color replace mode.
- Keys '<b>CTRL+C</b>' decrease window size.
- Keys '<b>CTRL+R</b>' reset window size.
- Keys '<b>ESC</b>', '<b>Q</b>' or '<b>ENTER</b>' exit the interactive window." &
gmic "$zSelected_file" -x_colorize 1,0,1, -k[0] -s c,{3-s} -o[1] $zName[c].png ;
;;
"2. Use a custom palette (.gpl file)")
zPalette=$(zenity --file-selection --window-icon=$zSelected_file --title="Select the palette" --file-filter='Palette (gpl) | *.gpl') ; [ $? = 1 ] && exit 0;
zenity --no-wrap --info --window-icon=$zSelected_file --title="Actions and Shortcuts to interactive window" --text="<b>The action list to be used in interactive image window to manage your colorization:</b>
- <b>Left mouse button</b> creates a new colored control point (or moves an existing one).
- <b>Right mouse button</b> over a control point deletes it.
- <b>Right mouse button</b> anywhere else picks a color from the image.
- <b>Mouse wheel</b>, or keys '<b>CTRL+arrows UP/DOWN</b>' zoom view in/out.
- '<b>CTRL+mouse wheel', 'SHIFT+mouse wheel</b>' or arrow keys move image in zoomed view.
- Key '<b>SPACE</b>' updates the extrapolated color field.
- Key '<b>TAB</b>' switches between markers view modes.
- Key '<b>BACKSPACE</b>' deletes the last control point added.
- Key '<b>PAGE UP</b>' increases image contrast.
- Key '<b>PAGE DOWN</b>' decreases image contrast.
- Key '<b>PAGE DOWN</b>' decreases image contrast.
- Key '<b>R</b>' toggles color replace mode.
- Keys '<b>CTRL+C</b>' decrease window size.
- Keys '<b>CTRL+R</b>' reset window size.
- Keys '<b>ESC</b>', '<b>Q</b>' or '<b>ENTER</b>' exit the interactive window." &
gmic "$zSelected_file" -input_gpl "$zPalette" -x_colorize[0] 1,0,1,[-1] -k[0] -s c,{3-s} -o[1] $zName[c].png
;;
esac;
esac;