Spaces:
Runtime error
Runtime error
Lut fixes
Browse filesNew Prompts
Python 3.12.8 Test
- LUT/0-none.cube +517 -0
- LUT/gist_heat.cube +258 -0
- README.md +1 -1
- app.py +46 -46
- modules/constants.py +6 -0
- modules/image_utils.py +216 -25
- requirements.txt +1 -1
- style_20250314.css +1 -1
LUT/0-none.cube
ADDED
|
@@ -0,0 +1,517 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Charles Fettinger 3D LUT from 8x8 PNG
|
| 2 |
+
TITLE "Converted 8x8x8 LUT"
|
| 3 |
+
LUT_3D_SIZE 8
|
| 4 |
+
DOMAIN_MIN 0.0 0.0 0.0
|
| 5 |
+
DOMAIN_MAX 1.0 1.0 1.0
|
| 6 |
+
0.062745 0.062745 0.000000
|
| 7 |
+
0.192157 0.062745 0.000000
|
| 8 |
+
0.317647 0.062745 0.000000
|
| 9 |
+
0.443137 0.062745 0.000000
|
| 10 |
+
0.572549 0.062745 0.000000
|
| 11 |
+
0.698039 0.062745 0.000000
|
| 12 |
+
0.823529 0.062745 0.000000
|
| 13 |
+
0.952941 0.062745 0.000000
|
| 14 |
+
0.062745 0.192157 0.015686
|
| 15 |
+
0.192157 0.192157 0.015686
|
| 16 |
+
0.317647 0.192157 0.015686
|
| 17 |
+
0.443137 0.192157 0.015686
|
| 18 |
+
0.572549 0.192157 0.015686
|
| 19 |
+
0.698039 0.192157 0.015686
|
| 20 |
+
0.823529 0.192157 0.015686
|
| 21 |
+
0.952941 0.192157 0.015686
|
| 22 |
+
0.062745 0.317647 0.031373
|
| 23 |
+
0.192157 0.317647 0.031373
|
| 24 |
+
0.317647 0.317647 0.031373
|
| 25 |
+
0.443137 0.317647 0.031373
|
| 26 |
+
0.572549 0.317647 0.031373
|
| 27 |
+
0.698039 0.317647 0.031373
|
| 28 |
+
0.823529 0.317647 0.031373
|
| 29 |
+
0.952941 0.317647 0.031373
|
| 30 |
+
0.062745 0.443137 0.047059
|
| 31 |
+
0.192157 0.443137 0.047059
|
| 32 |
+
0.317647 0.443137 0.047059
|
| 33 |
+
0.443137 0.443137 0.047059
|
| 34 |
+
0.572549 0.443137 0.047059
|
| 35 |
+
0.698039 0.443137 0.047059
|
| 36 |
+
0.823529 0.443137 0.047059
|
| 37 |
+
0.952941 0.443137 0.047059
|
| 38 |
+
0.062745 0.572549 0.062745
|
| 39 |
+
0.192157 0.572549 0.062745
|
| 40 |
+
0.317647 0.572549 0.062745
|
| 41 |
+
0.443137 0.572549 0.062745
|
| 42 |
+
0.572549 0.572549 0.062745
|
| 43 |
+
0.698039 0.572549 0.062745
|
| 44 |
+
0.823529 0.572549 0.062745
|
| 45 |
+
0.952941 0.572549 0.062745
|
| 46 |
+
0.062745 0.698039 0.078431
|
| 47 |
+
0.192157 0.698039 0.078431
|
| 48 |
+
0.317647 0.698039 0.078431
|
| 49 |
+
0.443137 0.698039 0.078431
|
| 50 |
+
0.572549 0.698039 0.078431
|
| 51 |
+
0.698039 0.698039 0.078431
|
| 52 |
+
0.823529 0.698039 0.078431
|
| 53 |
+
0.952941 0.698039 0.078431
|
| 54 |
+
0.062745 0.823529 0.094118
|
| 55 |
+
0.192157 0.823529 0.094118
|
| 56 |
+
0.317647 0.823529 0.094118
|
| 57 |
+
0.443137 0.823529 0.094118
|
| 58 |
+
0.572549 0.823529 0.094118
|
| 59 |
+
0.698039 0.823529 0.094118
|
| 60 |
+
0.823529 0.823529 0.094118
|
| 61 |
+
0.952941 0.823529 0.094118
|
| 62 |
+
0.062745 0.952941 0.109804
|
| 63 |
+
0.192157 0.952941 0.109804
|
| 64 |
+
0.317647 0.952941 0.109804
|
| 65 |
+
0.443137 0.952941 0.109804
|
| 66 |
+
0.572549 0.952941 0.109804
|
| 67 |
+
0.698039 0.952941 0.109804
|
| 68 |
+
0.823529 0.952941 0.109804
|
| 69 |
+
0.952941 0.952941 0.109804
|
| 70 |
+
0.062745 0.062745 0.125490
|
| 71 |
+
0.192157 0.062745 0.125490
|
| 72 |
+
0.317647 0.062745 0.125490
|
| 73 |
+
0.443137 0.062745 0.125490
|
| 74 |
+
0.572549 0.062745 0.125490
|
| 75 |
+
0.698039 0.062745 0.125490
|
| 76 |
+
0.823529 0.062745 0.125490
|
| 77 |
+
0.952941 0.062745 0.125490
|
| 78 |
+
0.062745 0.192157 0.141176
|
| 79 |
+
0.192157 0.192157 0.141176
|
| 80 |
+
0.317647 0.192157 0.141176
|
| 81 |
+
0.443137 0.192157 0.141176
|
| 82 |
+
0.572549 0.192157 0.141176
|
| 83 |
+
0.698039 0.192157 0.141176
|
| 84 |
+
0.823529 0.192157 0.141176
|
| 85 |
+
0.952941 0.192157 0.141176
|
| 86 |
+
0.062745 0.317647 0.156863
|
| 87 |
+
0.192157 0.317647 0.156863
|
| 88 |
+
0.317647 0.317647 0.156863
|
| 89 |
+
0.443137 0.317647 0.156863
|
| 90 |
+
0.572549 0.317647 0.156863
|
| 91 |
+
0.698039 0.317647 0.156863
|
| 92 |
+
0.823529 0.317647 0.156863
|
| 93 |
+
0.952941 0.317647 0.156863
|
| 94 |
+
0.062745 0.443137 0.176471
|
| 95 |
+
0.192157 0.443137 0.176471
|
| 96 |
+
0.317647 0.443137 0.176471
|
| 97 |
+
0.443137 0.443137 0.176471
|
| 98 |
+
0.572549 0.443137 0.176471
|
| 99 |
+
0.698039 0.443137 0.176471
|
| 100 |
+
0.823529 0.443137 0.176471
|
| 101 |
+
0.952941 0.443137 0.176471
|
| 102 |
+
0.062745 0.572549 0.192157
|
| 103 |
+
0.192157 0.572549 0.192157
|
| 104 |
+
0.317647 0.572549 0.192157
|
| 105 |
+
0.443137 0.572549 0.192157
|
| 106 |
+
0.572549 0.572549 0.192157
|
| 107 |
+
0.698039 0.572549 0.192157
|
| 108 |
+
0.823529 0.572549 0.192157
|
| 109 |
+
0.952941 0.572549 0.192157
|
| 110 |
+
0.062745 0.698039 0.207843
|
| 111 |
+
0.192157 0.698039 0.207843
|
| 112 |
+
0.317647 0.698039 0.207843
|
| 113 |
+
0.443137 0.698039 0.207843
|
| 114 |
+
0.572549 0.698039 0.207843
|
| 115 |
+
0.698039 0.698039 0.207843
|
| 116 |
+
0.823529 0.698039 0.207843
|
| 117 |
+
0.952941 0.698039 0.207843
|
| 118 |
+
0.062745 0.823529 0.223529
|
| 119 |
+
0.192157 0.823529 0.223529
|
| 120 |
+
0.317647 0.823529 0.223529
|
| 121 |
+
0.443137 0.823529 0.223529
|
| 122 |
+
0.572549 0.823529 0.223529
|
| 123 |
+
0.698039 0.823529 0.223529
|
| 124 |
+
0.823529 0.823529 0.223529
|
| 125 |
+
0.952941 0.823529 0.223529
|
| 126 |
+
0.062745 0.952941 0.239216
|
| 127 |
+
0.192157 0.952941 0.239216
|
| 128 |
+
0.317647 0.952941 0.239216
|
| 129 |
+
0.443137 0.952941 0.239216
|
| 130 |
+
0.572549 0.952941 0.239216
|
| 131 |
+
0.698039 0.952941 0.239216
|
| 132 |
+
0.823529 0.952941 0.239216
|
| 133 |
+
0.952941 0.952941 0.239216
|
| 134 |
+
0.062745 0.062745 0.254902
|
| 135 |
+
0.192157 0.062745 0.254902
|
| 136 |
+
0.317647 0.062745 0.254902
|
| 137 |
+
0.443137 0.062745 0.254902
|
| 138 |
+
0.572549 0.062745 0.254902
|
| 139 |
+
0.698039 0.062745 0.254902
|
| 140 |
+
0.823529 0.062745 0.254902
|
| 141 |
+
0.952941 0.062745 0.254902
|
| 142 |
+
0.062745 0.192157 0.270588
|
| 143 |
+
0.192157 0.192157 0.270588
|
| 144 |
+
0.317647 0.192157 0.270588
|
| 145 |
+
0.443137 0.192157 0.270588
|
| 146 |
+
0.572549 0.192157 0.270588
|
| 147 |
+
0.698039 0.192157 0.270588
|
| 148 |
+
0.823529 0.192157 0.270588
|
| 149 |
+
0.952941 0.192157 0.270588
|
| 150 |
+
0.062745 0.317647 0.286275
|
| 151 |
+
0.192157 0.317647 0.286275
|
| 152 |
+
0.317647 0.317647 0.286275
|
| 153 |
+
0.443137 0.317647 0.286275
|
| 154 |
+
0.572549 0.317647 0.286275
|
| 155 |
+
0.698039 0.317647 0.286275
|
| 156 |
+
0.823529 0.317647 0.286275
|
| 157 |
+
0.952941 0.317647 0.286275
|
| 158 |
+
0.062745 0.443137 0.301961
|
| 159 |
+
0.192157 0.443137 0.301961
|
| 160 |
+
0.317647 0.443137 0.301961
|
| 161 |
+
0.443137 0.443137 0.301961
|
| 162 |
+
0.572549 0.443137 0.301961
|
| 163 |
+
0.698039 0.443137 0.301961
|
| 164 |
+
0.823529 0.443137 0.301961
|
| 165 |
+
0.952941 0.443137 0.301961
|
| 166 |
+
0.062745 0.572549 0.317647
|
| 167 |
+
0.192157 0.572549 0.317647
|
| 168 |
+
0.317647 0.572549 0.317647
|
| 169 |
+
0.443137 0.572549 0.317647
|
| 170 |
+
0.572549 0.572549 0.317647
|
| 171 |
+
0.698039 0.572549 0.317647
|
| 172 |
+
0.823529 0.572549 0.317647
|
| 173 |
+
0.952941 0.572549 0.317647
|
| 174 |
+
0.062745 0.698039 0.333333
|
| 175 |
+
0.192157 0.698039 0.333333
|
| 176 |
+
0.317647 0.698039 0.333333
|
| 177 |
+
0.443137 0.698039 0.333333
|
| 178 |
+
0.572549 0.698039 0.333333
|
| 179 |
+
0.698039 0.698039 0.333333
|
| 180 |
+
0.823529 0.698039 0.333333
|
| 181 |
+
0.952941 0.698039 0.333333
|
| 182 |
+
0.062745 0.823529 0.349020
|
| 183 |
+
0.192157 0.823529 0.349020
|
| 184 |
+
0.317647 0.823529 0.349020
|
| 185 |
+
0.443137 0.823529 0.349020
|
| 186 |
+
0.572549 0.823529 0.349020
|
| 187 |
+
0.698039 0.823529 0.349020
|
| 188 |
+
0.823529 0.823529 0.349020
|
| 189 |
+
0.952941 0.823529 0.349020
|
| 190 |
+
0.062745 0.952941 0.364706
|
| 191 |
+
0.192157 0.952941 0.364706
|
| 192 |
+
0.317647 0.952941 0.364706
|
| 193 |
+
0.443137 0.952941 0.364706
|
| 194 |
+
0.572549 0.952941 0.364706
|
| 195 |
+
0.698039 0.952941 0.364706
|
| 196 |
+
0.823529 0.952941 0.364706
|
| 197 |
+
0.952941 0.952941 0.364706
|
| 198 |
+
0.062745 0.062745 0.380392
|
| 199 |
+
0.192157 0.062745 0.380392
|
| 200 |
+
0.317647 0.062745 0.380392
|
| 201 |
+
0.443137 0.062745 0.380392
|
| 202 |
+
0.572549 0.062745 0.380392
|
| 203 |
+
0.698039 0.062745 0.380392
|
| 204 |
+
0.823529 0.062745 0.380392
|
| 205 |
+
0.952941 0.062745 0.380392
|
| 206 |
+
0.062745 0.192157 0.396078
|
| 207 |
+
0.192157 0.192157 0.396078
|
| 208 |
+
0.317647 0.192157 0.396078
|
| 209 |
+
0.443137 0.192157 0.396078
|
| 210 |
+
0.572549 0.192157 0.396078
|
| 211 |
+
0.698039 0.192157 0.396078
|
| 212 |
+
0.823529 0.192157 0.396078
|
| 213 |
+
0.952941 0.192157 0.396078
|
| 214 |
+
0.062745 0.317647 0.411765
|
| 215 |
+
0.192157 0.317647 0.411765
|
| 216 |
+
0.317647 0.317647 0.411765
|
| 217 |
+
0.443137 0.317647 0.411765
|
| 218 |
+
0.572549 0.317647 0.411765
|
| 219 |
+
0.698039 0.317647 0.411765
|
| 220 |
+
0.823529 0.317647 0.411765
|
| 221 |
+
0.952941 0.317647 0.411765
|
| 222 |
+
0.062745 0.443137 0.427451
|
| 223 |
+
0.192157 0.443137 0.427451
|
| 224 |
+
0.317647 0.443137 0.427451
|
| 225 |
+
0.443137 0.443137 0.427451
|
| 226 |
+
0.572549 0.443137 0.427451
|
| 227 |
+
0.698039 0.443137 0.427451
|
| 228 |
+
0.823529 0.443137 0.427451
|
| 229 |
+
0.952941 0.443137 0.427451
|
| 230 |
+
0.062745 0.572549 0.443137
|
| 231 |
+
0.192157 0.572549 0.443137
|
| 232 |
+
0.317647 0.572549 0.443137
|
| 233 |
+
0.443137 0.572549 0.443137
|
| 234 |
+
0.572549 0.572549 0.443137
|
| 235 |
+
0.698039 0.572549 0.443137
|
| 236 |
+
0.823529 0.572549 0.443137
|
| 237 |
+
0.952941 0.572549 0.443137
|
| 238 |
+
0.062745 0.698039 0.458824
|
| 239 |
+
0.192157 0.698039 0.458824
|
| 240 |
+
0.317647 0.698039 0.458824
|
| 241 |
+
0.443137 0.698039 0.458824
|
| 242 |
+
0.572549 0.698039 0.458824
|
| 243 |
+
0.698039 0.698039 0.458824
|
| 244 |
+
0.823529 0.698039 0.458824
|
| 245 |
+
0.952941 0.698039 0.458824
|
| 246 |
+
0.062745 0.823529 0.474510
|
| 247 |
+
0.192157 0.823529 0.474510
|
| 248 |
+
0.317647 0.823529 0.474510
|
| 249 |
+
0.443137 0.823529 0.474510
|
| 250 |
+
0.572549 0.823529 0.474510
|
| 251 |
+
0.698039 0.823529 0.474510
|
| 252 |
+
0.823529 0.823529 0.474510
|
| 253 |
+
0.952941 0.823529 0.474510
|
| 254 |
+
0.062745 0.952941 0.490196
|
| 255 |
+
0.192157 0.952941 0.490196
|
| 256 |
+
0.317647 0.952941 0.490196
|
| 257 |
+
0.443137 0.952941 0.490196
|
| 258 |
+
0.572549 0.952941 0.490196
|
| 259 |
+
0.698039 0.952941 0.490196
|
| 260 |
+
0.823529 0.952941 0.490196
|
| 261 |
+
0.952941 0.952941 0.490196
|
| 262 |
+
0.062745 0.062745 0.509804
|
| 263 |
+
0.192157 0.062745 0.509804
|
| 264 |
+
0.317647 0.062745 0.509804
|
| 265 |
+
0.443137 0.062745 0.509804
|
| 266 |
+
0.572549 0.062745 0.509804
|
| 267 |
+
0.698039 0.062745 0.509804
|
| 268 |
+
0.823529 0.062745 0.509804
|
| 269 |
+
0.952941 0.062745 0.509804
|
| 270 |
+
0.062745 0.192157 0.525490
|
| 271 |
+
0.192157 0.192157 0.525490
|
| 272 |
+
0.317647 0.192157 0.525490
|
| 273 |
+
0.443137 0.192157 0.525490
|
| 274 |
+
0.572549 0.192157 0.525490
|
| 275 |
+
0.698039 0.192157 0.525490
|
| 276 |
+
0.823529 0.192157 0.525490
|
| 277 |
+
0.952941 0.192157 0.525490
|
| 278 |
+
0.062745 0.317647 0.541176
|
| 279 |
+
0.192157 0.317647 0.541176
|
| 280 |
+
0.317647 0.317647 0.541176
|
| 281 |
+
0.443137 0.317647 0.541176
|
| 282 |
+
0.572549 0.317647 0.541176
|
| 283 |
+
0.698039 0.317647 0.541176
|
| 284 |
+
0.823529 0.317647 0.541176
|
| 285 |
+
0.952941 0.317647 0.541176
|
| 286 |
+
0.062745 0.443137 0.556863
|
| 287 |
+
0.192157 0.443137 0.556863
|
| 288 |
+
0.317647 0.443137 0.556863
|
| 289 |
+
0.443137 0.443137 0.556863
|
| 290 |
+
0.572549 0.443137 0.556863
|
| 291 |
+
0.698039 0.443137 0.556863
|
| 292 |
+
0.823529 0.443137 0.556863
|
| 293 |
+
0.952941 0.443137 0.556863
|
| 294 |
+
0.062745 0.572549 0.572549
|
| 295 |
+
0.192157 0.572549 0.572549
|
| 296 |
+
0.317647 0.572549 0.572549
|
| 297 |
+
0.443137 0.572549 0.572549
|
| 298 |
+
0.572549 0.572549 0.572549
|
| 299 |
+
0.698039 0.572549 0.572549
|
| 300 |
+
0.823529 0.572549 0.572549
|
| 301 |
+
0.952941 0.572549 0.572549
|
| 302 |
+
0.062745 0.698039 0.588235
|
| 303 |
+
0.192157 0.698039 0.588235
|
| 304 |
+
0.317647 0.698039 0.588235
|
| 305 |
+
0.443137 0.698039 0.588235
|
| 306 |
+
0.572549 0.698039 0.588235
|
| 307 |
+
0.698039 0.698039 0.588235
|
| 308 |
+
0.823529 0.698039 0.588235
|
| 309 |
+
0.952941 0.698039 0.588235
|
| 310 |
+
0.062745 0.823529 0.603922
|
| 311 |
+
0.192157 0.823529 0.603922
|
| 312 |
+
0.317647 0.823529 0.603922
|
| 313 |
+
0.443137 0.823529 0.603922
|
| 314 |
+
0.572549 0.823529 0.603922
|
| 315 |
+
0.698039 0.823529 0.603922
|
| 316 |
+
0.823529 0.823529 0.603922
|
| 317 |
+
0.952941 0.823529 0.603922
|
| 318 |
+
0.062745 0.952941 0.619608
|
| 319 |
+
0.192157 0.952941 0.619608
|
| 320 |
+
0.317647 0.952941 0.619608
|
| 321 |
+
0.443137 0.952941 0.619608
|
| 322 |
+
0.572549 0.952941 0.619608
|
| 323 |
+
0.698039 0.952941 0.619608
|
| 324 |
+
0.823529 0.952941 0.619608
|
| 325 |
+
0.952941 0.952941 0.619608
|
| 326 |
+
0.062745 0.062745 0.635294
|
| 327 |
+
0.192157 0.062745 0.635294
|
| 328 |
+
0.317647 0.062745 0.635294
|
| 329 |
+
0.443137 0.062745 0.635294
|
| 330 |
+
0.572549 0.062745 0.635294
|
| 331 |
+
0.698039 0.062745 0.635294
|
| 332 |
+
0.823529 0.062745 0.635294
|
| 333 |
+
0.952941 0.062745 0.635294
|
| 334 |
+
0.062745 0.192157 0.650980
|
| 335 |
+
0.192157 0.192157 0.650980
|
| 336 |
+
0.317647 0.192157 0.650980
|
| 337 |
+
0.443137 0.192157 0.650980
|
| 338 |
+
0.572549 0.192157 0.650980
|
| 339 |
+
0.698039 0.192157 0.650980
|
| 340 |
+
0.823529 0.192157 0.650980
|
| 341 |
+
0.952941 0.192157 0.650980
|
| 342 |
+
0.062745 0.317647 0.666667
|
| 343 |
+
0.192157 0.317647 0.666667
|
| 344 |
+
0.317647 0.317647 0.666667
|
| 345 |
+
0.443137 0.317647 0.666667
|
| 346 |
+
0.572549 0.317647 0.666667
|
| 347 |
+
0.698039 0.317647 0.666667
|
| 348 |
+
0.823529 0.317647 0.666667
|
| 349 |
+
0.952941 0.317647 0.666667
|
| 350 |
+
0.062745 0.443137 0.682353
|
| 351 |
+
0.192157 0.443137 0.682353
|
| 352 |
+
0.317647 0.443137 0.682353
|
| 353 |
+
0.443137 0.443137 0.682353
|
| 354 |
+
0.572549 0.443137 0.682353
|
| 355 |
+
0.698039 0.443137 0.682353
|
| 356 |
+
0.823529 0.443137 0.682353
|
| 357 |
+
0.952941 0.443137 0.682353
|
| 358 |
+
0.062745 0.572549 0.698039
|
| 359 |
+
0.192157 0.572549 0.698039
|
| 360 |
+
0.317647 0.572549 0.698039
|
| 361 |
+
0.443137 0.572549 0.698039
|
| 362 |
+
0.572549 0.572549 0.698039
|
| 363 |
+
0.698039 0.572549 0.698039
|
| 364 |
+
0.823529 0.572549 0.698039
|
| 365 |
+
0.952941 0.572549 0.698039
|
| 366 |
+
0.062745 0.698039 0.713725
|
| 367 |
+
0.192157 0.698039 0.713725
|
| 368 |
+
0.317647 0.698039 0.713725
|
| 369 |
+
0.443137 0.698039 0.713725
|
| 370 |
+
0.572549 0.698039 0.713725
|
| 371 |
+
0.698039 0.698039 0.713725
|
| 372 |
+
0.823529 0.698039 0.713725
|
| 373 |
+
0.952941 0.698039 0.713725
|
| 374 |
+
0.062745 0.823529 0.729412
|
| 375 |
+
0.192157 0.823529 0.729412
|
| 376 |
+
0.317647 0.823529 0.729412
|
| 377 |
+
0.443137 0.823529 0.729412
|
| 378 |
+
0.572549 0.823529 0.729412
|
| 379 |
+
0.698039 0.823529 0.729412
|
| 380 |
+
0.823529 0.823529 0.729412
|
| 381 |
+
0.952941 0.823529 0.729412
|
| 382 |
+
0.062745 0.952941 0.745098
|
| 383 |
+
0.192157 0.952941 0.745098
|
| 384 |
+
0.317647 0.952941 0.745098
|
| 385 |
+
0.443137 0.952941 0.745098
|
| 386 |
+
0.572549 0.952941 0.745098
|
| 387 |
+
0.698039 0.952941 0.745098
|
| 388 |
+
0.823529 0.952941 0.745098
|
| 389 |
+
0.952941 0.952941 0.745098
|
| 390 |
+
0.062745 0.062745 0.760784
|
| 391 |
+
0.192157 0.062745 0.760784
|
| 392 |
+
0.317647 0.062745 0.760784
|
| 393 |
+
0.443137 0.062745 0.760784
|
| 394 |
+
0.572549 0.062745 0.760784
|
| 395 |
+
0.698039 0.062745 0.760784
|
| 396 |
+
0.823529 0.062745 0.760784
|
| 397 |
+
0.952941 0.062745 0.760784
|
| 398 |
+
0.062745 0.192157 0.776471
|
| 399 |
+
0.192157 0.192157 0.776471
|
| 400 |
+
0.317647 0.192157 0.776471
|
| 401 |
+
0.443137 0.192157 0.776471
|
| 402 |
+
0.572549 0.192157 0.776471
|
| 403 |
+
0.698039 0.192157 0.776471
|
| 404 |
+
0.823529 0.192157 0.776471
|
| 405 |
+
0.952941 0.192157 0.776471
|
| 406 |
+
0.062745 0.317647 0.792157
|
| 407 |
+
0.192157 0.317647 0.792157
|
| 408 |
+
0.317647 0.317647 0.792157
|
| 409 |
+
0.443137 0.317647 0.792157
|
| 410 |
+
0.572549 0.317647 0.792157
|
| 411 |
+
0.698039 0.317647 0.792157
|
| 412 |
+
0.823529 0.317647 0.792157
|
| 413 |
+
0.952941 0.317647 0.792157
|
| 414 |
+
0.062745 0.443137 0.807843
|
| 415 |
+
0.192157 0.443137 0.807843
|
| 416 |
+
0.317647 0.443137 0.807843
|
| 417 |
+
0.443137 0.443137 0.807843
|
| 418 |
+
0.572549 0.443137 0.807843
|
| 419 |
+
0.698039 0.443137 0.807843
|
| 420 |
+
0.823529 0.443137 0.807843
|
| 421 |
+
0.952941 0.443137 0.807843
|
| 422 |
+
0.062745 0.572549 0.823529
|
| 423 |
+
0.192157 0.572549 0.823529
|
| 424 |
+
0.317647 0.572549 0.823529
|
| 425 |
+
0.443137 0.572549 0.823529
|
| 426 |
+
0.572549 0.572549 0.823529
|
| 427 |
+
0.698039 0.572549 0.823529
|
| 428 |
+
0.823529 0.572549 0.823529
|
| 429 |
+
0.952941 0.572549 0.823529
|
| 430 |
+
0.062745 0.698039 0.843137
|
| 431 |
+
0.192157 0.698039 0.843137
|
| 432 |
+
0.317647 0.698039 0.843137
|
| 433 |
+
0.443137 0.698039 0.843137
|
| 434 |
+
0.572549 0.698039 0.843137
|
| 435 |
+
0.698039 0.698039 0.843137
|
| 436 |
+
0.823529 0.698039 0.843137
|
| 437 |
+
0.952941 0.698039 0.843137
|
| 438 |
+
0.062745 0.823529 0.858824
|
| 439 |
+
0.192157 0.823529 0.858824
|
| 440 |
+
0.317647 0.823529 0.858824
|
| 441 |
+
0.443137 0.823529 0.858824
|
| 442 |
+
0.572549 0.823529 0.858824
|
| 443 |
+
0.698039 0.823529 0.858824
|
| 444 |
+
0.823529 0.823529 0.858824
|
| 445 |
+
0.952941 0.823529 0.858824
|
| 446 |
+
0.062745 0.952941 0.874510
|
| 447 |
+
0.192157 0.952941 0.874510
|
| 448 |
+
0.317647 0.952941 0.874510
|
| 449 |
+
0.443137 0.952941 0.874510
|
| 450 |
+
0.572549 0.952941 0.874510
|
| 451 |
+
0.698039 0.952941 0.874510
|
| 452 |
+
0.823529 0.952941 0.874510
|
| 453 |
+
0.952941 0.952941 0.874510
|
| 454 |
+
0.062745 0.062745 0.890196
|
| 455 |
+
0.192157 0.062745 0.890196
|
| 456 |
+
0.317647 0.062745 0.890196
|
| 457 |
+
0.443137 0.062745 0.890196
|
| 458 |
+
0.572549 0.062745 0.890196
|
| 459 |
+
0.698039 0.062745 0.890196
|
| 460 |
+
0.823529 0.062745 0.890196
|
| 461 |
+
0.952941 0.062745 0.890196
|
| 462 |
+
0.062745 0.192157 0.905882
|
| 463 |
+
0.192157 0.192157 0.905882
|
| 464 |
+
0.317647 0.192157 0.905882
|
| 465 |
+
0.443137 0.192157 0.905882
|
| 466 |
+
0.572549 0.192157 0.905882
|
| 467 |
+
0.698039 0.192157 0.905882
|
| 468 |
+
0.823529 0.192157 0.905882
|
| 469 |
+
0.952941 0.192157 0.905882
|
| 470 |
+
0.062745 0.317647 0.921569
|
| 471 |
+
0.192157 0.317647 0.921569
|
| 472 |
+
0.317647 0.317647 0.921569
|
| 473 |
+
0.443137 0.317647 0.921569
|
| 474 |
+
0.572549 0.317647 0.921569
|
| 475 |
+
0.698039 0.317647 0.921569
|
| 476 |
+
0.823529 0.317647 0.921569
|
| 477 |
+
0.952941 0.317647 0.921569
|
| 478 |
+
0.062745 0.443137 0.937255
|
| 479 |
+
0.192157 0.443137 0.937255
|
| 480 |
+
0.317647 0.443137 0.937255
|
| 481 |
+
0.443137 0.443137 0.937255
|
| 482 |
+
0.572549 0.443137 0.937255
|
| 483 |
+
0.698039 0.443137 0.937255
|
| 484 |
+
0.823529 0.443137 0.937255
|
| 485 |
+
0.952941 0.443137 0.937255
|
| 486 |
+
0.062745 0.572549 0.952941
|
| 487 |
+
0.192157 0.572549 0.952941
|
| 488 |
+
0.317647 0.572549 0.952941
|
| 489 |
+
0.443137 0.572549 0.952941
|
| 490 |
+
0.572549 0.572549 0.952941
|
| 491 |
+
0.698039 0.572549 0.952941
|
| 492 |
+
0.823529 0.572549 0.952941
|
| 493 |
+
0.952941 0.572549 0.952941
|
| 494 |
+
0.062745 0.698039 0.968627
|
| 495 |
+
0.192157 0.698039 0.968627
|
| 496 |
+
0.317647 0.698039 0.968627
|
| 497 |
+
0.443137 0.698039 0.968627
|
| 498 |
+
0.572549 0.698039 0.968627
|
| 499 |
+
0.698039 0.698039 0.968627
|
| 500 |
+
0.823529 0.698039 0.968627
|
| 501 |
+
0.952941 0.698039 0.968627
|
| 502 |
+
0.062745 0.823529 0.984314
|
| 503 |
+
0.192157 0.823529 0.984314
|
| 504 |
+
0.317647 0.823529 0.984314
|
| 505 |
+
0.443137 0.823529 0.984314
|
| 506 |
+
0.572549 0.823529 0.984314
|
| 507 |
+
0.698039 0.823529 0.984314
|
| 508 |
+
0.823529 0.823529 0.984314
|
| 509 |
+
0.952941 0.823529 0.984314
|
| 510 |
+
0.062745 0.952941 1.000000
|
| 511 |
+
0.192157 0.952941 1.000000
|
| 512 |
+
0.317647 0.952941 1.000000
|
| 513 |
+
0.443137 0.952941 1.000000
|
| 514 |
+
0.572549 0.952941 1.000000
|
| 515 |
+
0.698039 0.952941 1.000000
|
| 516 |
+
0.823529 0.952941 1.000000
|
| 517 |
+
0.952941 0.952941 1.000000
|
LUT/gist_heat.cube
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
TITLE "Colormap gist_heat"
|
| 2 |
+
LUT_1D_SIZE 256
|
| 3 |
+
0.0000000 0.0000000 0.0000000
|
| 4 |
+
0.0058824 0.0000000 0.0000000
|
| 5 |
+
0.0117647 0.0000000 0.0000000
|
| 6 |
+
0.0176471 0.0000000 0.0000000
|
| 7 |
+
0.0235294 0.0000000 0.0000000
|
| 8 |
+
0.0294118 0.0000000 0.0000000
|
| 9 |
+
0.0352941 0.0000000 0.0000000
|
| 10 |
+
0.0411765 0.0000000 0.0000000
|
| 11 |
+
0.0470588 0.0000000 0.0000000
|
| 12 |
+
0.0529412 0.0000000 0.0000000
|
| 13 |
+
0.0588235 0.0000000 0.0000000
|
| 14 |
+
0.0647059 0.0000000 0.0000000
|
| 15 |
+
0.0705882 0.0000000 0.0000000
|
| 16 |
+
0.0764706 0.0000000 0.0000000
|
| 17 |
+
0.0823529 0.0000000 0.0000000
|
| 18 |
+
0.0882353 0.0000000 0.0000000
|
| 19 |
+
0.0941176 0.0000000 0.0000000
|
| 20 |
+
0.1000000 0.0000000 0.0000000
|
| 21 |
+
0.1058824 0.0000000 0.0000000
|
| 22 |
+
0.1117647 0.0000000 0.0000000
|
| 23 |
+
0.1176471 0.0000000 0.0000000
|
| 24 |
+
0.1235294 0.0000000 0.0000000
|
| 25 |
+
0.1294118 0.0000000 0.0000000
|
| 26 |
+
0.1352941 0.0000000 0.0000000
|
| 27 |
+
0.1411765 0.0000000 0.0000000
|
| 28 |
+
0.1470588 0.0000000 0.0000000
|
| 29 |
+
0.1529412 0.0000000 0.0000000
|
| 30 |
+
0.1588235 0.0000000 0.0000000
|
| 31 |
+
0.1647059 0.0000000 0.0000000
|
| 32 |
+
0.1705882 0.0000000 0.0000000
|
| 33 |
+
0.1764706 0.0000000 0.0000000
|
| 34 |
+
0.1823529 0.0000000 0.0000000
|
| 35 |
+
0.1882353 0.0000000 0.0000000
|
| 36 |
+
0.1941176 0.0000000 0.0000000
|
| 37 |
+
0.2000000 0.0000000 0.0000000
|
| 38 |
+
0.2058824 0.0000000 0.0000000
|
| 39 |
+
0.2117647 0.0000000 0.0000000
|
| 40 |
+
0.2176471 0.0000000 0.0000000
|
| 41 |
+
0.2235294 0.0000000 0.0000000
|
| 42 |
+
0.2294118 0.0000000 0.0000000
|
| 43 |
+
0.2352941 0.0000000 0.0000000
|
| 44 |
+
0.2411765 0.0000000 0.0000000
|
| 45 |
+
0.2470588 0.0000000 0.0000000
|
| 46 |
+
0.2529412 0.0000000 0.0000000
|
| 47 |
+
0.2588235 0.0000000 0.0000000
|
| 48 |
+
0.2647059 0.0000000 0.0000000
|
| 49 |
+
0.2705882 0.0000000 0.0000000
|
| 50 |
+
0.2764706 0.0000000 0.0000000
|
| 51 |
+
0.2823529 0.0000000 0.0000000
|
| 52 |
+
0.2882353 0.0000000 0.0000000
|
| 53 |
+
0.2941176 0.0000000 0.0000000
|
| 54 |
+
0.3000000 0.0000000 0.0000000
|
| 55 |
+
0.3058824 0.0000000 0.0000000
|
| 56 |
+
0.3117647 0.0000000 0.0000000
|
| 57 |
+
0.3176471 0.0000000 0.0000000
|
| 58 |
+
0.3235294 0.0000000 0.0000000
|
| 59 |
+
0.3294118 0.0000000 0.0000000
|
| 60 |
+
0.3352941 0.0000000 0.0000000
|
| 61 |
+
0.3411765 0.0000000 0.0000000
|
| 62 |
+
0.3470588 0.0000000 0.0000000
|
| 63 |
+
0.3529412 0.0000000 0.0000000
|
| 64 |
+
0.3588235 0.0000000 0.0000000
|
| 65 |
+
0.3647059 0.0000000 0.0000000
|
| 66 |
+
0.3705882 0.0000000 0.0000000
|
| 67 |
+
0.3764706 0.0000000 0.0000000
|
| 68 |
+
0.3823529 0.0000000 0.0000000
|
| 69 |
+
0.3882353 0.0000000 0.0000000
|
| 70 |
+
0.3941176 0.0000000 0.0000000
|
| 71 |
+
0.4000000 0.0000000 0.0000000
|
| 72 |
+
0.4058824 0.0000000 0.0000000
|
| 73 |
+
0.4117647 0.0000000 0.0000000
|
| 74 |
+
0.4176471 0.0000000 0.0000000
|
| 75 |
+
0.4235294 0.0000000 0.0000000
|
| 76 |
+
0.4294118 0.0000000 0.0000000
|
| 77 |
+
0.4352941 0.0000000 0.0000000
|
| 78 |
+
0.4411765 0.0000000 0.0000000
|
| 79 |
+
0.4470588 0.0000000 0.0000000
|
| 80 |
+
0.4529412 0.0000000 0.0000000
|
| 81 |
+
0.4588235 0.0000000 0.0000000
|
| 82 |
+
0.4647059 0.0000000 0.0000000
|
| 83 |
+
0.4705882 0.0000000 0.0000000
|
| 84 |
+
0.4764706 0.0000000 0.0000000
|
| 85 |
+
0.4823529 0.0000000 0.0000000
|
| 86 |
+
0.4882353 0.0000000 0.0000000
|
| 87 |
+
0.4941176 0.0000000 0.0000000
|
| 88 |
+
0.5000000 0.0000000 0.0000000
|
| 89 |
+
0.5058824 0.0000000 0.0000000
|
| 90 |
+
0.5117647 0.0000000 0.0000000
|
| 91 |
+
0.5176471 0.0000000 0.0000000
|
| 92 |
+
0.5235294 0.0000000 0.0000000
|
| 93 |
+
0.5294118 0.0000000 0.0000000
|
| 94 |
+
0.5352941 0.0000000 0.0000000
|
| 95 |
+
0.5411765 0.0000000 0.0000000
|
| 96 |
+
0.5470588 0.0000000 0.0000000
|
| 97 |
+
0.5529412 0.0000000 0.0000000
|
| 98 |
+
0.5588235 0.0000000 0.0000000
|
| 99 |
+
0.5647059 0.0000000 0.0000000
|
| 100 |
+
0.5705882 0.0000000 0.0000000
|
| 101 |
+
0.5764706 0.0000000 0.0000000
|
| 102 |
+
0.5823529 0.0000000 0.0000000
|
| 103 |
+
0.5882353 0.0000000 0.0000000
|
| 104 |
+
0.5941176 0.0000000 0.0000000
|
| 105 |
+
0.6000000 0.0000000 0.0000000
|
| 106 |
+
0.6058824 0.0000000 0.0000000
|
| 107 |
+
0.6117647 0.0000000 0.0000000
|
| 108 |
+
0.6176471 0.0000000 0.0000000
|
| 109 |
+
0.6235294 0.0000000 0.0000000
|
| 110 |
+
0.6294118 0.0000000 0.0000000
|
| 111 |
+
0.6352941 0.0000000 0.0000000
|
| 112 |
+
0.6411765 0.0000000 0.0000000
|
| 113 |
+
0.6470588 0.0000000 0.0000000
|
| 114 |
+
0.6529412 0.0000000 0.0000000
|
| 115 |
+
0.6588235 0.0000000 0.0000000
|
| 116 |
+
0.6647059 0.0000000 0.0000000
|
| 117 |
+
0.6705882 0.0000000 0.0000000
|
| 118 |
+
0.6764706 0.0000000 0.0000000
|
| 119 |
+
0.6823529 0.0000000 0.0000000
|
| 120 |
+
0.6882353 0.0000000 0.0000000
|
| 121 |
+
0.6941176 0.0000000 0.0000000
|
| 122 |
+
0.7000000 0.0000000 0.0000000
|
| 123 |
+
0.7058824 0.0000000 0.0000000
|
| 124 |
+
0.7117647 0.0000000 0.0000000
|
| 125 |
+
0.7176471 0.0000000 0.0000000
|
| 126 |
+
0.7235294 0.0000000 0.0000000
|
| 127 |
+
0.7294118 0.0000000 0.0000000
|
| 128 |
+
0.7352941 0.0000000 0.0000000
|
| 129 |
+
0.7411765 0.0000000 0.0000000
|
| 130 |
+
0.7470588 0.0000000 0.0000000
|
| 131 |
+
0.7529412 0.0039216 0.0000000
|
| 132 |
+
0.7588235 0.0117647 0.0000000
|
| 133 |
+
0.7647059 0.0196078 0.0000000
|
| 134 |
+
0.7705882 0.0274510 0.0000000
|
| 135 |
+
0.7764706 0.0352941 0.0000000
|
| 136 |
+
0.7823529 0.0431373 0.0000000
|
| 137 |
+
0.7882353 0.0509804 0.0000000
|
| 138 |
+
0.7941176 0.0588235 0.0000000
|
| 139 |
+
0.8000000 0.0666667 0.0000000
|
| 140 |
+
0.8058824 0.0745098 0.0000000
|
| 141 |
+
0.8117647 0.0823529 0.0000000
|
| 142 |
+
0.8176471 0.0901961 0.0000000
|
| 143 |
+
0.8235294 0.0980392 0.0000000
|
| 144 |
+
0.8294118 0.1058824 0.0000000
|
| 145 |
+
0.8352941 0.1137255 0.0000000
|
| 146 |
+
0.8411765 0.1215686 0.0000000
|
| 147 |
+
0.8470588 0.1294118 0.0000000
|
| 148 |
+
0.8529412 0.1372549 0.0000000
|
| 149 |
+
0.8588235 0.1450980 0.0000000
|
| 150 |
+
0.8647059 0.1529412 0.0000000
|
| 151 |
+
0.8705882 0.1607843 0.0000000
|
| 152 |
+
0.8764706 0.1686275 0.0000000
|
| 153 |
+
0.8823529 0.1764706 0.0000000
|
| 154 |
+
0.8882353 0.1843137 0.0000000
|
| 155 |
+
0.8941176 0.1921569 0.0000000
|
| 156 |
+
0.9000000 0.2000000 0.0000000
|
| 157 |
+
0.9058824 0.2078431 0.0000000
|
| 158 |
+
0.9117647 0.2156863 0.0000000
|
| 159 |
+
0.9176471 0.2235294 0.0000000
|
| 160 |
+
0.9235294 0.2313725 0.0000000
|
| 161 |
+
0.9294118 0.2392157 0.0000000
|
| 162 |
+
0.9352941 0.2470588 0.0000000
|
| 163 |
+
0.9411765 0.2549020 0.0000000
|
| 164 |
+
0.9470588 0.2627451 0.0000000
|
| 165 |
+
0.9529412 0.2705882 0.0000000
|
| 166 |
+
0.9588235 0.2784314 0.0000000
|
| 167 |
+
0.9647059 0.2862745 0.0000000
|
| 168 |
+
0.9705882 0.2941176 0.0000000
|
| 169 |
+
0.9764706 0.3019608 0.0000000
|
| 170 |
+
0.9823529 0.3098039 0.0000000
|
| 171 |
+
0.9882353 0.3176471 0.0000000
|
| 172 |
+
0.9941176 0.3254902 0.0000000
|
| 173 |
+
1.0000000 0.3333333 0.0000000
|
| 174 |
+
1.0000000 0.3411765 0.0000000
|
| 175 |
+
1.0000000 0.3490196 0.0000000
|
| 176 |
+
1.0000000 0.3568627 0.0000000
|
| 177 |
+
1.0000000 0.3647059 0.0000000
|
| 178 |
+
1.0000000 0.3725490 0.0000000
|
| 179 |
+
1.0000000 0.3803922 0.0000000
|
| 180 |
+
1.0000000 0.3882353 0.0000000
|
| 181 |
+
1.0000000 0.3960784 0.0000000
|
| 182 |
+
1.0000000 0.4039216 0.0000000
|
| 183 |
+
1.0000000 0.4117647 0.0000000
|
| 184 |
+
1.0000000 0.4196078 0.0000000
|
| 185 |
+
1.0000000 0.4274510 0.0000000
|
| 186 |
+
1.0000000 0.4352941 0.0000000
|
| 187 |
+
1.0000000 0.4431373 0.0000000
|
| 188 |
+
1.0000000 0.4509804 0.0000000
|
| 189 |
+
1.0000000 0.4588235 0.0000000
|
| 190 |
+
1.0000000 0.4666667 0.0000000
|
| 191 |
+
1.0000000 0.4745098 0.0000000
|
| 192 |
+
1.0000000 0.4823529 0.0000000
|
| 193 |
+
1.0000000 0.4901961 0.0000000
|
| 194 |
+
1.0000000 0.4980392 0.0000000
|
| 195 |
+
1.0000000 0.5058824 0.0117647
|
| 196 |
+
1.0000000 0.5137255 0.0274510
|
| 197 |
+
1.0000000 0.5215686 0.0431373
|
| 198 |
+
1.0000000 0.5294118 0.0588235
|
| 199 |
+
1.0000000 0.5372549 0.0745098
|
| 200 |
+
1.0000000 0.5450980 0.0901961
|
| 201 |
+
1.0000000 0.5529412 0.1058824
|
| 202 |
+
1.0000000 0.5607843 0.1215686
|
| 203 |
+
1.0000000 0.5686275 0.1372549
|
| 204 |
+
1.0000000 0.5764706 0.1529412
|
| 205 |
+
1.0000000 0.5843137 0.1686275
|
| 206 |
+
1.0000000 0.5921569 0.1843137
|
| 207 |
+
1.0000000 0.6000000 0.2000000
|
| 208 |
+
1.0000000 0.6078431 0.2156863
|
| 209 |
+
1.0000000 0.6156863 0.2313725
|
| 210 |
+
1.0000000 0.6235294 0.2470588
|
| 211 |
+
1.0000000 0.6313725 0.2627451
|
| 212 |
+
1.0000000 0.6392157 0.2784314
|
| 213 |
+
1.0000000 0.6470588 0.2941176
|
| 214 |
+
1.0000000 0.6549020 0.3098039
|
| 215 |
+
1.0000000 0.6627451 0.3254902
|
| 216 |
+
1.0000000 0.6705882 0.3411765
|
| 217 |
+
1.0000000 0.6784314 0.3568627
|
| 218 |
+
1.0000000 0.6862745 0.3725490
|
| 219 |
+
1.0000000 0.6941176 0.3882353
|
| 220 |
+
1.0000000 0.7019608 0.4039216
|
| 221 |
+
1.0000000 0.7098039 0.4196078
|
| 222 |
+
1.0000000 0.7176471 0.4352941
|
| 223 |
+
1.0000000 0.7254902 0.4509804
|
| 224 |
+
1.0000000 0.7333333 0.4666667
|
| 225 |
+
1.0000000 0.7411765 0.4823529
|
| 226 |
+
1.0000000 0.7490196 0.4980392
|
| 227 |
+
1.0000000 0.7568627 0.5137255
|
| 228 |
+
1.0000000 0.7647059 0.5294118
|
| 229 |
+
1.0000000 0.7725490 0.5450980
|
| 230 |
+
1.0000000 0.7803922 0.5607843
|
| 231 |
+
1.0000000 0.7882353 0.5764706
|
| 232 |
+
1.0000000 0.7960784 0.5921569
|
| 233 |
+
1.0000000 0.8039216 0.6078431
|
| 234 |
+
1.0000000 0.8117647 0.6235294
|
| 235 |
+
1.0000000 0.8196078 0.6392157
|
| 236 |
+
1.0000000 0.8274510 0.6549020
|
| 237 |
+
1.0000000 0.8352941 0.6705882
|
| 238 |
+
1.0000000 0.8431373 0.6862745
|
| 239 |
+
1.0000000 0.8509804 0.7019608
|
| 240 |
+
1.0000000 0.8588235 0.7176471
|
| 241 |
+
1.0000000 0.8666667 0.7333333
|
| 242 |
+
1.0000000 0.8745098 0.7490196
|
| 243 |
+
1.0000000 0.8823529 0.7647059
|
| 244 |
+
1.0000000 0.8901961 0.7803922
|
| 245 |
+
1.0000000 0.8980392 0.7960784
|
| 246 |
+
1.0000000 0.9058824 0.8117647
|
| 247 |
+
1.0000000 0.9137255 0.8274510
|
| 248 |
+
1.0000000 0.9215686 0.8431373
|
| 249 |
+
1.0000000 0.9294118 0.8588235
|
| 250 |
+
1.0000000 0.9372549 0.8745098
|
| 251 |
+
1.0000000 0.9450980 0.8901961
|
| 252 |
+
1.0000000 0.9529412 0.9058824
|
| 253 |
+
1.0000000 0.9607843 0.9215686
|
| 254 |
+
1.0000000 0.9686275 0.9372549
|
| 255 |
+
1.0000000 0.9764706 0.9529412
|
| 256 |
+
1.0000000 0.9843137 0.9686275
|
| 257 |
+
1.0000000 0.9921569 0.9843137
|
| 258 |
+
1.0000000 1.0000000 1.0000000
|
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🌖
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
-
python_version: 3.
|
| 8 |
sdk_version: 5.22.0
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
|
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
python_version: 3.12.8
|
| 8 |
sdk_version: 5.22.0
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
app.py
CHANGED
|
@@ -702,40 +702,8 @@ with gr.Blocks(css_paths="style_20250314.css", title=title, theme='Surn/beeuty',
|
|
| 702 |
format="PNG"
|
| 703 |
)
|
| 704 |
|
| 705 |
-
with gr.Column(scale=
|
| 706 |
-
with gr.Accordion("Sketch Pad", open = False):
|
| 707 |
-
with gr.Row():
|
| 708 |
-
sketch_image = gr.Sketchpad(
|
| 709 |
-
label="Sketch Image",
|
| 710 |
-
type="filepath",
|
| 711 |
-
#invert_colors=True,
|
| 712 |
-
#sources=['upload','canvas'],
|
| 713 |
-
#tool=['editor','select','color-sketch'],
|
| 714 |
-
placeholder="Draw a sketch or upload an image. Currently broken in gradio 5.17.1",
|
| 715 |
-
interactive=True,
|
| 716 |
-
elem_classes="centered solid imgcontainer",
|
| 717 |
-
key="imgSketch",
|
| 718 |
-
image_mode="RGBA",
|
| 719 |
-
format="PNG",
|
| 720 |
-
brush=gr.Brush()
|
| 721 |
-
)
|
| 722 |
-
with gr.Row():
|
| 723 |
-
with gr.Column(scale=1):
|
| 724 |
-
sketch_replace_input_image_button = gr.Button(
|
| 725 |
-
"Replace Input Image with sketch",
|
| 726 |
-
elem_id="sketch_replace_input_image_button",
|
| 727 |
-
elem_classes="solid"
|
| 728 |
-
)
|
| 729 |
-
with gr.Column(scale=2):
|
| 730 |
-
alpha_composite_slider = gr.Slider(0,100,50,0.5, label="Alpha Composite Sketch to Input Image", elem_id="alpha_composite_slider")
|
| 731 |
-
|
| 732 |
with gr.Accordion("Image Filters", open = False):
|
| 733 |
-
with gr.Row():
|
| 734 |
-
with gr.Column():
|
| 735 |
-
composite_color = gr.ColorPicker(label="Color", value="#ede9ac44")
|
| 736 |
-
composite_opacity = gr.Slider(label="Opacity %", minimum=0, maximum=100, value=50, interactive=True)
|
| 737 |
-
with gr.Row():
|
| 738 |
-
composite_button = gr.Button("Composite", elem_classes="solid")
|
| 739 |
with gr.Row():
|
| 740 |
with gr.Column():
|
| 741 |
lut_filename = gr.Textbox(
|
|
@@ -748,37 +716,69 @@ with gr.Blocks(css_paths="style_20250314.css", title=title, theme='Surn/beeuty',
|
|
| 748 |
file_count="single",
|
| 749 |
file_types=[".cube"],
|
| 750 |
type="filepath",
|
| 751 |
-
label="LUT cube File"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 752 |
with gr.Row():
|
| 753 |
lut_example_image = gr.Image(type="pil", label="Filter (LUT) Example Image", value=default_lut_example_img)
|
| 754 |
with gr.Row():
|
| 755 |
with gr.Column():
|
| 756 |
gr.Markdown("""
|
| 757 |
### Included Filters (LUTs)
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
Try them on the example image before applying to your Input Image.
|
| 761 |
""", elem_id="lut_markdown")
|
| 762 |
with gr.Column():
|
| 763 |
gr.Examples(elem_id="lut_examples",
|
| 764 |
examples=[[f] for f in lut_files],
|
| 765 |
inputs=[lut_filename],
|
| 766 |
outputs=[lut_filename],
|
| 767 |
-
label="Select a Filter (LUT) file
|
| 768 |
-
examples_per_page=
|
| 769 |
)
|
| 770 |
|
| 771 |
-
with gr.Row():
|
| 772 |
-
apply_lut_button = gr.Button("Apply Filter (LUT)", elem_classes="solid", elem_id="apply_lut_button")
|
| 773 |
-
|
| 774 |
lut_file.change(get_filename, inputs=[lut_file], outputs=[lut_filename])
|
| 775 |
-
lut_filename.change(show_lut, inputs=[lut_filename, input_image], outputs=[lut_example_image])
|
|
|
|
| 776 |
apply_lut_button.click(
|
| 777 |
-
lambda lut_filename, input_image: gr.Warning("Please upload an Input Image to get started.") if input_image is None else apply_lut_to_image_path(lut_filename, input_image)[
|
| 778 |
-
inputs=[lut_filename, input_image],
|
| 779 |
outputs=[input_image],
|
| 780 |
scroll_to_output=True
|
| 781 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 782 |
with gr.Row():
|
| 783 |
with gr.Accordion("Generative AI", open = True ):
|
| 784 |
with gr.Column():
|
|
@@ -817,7 +817,7 @@ with gr.Blocks(css_paths="style_20250314.css", title=title, theme='Surn/beeuty',
|
|
| 817 |
with gr.Row():
|
| 818 |
with gr.Column(scale=1):
|
| 819 |
generate_button = gr.Button("Generate From Map Options, Input Image and LoRa Style", variant="primary", elem_id="gen_btn")
|
| 820 |
-
with gr.Accordion("
|
| 821 |
selected_info = gr.Markdown("")
|
| 822 |
lora_gallery = gr.Gallery(
|
| 823 |
[(item["image"], item["title"]) for item in loras],
|
|
|
|
| 702 |
format="PNG"
|
| 703 |
)
|
| 704 |
|
| 705 |
+
with gr.Column(scale=1):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 706 |
with gr.Accordion("Image Filters", open = False):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 707 |
with gr.Row():
|
| 708 |
with gr.Column():
|
| 709 |
lut_filename = gr.Textbox(
|
|
|
|
| 716 |
file_count="single",
|
| 717 |
file_types=[".cube"],
|
| 718 |
type="filepath",
|
| 719 |
+
label="LUT cube File",
|
| 720 |
+
height=120)
|
| 721 |
+
with gr.Row():
|
| 722 |
+
lut_intensity = gr.Slider(label="Filter Intensity", minimum=-200, maximum=200, value=100, info="0 none, negative inverts the filter", interactive=True)
|
| 723 |
+
apply_lut_button = gr.Button("Apply Filter (LUT)", elem_classes="solid", elem_id="apply_lut_button")
|
| 724 |
with gr.Row():
|
| 725 |
lut_example_image = gr.Image(type="pil", label="Filter (LUT) Example Image", value=default_lut_example_img)
|
| 726 |
with gr.Row():
|
| 727 |
with gr.Column():
|
| 728 |
gr.Markdown("""
|
| 729 |
### Included Filters (LUTs)
|
| 730 |
+
Try on Example Image then APPLY FILTER to Input Image.
|
| 731 |
+
*-none.cube files are placebo controls
|
|
|
|
| 732 |
""", elem_id="lut_markdown")
|
| 733 |
with gr.Column():
|
| 734 |
gr.Examples(elem_id="lut_examples",
|
| 735 |
examples=[[f] for f in lut_files],
|
| 736 |
inputs=[lut_filename],
|
| 737 |
outputs=[lut_filename],
|
| 738 |
+
label="Select a Filter (LUT) file to populate the LUT File Name field",
|
| 739 |
+
examples_per_page = 25,
|
| 740 |
)
|
| 741 |
|
|
|
|
|
|
|
|
|
|
| 742 |
lut_file.change(get_filename, inputs=[lut_file], outputs=[lut_filename])
|
| 743 |
+
lut_filename.change(show_lut, inputs=[lut_filename, input_image, lut_intensity], outputs=[lut_example_image], scroll_to_output=True)
|
| 744 |
+
lut_intensity.change(show_lut, inputs=[lut_filename, input_image, lut_intensity], outputs=[lut_example_image])
|
| 745 |
apply_lut_button.click(
|
| 746 |
+
lambda lut_filename, input_image, lut_intensity: gr.Warning("Please upload an Input Image to get started.") if input_image is None else apply_lut_to_image_path(lut_filename, input_image, lut_intensity)[1],
|
| 747 |
+
inputs=[lut_filename, input_image, lut_intensity],
|
| 748 |
outputs=[input_image],
|
| 749 |
scroll_to_output=True
|
| 750 |
)
|
| 751 |
+
with gr.Accordion("Color Composite", open = False):
|
| 752 |
+
with gr.Row():
|
| 753 |
+
composite_color = gr.ColorPicker(label="Color", value="#ede9ac44")
|
| 754 |
+
composite_opacity = gr.Slider(label="Opacity %", minimum=0, maximum=100, value=50, interactive=True)
|
| 755 |
+
with gr.Row():
|
| 756 |
+
composite_button = gr.Button("Composite", elem_classes="solid")
|
| 757 |
+
with gr.Accordion("Sketch Pad", open = False):
|
| 758 |
+
with gr.Row():
|
| 759 |
+
sketch_image = gr.Sketchpad(
|
| 760 |
+
label="Sketch Image",
|
| 761 |
+
type="filepath",
|
| 762 |
+
#invert_colors=True,
|
| 763 |
+
#sources=['upload','canvas'],
|
| 764 |
+
#tool=['editor','select','color-sketch'],
|
| 765 |
+
placeholder="Draw a sketch or upload an image. Currently broken in gradio 5.17.1",
|
| 766 |
+
interactive=True,
|
| 767 |
+
elem_classes="centered solid imgcontainer",
|
| 768 |
+
key="imgSketch",
|
| 769 |
+
image_mode="RGBA",
|
| 770 |
+
format="PNG",
|
| 771 |
+
brush=gr.Brush()
|
| 772 |
+
)
|
| 773 |
+
with gr.Row():
|
| 774 |
+
with gr.Column(scale=1):
|
| 775 |
+
sketch_replace_input_image_button = gr.Button(
|
| 776 |
+
"Replace Input Image with sketch",
|
| 777 |
+
elem_id="sketch_replace_input_image_button",
|
| 778 |
+
elem_classes="solid"
|
| 779 |
+
)
|
| 780 |
+
with gr.Column(scale=2):
|
| 781 |
+
alpha_composite_slider = gr.Slider(0,100,50,0.5, label="Alpha Composite Sketch to Input Image", elem_id="alpha_composite_slider")
|
| 782 |
with gr.Row():
|
| 783 |
with gr.Accordion("Generative AI", open = True ):
|
| 784 |
with gr.Column():
|
|
|
|
| 817 |
with gr.Row():
|
| 818 |
with gr.Column(scale=1):
|
| 819 |
generate_button = gr.Button("Generate From Map Options, Input Image and LoRa Style", variant="primary", elem_id="gen_btn")
|
| 820 |
+
with gr.Accordion("Image Styles*", open=False):
|
| 821 |
selected_info = gr.Markdown("")
|
| 822 |
lora_gallery = gr.Gallery(
|
| 823 |
[(item["image"], item["title"]) for item in loras],
|
modules/constants.py
CHANGED
|
@@ -65,6 +65,7 @@ TARGET_SIZE = (2688,1536)
|
|
| 65 |
#os.makedirs(TMP_DIR, exist_ok=True)
|
| 66 |
|
| 67 |
PROMPTS = {
|
|
|
|
| 68 |
"BorderBlack": "Top-down view, from above. of a hexagon-based alien map with black borders. Features rivers, mountains, volcanoes, and snow at top and bottom. Colors: light blue, green, tan, brown. No reflections or shadows. Partial hexes on edges are black.",
|
| 69 |
"Earth": "Top-down view of a world map with rivers, mountains, volcanoes, and snow at top and bottom. Colors: light blue, green, tan, brown. No reflections or shadows. Partial edge hexes are black. from above.",
|
| 70 |
"Beeuty": "Top-down view of a table map with honeycomb_shapes, lakes, dense forests, magical flora, and hex_grids. Map for tabletop gaming with clarity and strategic elements. Colors: yellow, green, purple, brown. Partial hexes on edges are black. Viewed from above.",
|
|
@@ -73,10 +74,13 @@ PROMPTS = {
|
|
| 73 |
"Alien World": "Top-down view of an alien world map built from hexagon pieces. Includes rivers, mountains, volcanoes, and snowy areas. Colors: light blue, green, tan, brown. Partial edge hexes are black. Overhead view.",
|
| 74 |
"Mystic Forest": "Top-down view of a mystic forest map with lakes, dense forests, magical flora, and hex grids. Designed for clarity in tabletop gaming. Colors: light blue, green, purple, brown. Partial hexes on edges are black.",
|
| 75 |
"Medieval Battlefield": "Top-down view of a medieval battlefield map featuring lakes, forests, and magic fauna. Emphasizes clarity and strategy for tabletop games. Colors: teal, dark green, violet, brown. Partial edge hexes are black. Viewed from above.",
|
|
|
|
|
|
|
| 76 |
"Prompt": None # Indicates that the prompt should be taken from prompt_textbox
|
| 77 |
}
|
| 78 |
|
| 79 |
NEGATIVE_PROMPTS = {
|
|
|
|
| 80 |
"BorderBlack": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, realistic map of the Earth, isometric",
|
| 81 |
"Earth": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, missing map of the Earth, isometric",
|
| 82 |
"Beeuty": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, map of the Earth, isometric",
|
|
@@ -85,6 +89,8 @@ NEGATIVE_PROMPTS = {
|
|
| 85 |
"Alien World": "Earth, humans, modern_buildings, vehicles, text, logos, reflections, shadows, realistic map of the Earth, isometric",
|
| 86 |
"Mystic Forest": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, realistic map of the Earth, isometric",
|
| 87 |
"Medieval Battlefield": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, realistic map of the Earth, isometric",
|
|
|
|
|
|
|
| 88 |
"Prompt": None # Indicates that the negative prompt should be taken from negative_prompt_textbox
|
| 89 |
}
|
| 90 |
|
|
|
|
| 65 |
#os.makedirs(TMP_DIR, exist_ok=True)
|
| 66 |
|
| 67 |
PROMPTS = {
|
| 68 |
+
"Mecha Wasteland Arena":"Top-down view of a Mecha battlefield map. post-industrial wasteland. Crumbling structures, volcanic ridges, scrapyards, and ash plains. Features elevated overwatch positions and tight brawling areas. Colors: red, gray, orange, white, brown. Partial edge hexes are black.",
|
| 69 |
"BorderBlack": "Top-down view, from above. of a hexagon-based alien map with black borders. Features rivers, mountains, volcanoes, and snow at top and bottom. Colors: light blue, green, tan, brown. No reflections or shadows. Partial hexes on edges are black.",
|
| 70 |
"Earth": "Top-down view of a world map with rivers, mountains, volcanoes, and snow at top and bottom. Colors: light blue, green, tan, brown. No reflections or shadows. Partial edge hexes are black. from above.",
|
| 71 |
"Beeuty": "Top-down view of a table map with honeycomb_shapes, lakes, dense forests, magical flora, and hex_grids. Map for tabletop gaming with clarity and strategic elements. Colors: yellow, green, purple, brown. Partial hexes on edges are black. Viewed from above.",
|
|
|
|
| 74 |
"Alien World": "Top-down view of an alien world map built from hexagon pieces. Includes rivers, mountains, volcanoes, and snowy areas. Colors: light blue, green, tan, brown. Partial edge hexes are black. Overhead view.",
|
| 75 |
"Mystic Forest": "Top-down view of a mystic forest map with lakes, dense forests, magical flora, and hex grids. Designed for clarity in tabletop gaming. Colors: light blue, green, purple, brown. Partial hexes on edges are black.",
|
| 76 |
"Medieval Battlefield": "Top-down view of a medieval battlefield map featuring lakes, forests, and magic fauna. Emphasizes clarity and strategy for tabletop games. Colors: teal, dark green, violet, brown. Partial edge hexes are black. Viewed from above.",
|
| 77 |
+
"Dungeon Interior":"Top-down view of a dungeon interior map for tabletop gaming, Features stone walls, corridors, rooms with doors, traps, and treasure chests. Emphasizes clarity for strategic gameplay. Colors: gray, brown, dark blue. Partial edge hexes are black. Viewed from above",
|
| 78 |
+
"Desert Wasteland":"Top-down view of a desert wasteland map for tabletop gaming, Includes sand dunes, rocky canyons, oases with water and palm trees, and ancient ruins. Designed for clarity and strategy. Colors: yellow, tan, brown, blue, green. Partial edge hexes are black. Viewed from above.",
|
| 79 |
"Prompt": None # Indicates that the prompt should be taken from prompt_textbox
|
| 80 |
}
|
| 81 |
|
| 82 |
NEGATIVE_PROMPTS = {
|
| 83 |
+
"Mecha Wasteland Arena": "humans, old_buildings, water, bright colors, text, logos, shadows, Earth geography, isometric",
|
| 84 |
"BorderBlack": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, realistic map of the Earth, isometric",
|
| 85 |
"Earth": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, missing map of the Earth, isometric",
|
| 86 |
"Beeuty": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, map of the Earth, isometric",
|
|
|
|
| 89 |
"Alien World": "Earth, humans, modern_buildings, vehicles, text, logos, reflections, shadows, realistic map of the Earth, isometric",
|
| 90 |
"Mystic Forest": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, realistic map of the Earth, isometric",
|
| 91 |
"Medieval Battlefield": "humans, modern_buildings, vehicles, text, logos, reflections, shadows, realistic map of the Earth, isometric",
|
| 92 |
+
"Dungeon Interior":"humans, modern_buildings, vehicles, text, logos, reflections, shadows, outdoor elements, realistic map of the Earth, isometric",
|
| 93 |
+
"Desert Wasteland":"humans, modern_buildings, vehicles, text, logos, reflections, shadows, lush forests, large bodies of water, snow, realistic map of the Earth, isometric",
|
| 94 |
"Prompt": None # Indicates that the negative prompt should be taken from negative_prompt_textbox
|
| 95 |
}
|
| 96 |
|
modules/image_utils.py
CHANGED
|
@@ -609,7 +609,25 @@ def read_3d_lut(path_lut: Union[str, os.PathLike], num_channels: int = 3) -> Ima
|
|
| 609 |
lut_table = [row2val(row) for row in lut_raw if is_3dlut_row(row.split(" "))]
|
| 610 |
return ImageFilter.Color3DLUT(size, lut_table, num_channels)
|
| 611 |
|
| 612 |
-
def apply_1d_lut(image, lut_file):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
# Read the 1D LUT
|
| 614 |
with open(lut_file) as f:
|
| 615 |
lines = f.read().splitlines()
|
|
@@ -619,20 +637,58 @@ def apply_1d_lut(image, lut_file):
|
|
| 619 |
values = [float(v) for v in line.split()]
|
| 620 |
table.append(tuple(values))
|
| 621 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 622 |
# Convert image to grayscale
|
| 623 |
if image.mode != 'L':
|
| 624 |
image = image.convert('L')
|
| 625 |
img_array = np.array(image) / 255.0 # Normalize to [0, 1]
|
| 626 |
|
| 627 |
# Map grayscale values to colors
|
| 628 |
-
lut_size = len(
|
| 629 |
indices = (img_array * (lut_size - 1)).astype(int)
|
| 630 |
-
colors = np.array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 631 |
|
| 632 |
# Create RGB image
|
| 633 |
-
rgb_image = Image.fromarray((
|
| 634 |
return rgb_image
|
| 635 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 636 |
def apply_3d_lut(img: Image, lut_path: str = "", lut: ImageFilter.Color3DLUT = None) -> Image:
|
| 637 |
"""
|
| 638 |
Apply a LUT to an image and return a PIL Image with the LUT applied.
|
|
@@ -656,39 +712,143 @@ def apply_3d_lut(img: Image, lut_path: str = "", lut: ImageFilter.Color3DLUT = N
|
|
| 656 |
lut = read_3d_lut(lut_path)
|
| 657 |
return img.filter(lut)
|
| 658 |
|
| 659 |
-
def
|
| 660 |
"""
|
| 661 |
-
Apply a LUT to an image
|
|
|
|
| 662 |
Args:
|
| 663 |
-
image
|
| 664 |
-
lut_filename
|
|
|
|
|
|
|
| 665 |
Returns:
|
| 666 |
-
PIL
|
| 667 |
"""
|
|
|
|
|
|
|
|
|
|
| 668 |
if isinstance(image, str):
|
| 669 |
image = open_image(image)
|
|
|
|
| 670 |
if lut_filename is not None:
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 674 |
else:
|
| 675 |
-
|
|
|
|
|
|
|
| 676 |
return image
|
| 677 |
|
| 678 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 679 |
if lut_example_image is None:
|
| 680 |
lut_example_image = default_lut_example_img
|
| 681 |
|
| 682 |
if lut_filename is not None:
|
| 683 |
try:
|
| 684 |
-
lut_example_image = apply_lut(lut_example_image, lut_filename)
|
| 685 |
except Exception as e:
|
| 686 |
print(f"BAD LUT: Error applying LUT {str(e)}.")
|
| 687 |
else:
|
| 688 |
lut_example_image = open_image(default_lut_example_img)
|
| 689 |
return lut_example_image
|
| 690 |
|
| 691 |
-
def
|
| 692 |
# Read the 1D LUT
|
| 693 |
with open(lut_file) as f:
|
| 694 |
lines = f.read().splitlines()
|
|
@@ -712,7 +872,7 @@ def apply_1d_lut(image, lut_file):
|
|
| 712 |
rgb_image = Image.fromarray((colors * 255).astype(np.uint8), mode='RGB')
|
| 713 |
return rgb_image
|
| 714 |
|
| 715 |
-
def apply_lut_to_image_path(lut_filename: str, image_path: str) -> tuple[Image, str]:
|
| 716 |
"""
|
| 717 |
Apply a LUT to an image and return the result.
|
| 718 |
Supports ICO files by converting them to PNG with RGBA channels.
|
|
@@ -762,7 +922,7 @@ def apply_lut_to_image_path(lut_filename: str, image_path: str) -> tuple[Image,
|
|
| 762 |
# Apply the LUT to the image
|
| 763 |
if (lut_filename is not None and img is not None):
|
| 764 |
try:
|
| 765 |
-
img_lut = apply_lut(img, lut_filename)
|
| 766 |
except Exception as e:
|
| 767 |
print(f"BAD LUT: Error applying LUT {str(e)}.")
|
| 768 |
if img_lut is not None:
|
|
@@ -774,9 +934,6 @@ def apply_lut_to_image_path(lut_filename: str, image_path: str) -> tuple[Image,
|
|
| 774 |
print(f"Image with LUT saved as {new_image_path}")
|
| 775 |
return img, gr.update(value=str(new_image_path))
|
| 776 |
|
| 777 |
-
from PIL import Image
|
| 778 |
-
import numpy as np
|
| 779 |
-
|
| 780 |
def png_to_cube(input_png_path, output_cube_path, lut_size=17):
|
| 781 |
# Example usage
|
| 782 |
# png_to_cube(input_file, output_file, lut_size=17)
|
|
@@ -793,11 +950,11 @@ def png_to_cube(input_png_path, output_cube_path, lut_size=17):
|
|
| 793 |
# Open the output .cube file
|
| 794 |
with open(output_cube_path, "w") as f:
|
| 795 |
# Write .cube header
|
| 796 |
-
f.write('#
|
| 797 |
f.write('TITLE "Converted LUT"\n')
|
| 798 |
f.write(f'LUT_3D_SIZE {lut_size}\n')
|
| 799 |
f.write('DOMAIN_MIN 0.0 0.0 0.0\n')
|
| 800 |
-
f.write('DOMAIN_MAX 1.0 1.0 1.0\n')
|
| 801 |
# Iterate over the 3D LUT grid (R, G, B)
|
| 802 |
for b in range(lut_size): # Blue channel
|
| 803 |
for g in range(lut_size): # Green channel
|
|
@@ -807,7 +964,7 @@ def png_to_cube(input_png_path, output_cube_path, lut_size=17):
|
|
| 807 |
# - X-axis (horizontal) = Red
|
| 808 |
# - Y-axis (vertical) = Green + Blue slices
|
| 809 |
x = r * step + step // 2 # Center of each Red step
|
| 810 |
-
y = (g + b * lut_size) * step + step // 2 # Green + Blue offset
|
| 811 |
# Ensure coordinates stay within bounds
|
| 812 |
x = min(x, 511)
|
| 813 |
y = min(y, 511)
|
|
@@ -833,7 +990,7 @@ def png_8x8_to_3d_cube(input_png_path, output_cube_path, lut_size=8):
|
|
| 833 |
# Open the output .cube file
|
| 834 |
with open(output_cube_path, "w") as f:
|
| 835 |
# Write .cube header for 3D LUT
|
| 836 |
-
f.write('#
|
| 837 |
f.write('TITLE "Converted 8x8x8 LUT"\n')
|
| 838 |
f.write(f'LUT_3D_SIZE {lut_size}\n')
|
| 839 |
f.write('DOMAIN_MIN 0.0 0.0 0.0\n')
|
|
@@ -860,6 +1017,40 @@ def png_8x8_to_3d_cube(input_png_path, output_cube_path, lut_size=8):
|
|
| 860 |
f.write(f"{rgb[0]:.6f} {rgb[1]:.6f} {rgb[2]:.6f}\n")
|
| 861 |
print(f"3D LUT conversion complete. Saved to {output_cube_path}")
|
| 862 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 863 |
############################################# RGBA ###########################################################
|
| 864 |
def convert_rgb_to_rgba_safe(image: Image) -> Image:
|
| 865 |
"""
|
|
|
|
| 609 |
lut_table = [row2val(row) for row in lut_raw if is_3dlut_row(row.split(" "))]
|
| 610 |
return ImageFilter.Color3DLUT(size, lut_table, num_channels)
|
| 611 |
|
| 612 |
+
def apply_1d_lut(image, lut_file, intensity: int = 100, lut_scale: float = 1.0, lut_offset: float = 0.0):
|
| 613 |
+
"""
|
| 614 |
+
Apply a 1D LUT to an image with intensity, scale, and offset control.
|
| 615 |
+
|
| 616 |
+
Args:
|
| 617 |
+
image: PIL Image object.
|
| 618 |
+
lut_file: Path to the 1D LUT file.
|
| 619 |
+
intensity: Integer from -200 to 200 controlling LUT strength (default 100).
|
| 620 |
+
lut_scale: Float to scale LUT colors (default 1.0).
|
| 621 |
+
lut_offset: Float to offset LUT colors (default 0.0).
|
| 622 |
+
|
| 623 |
+
Returns:
|
| 624 |
+
PIL Image object with the adjusted LUT applied.
|
| 625 |
+
"""
|
| 626 |
+
import numpy as np
|
| 627 |
+
|
| 628 |
+
# Compute blending factor
|
| 629 |
+
alpha = intensity / 100.0 # Ranges from -2.0 to 2.0
|
| 630 |
+
|
| 631 |
# Read the 1D LUT
|
| 632 |
with open(lut_file) as f:
|
| 633 |
lines = f.read().splitlines()
|
|
|
|
| 637 |
values = [float(v) for v in line.split()]
|
| 638 |
table.append(tuple(values))
|
| 639 |
|
| 640 |
+
# Adjust LUT table with scale and offset
|
| 641 |
+
adjusted_table = [
|
| 642 |
+
tuple(np.clip(val * lut_scale + lut_offset, 0, 1) for val in color)
|
| 643 |
+
for color in table
|
| 644 |
+
]
|
| 645 |
+
|
| 646 |
+
# If intensity is negative, use inverted LUT
|
| 647 |
+
if alpha < 0:
|
| 648 |
+
adjusted_table = [(1 - r, 1 - g, 1 - b) for r, g, b in adjusted_table]
|
| 649 |
+
alpha = -alpha # Use positive alpha for blending
|
| 650 |
+
|
| 651 |
# Convert image to grayscale
|
| 652 |
if image.mode != 'L':
|
| 653 |
image = image.convert('L')
|
| 654 |
img_array = np.array(image) / 255.0 # Normalize to [0, 1]
|
| 655 |
|
| 656 |
# Map grayscale values to colors
|
| 657 |
+
lut_size = len(adjusted_table)
|
| 658 |
indices = (img_array * (lut_size - 1)).astype(int)
|
| 659 |
+
colors = np.array(adjusted_table)[indices] # LUT-mapped colors, shape (H, W, 3)
|
| 660 |
+
|
| 661 |
+
# Create original colors (grayscale replicated across RGB)
|
| 662 |
+
original_colors = np.repeat(img_array[:, :, np.newaxis], 3, axis=2) # Shape (H, W, 3)
|
| 663 |
+
|
| 664 |
+
# Blend original and LUT-mapped colors
|
| 665 |
+
blended_colors = original_colors * (1 - alpha) + colors * alpha
|
| 666 |
+
blended_colors = np.clip(blended_colors, 0, 1) # Ensure values stay in [0, 1]
|
| 667 |
|
| 668 |
# Create RGB image
|
| 669 |
+
rgb_image = Image.fromarray((blended_colors * 255).astype(np.uint8), mode='RGB')
|
| 670 |
return rgb_image
|
| 671 |
|
| 672 |
+
def invert_lut(original_lut: ImageFilter.Color3DLUT) -> ImageFilter.Color3DLUT:
|
| 673 |
+
"""
|
| 674 |
+
Create an inverted LUT by reversing the order of entries to simulate a 180-degree rotation.
|
| 675 |
+
|
| 676 |
+
Args:
|
| 677 |
+
original_lut: The original Color3DLUT object.
|
| 678 |
+
|
| 679 |
+
Returns:
|
| 680 |
+
A new Color3DLUT object with inverted entries.
|
| 681 |
+
"""
|
| 682 |
+
# Extract the table and size from the original LUT
|
| 683 |
+
size = original_lut.size[0] # Assuming cubic LUT
|
| 684 |
+
table = original_lut.table
|
| 685 |
+
|
| 686 |
+
# Reverse the table to simulate a 180-degree rotation
|
| 687 |
+
inverted_table = table[::-1]
|
| 688 |
+
|
| 689 |
+
# Create and return the inverted LUT with the same number of channels
|
| 690 |
+
return ImageFilter.Color3DLUT(size, inverted_table, original_lut.channels)
|
| 691 |
+
|
| 692 |
def apply_3d_lut(img: Image, lut_path: str = "", lut: ImageFilter.Color3DLUT = None) -> Image:
|
| 693 |
"""
|
| 694 |
Apply a LUT to an image and return a PIL Image with the LUT applied.
|
|
|
|
| 712 |
lut = read_3d_lut(lut_path)
|
| 713 |
return img.filter(lut)
|
| 714 |
|
| 715 |
+
def apply_lut_simple(image, lut_filename: str, intensity: int = 100) -> Image:
|
| 716 |
"""
|
| 717 |
+
Apply a LUT to an image with intensity control.
|
| 718 |
+
|
| 719 |
Args:
|
| 720 |
+
image: PIL Image object or path to image file.
|
| 721 |
+
lut_filename: Path to the LUT file.
|
| 722 |
+
intensity: Integer from -200 to 200 controlling LUT strength (default 100).
|
| 723 |
+
|
| 724 |
Returns:
|
| 725 |
+
PIL Image object with the adjusted LUT applied.
|
| 726 |
"""
|
| 727 |
+
import numpy as np
|
| 728 |
+
|
| 729 |
+
# Handle image input as string
|
| 730 |
if isinstance(image, str):
|
| 731 |
image = open_image(image)
|
| 732 |
+
|
| 733 |
if lut_filename is not None:
|
| 734 |
+
lut_type = get_lut_type(lut_filename)
|
| 735 |
+
if lut_type == "3D":
|
| 736 |
+
# Read the original 3D LUT
|
| 737 |
+
original_lut = read_3d_lut(lut_filename)
|
| 738 |
+
|
| 739 |
+
# Apply the original LUT to the image
|
| 740 |
+
lutted_image = image.filter(original_lut)
|
| 741 |
+
|
| 742 |
+
# Compute blending factor
|
| 743 |
+
alpha = intensity / 100.0 # Ranges from -2.0 to 2.0
|
| 744 |
+
|
| 745 |
+
# Handle special cases
|
| 746 |
+
if alpha == 0:
|
| 747 |
+
return image
|
| 748 |
+
elif alpha == 1:
|
| 749 |
+
return lutted_image
|
| 750 |
+
else:
|
| 751 |
+
# Convert images to NumPy arrays for blending
|
| 752 |
+
img_array = np.array(image).astype(float) / 255.0
|
| 753 |
+
lutted_array = np.array(lutted_image).astype(float) / 255.0
|
| 754 |
+
blended_array = img_array * (1 - alpha) + lutted_array * alpha
|
| 755 |
+
blended_array = np.clip(blended_array, 0, 1)
|
| 756 |
+
blended_image = Image.fromarray((blended_array * 255).astype(np.uint8))
|
| 757 |
+
return blended_image
|
| 758 |
else:
|
| 759 |
+
# Apply 1D LUT with intensity (already correct)
|
| 760 |
+
image = apply_1d_lut(image, lut_filename, intensity)
|
| 761 |
+
|
| 762 |
return image
|
| 763 |
|
| 764 |
+
def apply_lut(image, lut_filename: str, intensity: int = 100, lut_scale: float = 1.0, lut_offset: float = 0.0) -> Image:
|
| 765 |
+
"""
|
| 766 |
+
Apply a LUT to an image with intensity, scale, and offset adjustments.
|
| 767 |
+
|
| 768 |
+
Args:
|
| 769 |
+
image: PIL Image object or path to image file.
|
| 770 |
+
lut_filename: Path to the LUT file (.cube for 3D LUT or text file for 1D LUT).
|
| 771 |
+
intensity: Integer from -200 to 200 controlling LUT strength (default 100).
|
| 772 |
+
lut_scale: Float to scale LUT colors (default 1.0).
|
| 773 |
+
lut_offset: Float to offset LUT colors (default 0.0).
|
| 774 |
+
|
| 775 |
+
Returns:
|
| 776 |
+
PIL Image object with the adjusted LUT applied.
|
| 777 |
+
"""
|
| 778 |
+
|
| 779 |
+
|
| 780 |
+
# Handle image input as string
|
| 781 |
+
if isinstance(image, str):
|
| 782 |
+
image = Image.open(image).convert('RGB')
|
| 783 |
+
|
| 784 |
+
if lut_filename is None:
|
| 785 |
+
return image
|
| 786 |
+
|
| 787 |
+
lut_type = get_lut_type(lut_filename)
|
| 788 |
+
|
| 789 |
+
if lut_type == "3D":
|
| 790 |
+
# Read the original 3D LUT
|
| 791 |
+
# Read the original 3D LUT using the external function
|
| 792 |
+
original_lut = read_3d_lut(lut_filename)
|
| 793 |
+
|
| 794 |
+
# Create the inverted LUT
|
| 795 |
+
inverted_lut = invert_lut(original_lut)
|
| 796 |
+
|
| 797 |
+
# Define a function to adjust LUT entries with scale and offset
|
| 798 |
+
def adjust_entry(r, g, b):
|
| 799 |
+
r = np.clip(r * lut_scale + lut_offset, 0, 1)
|
| 800 |
+
g = np.clip(g * lut_scale + lut_offset, 0, 1)
|
| 801 |
+
b = np.clip(b * lut_scale + lut_offset, 0, 1)
|
| 802 |
+
return (r, g, b)
|
| 803 |
+
|
| 804 |
+
# Apply scale and offset adjustments to both LUTs
|
| 805 |
+
adjusted_original_lut = original_lut.transform(adjust_entry)
|
| 806 |
+
adjusted_inverted_lut = inverted_lut.transform(adjust_entry)
|
| 807 |
+
|
| 808 |
+
# Compute blending factor from intensity
|
| 809 |
+
alpha = intensity / 100.0 # Ranges from -2.0 to 2.0
|
| 810 |
+
|
| 811 |
+
# Select the appropriate LUT based on intensity
|
| 812 |
+
if alpha >= 0:
|
| 813 |
+
lut_to_use = adjusted_original_lut
|
| 814 |
+
else:
|
| 815 |
+
lut_to_use = adjusted_inverted_lut
|
| 816 |
+
alpha = -alpha # Use positive alpha for blending with inverted LUT
|
| 817 |
+
|
| 818 |
+
# Apply the selected LUT to the image
|
| 819 |
+
lutted_image = image.filter(lut_to_use)
|
| 820 |
+
|
| 821 |
+
# Convert images to NumPy arrays for blending
|
| 822 |
+
original_array = np.array(image, dtype=np.float32) / 255.0
|
| 823 |
+
lutted_array = np.array(lutted_image, dtype=np.float32) / 255.0
|
| 824 |
+
|
| 825 |
+
# Blend the original and LUT-applied images
|
| 826 |
+
blended_array = original_array * (1 - alpha) + lutted_array * alpha
|
| 827 |
+
blended_array = np.clip(blended_array, 0, 1)
|
| 828 |
+
|
| 829 |
+
# Convert back to PIL Image
|
| 830 |
+
final_image = Image.fromarray((blended_array * 255).astype(np.uint8))
|
| 831 |
+
return final_image
|
| 832 |
+
|
| 833 |
+
else: # 1D LUT
|
| 834 |
+
# Delegate to the modified apply_1d_lut function
|
| 835 |
+
return apply_1d_lut(image, lut_filename, intensity, lut_scale, lut_offset)
|
| 836 |
+
|
| 837 |
+
|
| 838 |
+
def show_lut(lut_filename: str, lut_example_image: Image = default_lut_example_img, intensity: int = 100) -> Image:
|
| 839 |
if lut_example_image is None:
|
| 840 |
lut_example_image = default_lut_example_img
|
| 841 |
|
| 842 |
if lut_filename is not None:
|
| 843 |
try:
|
| 844 |
+
lut_example_image = apply_lut(lut_example_image, lut_filename, intensity)
|
| 845 |
except Exception as e:
|
| 846 |
print(f"BAD LUT: Error applying LUT {str(e)}.")
|
| 847 |
else:
|
| 848 |
lut_example_image = open_image(default_lut_example_img)
|
| 849 |
return lut_example_image
|
| 850 |
|
| 851 |
+
def apply_1d_lut_simple(image, lut_file):
|
| 852 |
# Read the 1D LUT
|
| 853 |
with open(lut_file) as f:
|
| 854 |
lines = f.read().splitlines()
|
|
|
|
| 872 |
rgb_image = Image.fromarray((colors * 255).astype(np.uint8), mode='RGB')
|
| 873 |
return rgb_image
|
| 874 |
|
| 875 |
+
def apply_lut_to_image_path(lut_filename: str, image_path: str, intensity: int = 100 ) -> tuple[Image, str]:
|
| 876 |
"""
|
| 877 |
Apply a LUT to an image and return the result.
|
| 878 |
Supports ICO files by converting them to PNG with RGBA channels.
|
|
|
|
| 922 |
# Apply the LUT to the image
|
| 923 |
if (lut_filename is not None and img is not None):
|
| 924 |
try:
|
| 925 |
+
img_lut = apply_lut(img, lut_filename, intensity)
|
| 926 |
except Exception as e:
|
| 927 |
print(f"BAD LUT: Error applying LUT {str(e)}.")
|
| 928 |
if img_lut is not None:
|
|
|
|
| 934 |
print(f"Image with LUT saved as {new_image_path}")
|
| 935 |
return img, gr.update(value=str(new_image_path))
|
| 936 |
|
|
|
|
|
|
|
|
|
|
| 937 |
def png_to_cube(input_png_path, output_cube_path, lut_size=17):
|
| 938 |
# Example usage
|
| 939 |
# png_to_cube(input_file, output_file, lut_size=17)
|
|
|
|
| 950 |
# Open the output .cube file
|
| 951 |
with open(output_cube_path, "w") as f:
|
| 952 |
# Write .cube header
|
| 953 |
+
f.write('# Charles Fettinger by PNG to LUT converter\n')
|
| 954 |
f.write('TITLE "Converted LUT"\n')
|
| 955 |
f.write(f'LUT_3D_SIZE {lut_size}\n')
|
| 956 |
f.write('DOMAIN_MIN 0.0 0.0 0.0\n')
|
| 957 |
+
f.write('DOMAIN_MAX 1.0 1.0 1.0\n')
|
| 958 |
# Iterate over the 3D LUT grid (R, G, B)
|
| 959 |
for b in range(lut_size): # Blue channel
|
| 960 |
for g in range(lut_size): # Green channel
|
|
|
|
| 964 |
# - X-axis (horizontal) = Red
|
| 965 |
# - Y-axis (vertical) = Green + Blue slices
|
| 966 |
x = r * step + step // 2 # Center of each Red step
|
| 967 |
+
y = (g + b * lut_size) * step + step // 2 # Green + Blue offset
|
| 968 |
# Ensure coordinates stay within bounds
|
| 969 |
x = min(x, 511)
|
| 970 |
y = min(y, 511)
|
|
|
|
| 990 |
# Open the output .cube file
|
| 991 |
with open(output_cube_path, "w") as f:
|
| 992 |
# Write .cube header for 3D LUT
|
| 993 |
+
f.write('# Charles Fettinger 3D LUT from 8x8 PNG\n')
|
| 994 |
f.write('TITLE "Converted 8x8x8 LUT"\n')
|
| 995 |
f.write(f'LUT_3D_SIZE {lut_size}\n')
|
| 996 |
f.write('DOMAIN_MIN 0.0 0.0 0.0\n')
|
|
|
|
| 1017 |
f.write(f"{rgb[0]:.6f} {rgb[1]:.6f} {rgb[2]:.6f}\n")
|
| 1018 |
print(f"3D LUT conversion complete. Saved to {output_cube_path}")
|
| 1019 |
|
| 1020 |
+
def png_8x8_to_3d_cube_inverted(input_png_path, output_cube_path, lut_size=8):
|
| 1021 |
+
# Open the PNG file
|
| 1022 |
+
img = Image.open(input_png_path)
|
| 1023 |
+
if img.size != (512, 512):
|
| 1024 |
+
raise ValueError("Input PNG must be 512x512 pixels.")
|
| 1025 |
+
# Convert to RGB and normalize to 0-1 range
|
| 1026 |
+
pixels = np.array(img.convert("RGB")) / 255.0
|
| 1027 |
+
# Grid parameters
|
| 1028 |
+
grid_size = 8
|
| 1029 |
+
box_size = 512 // grid_size # 64 pixels per box
|
| 1030 |
+
step = box_size // lut_size # 8 pixels per step
|
| 1031 |
+
# Write the .cube file
|
| 1032 |
+
with open(output_cube_path, "w") as f:
|
| 1033 |
+
f.write('# Charles Fettinger 3D LUT from 8x8 PNG (inverted)\n')
|
| 1034 |
+
f.write('TITLE "Converted 8x8x8 LUT (inverted)"\n')
|
| 1035 |
+
f.write(f'LUT_3D_SIZE {lut_size}\n')
|
| 1036 |
+
f.write('DOMAIN_MIN 0.0 0.0 0.0\n')
|
| 1037 |
+
f.write('DOMAIN_MAX 1.0 1.0 1.0\n')
|
| 1038 |
+
for b in range(lut_size):
|
| 1039 |
+
for g in range(lut_size):
|
| 1040 |
+
for r in range(lut_size):
|
| 1041 |
+
box_row = b
|
| 1042 |
+
box_col = g
|
| 1043 |
+
box_x = box_col * box_size
|
| 1044 |
+
box_y = box_row * box_size
|
| 1045 |
+
x = box_x + r * step + step // 2
|
| 1046 |
+
y = box_y + g * step + step // 2
|
| 1047 |
+
# Sample from the rotated position
|
| 1048 |
+
x_rev = 511 - x
|
| 1049 |
+
y_rev = 511 - y
|
| 1050 |
+
rgb = pixels[y_rev, x_rev]
|
| 1051 |
+
f.write(f"{rgb[0]:.6f} {rgb[1]:.6f} {rgb[2]:.6f}\n")
|
| 1052 |
+
print(f"Inverted 3D LUT conversion complete. Saved to {output_cube_path}")
|
| 1053 |
+
|
| 1054 |
############################################# RGBA ###########################################################
|
| 1055 |
def convert_rgb_to_rgba_safe(image: Image) -> Image:
|
| 1056 |
"""
|
requirements.txt
CHANGED
|
@@ -4,7 +4,7 @@ git+https://github.com/huggingface/accelerate.git
|
|
| 4 |
safetensors
|
| 5 |
sentencepiece
|
| 6 |
git+https://github.com/huggingface/peft.git
|
| 7 |
-
Pillow>=11.
|
| 8 |
numpy
|
| 9 |
tiktoken
|
| 10 |
pycairo
|
|
|
|
| 4 |
safetensors
|
| 5 |
sentencepiece
|
| 6 |
git+https://github.com/huggingface/peft.git
|
| 7 |
+
Pillow>=11.1.0
|
| 8 |
numpy
|
| 9 |
tiktoken
|
| 10 |
pycairo
|
style_20250314.css
CHANGED
|
@@ -20,7 +20,7 @@
|
|
| 20 |
background-color: rgba(242, 218, 163, 0.62);
|
| 21 |
}
|
| 22 |
|
| 23 |
-
.dark .gradio-container.gradio-container-5-
|
| 24 |
background-color: rgba(41, 18, 5, 0.38) !important;
|
| 25 |
}
|
| 26 |
|
|
|
|
| 20 |
background-color: rgba(242, 218, 163, 0.62);
|
| 21 |
}
|
| 22 |
|
| 23 |
+
.dark .gradio-container.gradio-container-5-22-0 .contain .intro {
|
| 24 |
background-color: rgba(41, 18, 5, 0.38) !important;
|
| 25 |
}
|
| 26 |
|