yoonsikp / pycubelut

Tool for Applying Adobe Cube LUTs to Images
MIT License
92 stars 18 forks source link

Read LUTs in .png format #2

Closed Nerdyvedi closed 4 years ago

Nerdyvedi commented 4 years ago

Hi, The code you have added works to read LUTs in .cube format. Could you let me know how we can read LUTs in .png format. Sorry if it's a silly question, I have very little experience in working with LUTs.

yoonsikp commented 4 years ago

If you have a HALD Cube LUT, you could try this website: http://www.onlinelutcreator.com

If you have a LUT like this you'll need to get the dimensions of the png e.g. 512x512, and multiply them and then do a cube root to get the dimensions. (512x512)^(1/3) = 64. So your dimensions are 64x64x64. Then print out every RGB value scaled to [0,1], left to right, top to bottom.

LUT_3D_SIZE 64
# first value
0 0 0
0.01 0.02 0.03
...
# value 262144
1 1 1

It's a very simple spec:

https://wwwimages2.adobe.com/content/dam/acom/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf