Last active
November 10, 2021 17:04
-
-
Save kwolbachia/0060272e477165ac34d7c0787f8a5860 to your computer and use it in GitHub Desktop.
generates a full LUT from part of an existing one. Offrande au grand manitou des LUTs!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Kevin Terretaz @kwolbachia 10.11.21 | |
// open the LUT you want to transform as a 256x32 8bit image | |
// run the macro | |
run("Select All"); | |
waitForUser("adjust the selection to crop"); | |
setBatchMode(1); | |
run("Duplicate...","duplicate"); | |
run("RGB Color"); | |
run("Scale...", | |
"x=- y=- width=256 height=65 interpolation=Bicubic average create"); | |
R = newArray(1); G = newArray(1); B = newArray(1); | |
for (i = 0; i < 256; i++) { | |
c = getPixel(i, 2); | |
R[i] = (c>>16)&0xff; G[i] = (c>>8)&0xff; B[i] = c&0xff; | |
} | |
newImage("new LUT", "8-bit ramp", 256, 32, 1); | |
setLut(R, G, B); | |
setBatchMode(0); |
Author
kwolbachia
commented
Nov 10, 2021
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment