gregcotten / pylut Goto Github PK
View Code? Open in Web Editor NEWCreate and Modify 3D LUTs in Python!
License: MIT License
Create and Modify 3D LUTs in Python!
License: MIT License
I get the following error when I try to combine LUTs
lut = LUT.FromCubeFile("C:/Users/Junnu/Desktop/LUT1.cube")
lut2 = LUT.FromCubeFile("C:/Users/Junnu/Desktop/LUT2.cube")
lut3 = lut.CombineWithLUT(lut2)
Traceback (most recent call last):
File "<pyshell#5>", line 1, in
lut3 = lut.CombineWithLUT(lut2)
File "C:\Python27\lib\site-packages\pylut\pylut.py", line 279, in CombineWithLUT
newLattice[x, y, z] = otherLUT.ColorFromColor(selfColor)
File "C:\Python27\lib\site-packages\pylut\pylut.py", line 418, in ColorFromColor
return self.ColorAtInterpolatedLatticePoint(color.r * (cubeSize-1), color.g * (cubeSize-1), color.b * (cubeSize-1))
File "C:\Python27\lib\site-packages\pylut\pylut.py", line 451, in ColorAtInterpolatedLatticePoint
C010 = self.ColorAtLatticePoint(lowerRedPoint, lowerGreenPoint, upperBluePoint)
File "C:\Python27\lib\site-packages\pylut\pylut.py", line 429, in ColorAtLatticePoint
return self.lattice[redPoint, greenPoint, bluePoint]
IndexError: only integers, slices (:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices
Here are the cube LUT files I used
Desktop.zip
I was getting pylut 1.4.9 via pycharm venv, and works under python 3.6.5.
I have converted old print and xrange statements to python 3 version.
It seems that all of the From and To methods suffer from improper indices now, where they should be floored but was left as float. Since numpy no longer support float indices, I guess encapsulating with a int() will solve the problem.
Also I was trying this module with photoshop original LUTs, some nuke3DL file has entries that goes up to 12-bit color depth, but the first row ends with 1023, which by the FromNuke3DLFile() method should imply 10-bit depth and will lead to a lattice being 4 times brighter than the file was originally intended.
I think the correct outputDepth should actually be +2, but am not sure whether it is a common problem or not.
Fails with python-3 (current latest pypi version 1.4.9)
File "[...]/bin/pylut", line 83
print "Warning: reverse can take a long time."
^
SyntaxError: Missing parentheses in call to 'print'
https://gist.github.com/andrewfinch/7801858
Traceback (most recent call last):
File "/usr/local/bin/pylut", line 82, in <module>
lut, filetype = LUTFromFile(filePath)
File "/usr/local/bin/pylut", line 37, in LUTFromFile
lut = LUT.FromNuke3DLFile(lutFilePath)
File "/Library/Python/2.7/site-packages/pylut/pylut.py", line 386, in FromNuke3DLFile
outputDepth = int(math.log(int(lutFileLines[meshLineIndex].split()[-1])+1,2))
IndexError: list index out of range
even i have installed in the environment, but it gives the error 'name pylut is not defined'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.