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
def getCropRectangle(node): | |
width, height = node.width(), node.height() | |
xMin = width | |
xMax = 0 | |
yMin = height | |
yMax = 0 | |
for x in range(width): | |
for y in range(height): | |
if node.sample("alpha", x, y) != 0: |
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
knob = nuke.toNode("Camera_Color_Profiling.cameraColorProfiling_ColorMatrix").knob("outputColorSpace_pulldownChoice") | |
knob.setExpression("parent.outputColorSpace_pulldownChoice", 0) |
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
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.5-c002 1.148022, 2012/07/15-18:06:45 "> | |
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | |
<rdf:Description rdf:about="" | |
xmlns:tiff="http://ns.adobe.com/tiff/1.0/" | |
xmlns:exif="http://ns.adobe.com/exif/1.0/" | |
xmlns:aux="http://ns.adobe.com/exif/1.0/aux/" | |
xmlns:xmp="http://ns.adobe.com/xap/1.0/" | |
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" | |
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" | |
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" |
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
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> | |
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.5-c002 1.148022, 2012/07/15-18:06:45 "> | |
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | |
<rdf:Description rdf:about="" | |
xmlns:aux="http://ns.adobe.com/exif/1.0/aux/" | |
xmlns:xmp="http://ns.adobe.com/xap/1.0/" | |
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" | |
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" | |
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" | |
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" |
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
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> | |
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.5-c002 1.148022, 2012/07/15-18:06:45 "> | |
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | |
<rdf:Description rdf:about="" | |
xmlns:aux="http://ns.adobe.com/exif/1.0/aux/" | |
xmlns:xmp="http://ns.adobe.com/xap/1.0/" | |
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" | |
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" | |
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" | |
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" |
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
from PIL import Image | |
width, height = 256, 32 | |
image = Image.new("RGB", (width, height)) | |
pixels = image.load() | |
for i in range(image.size[0]): | |
for j in range(image.size[1]): | |
pixels[i,j] = (i, i, i) | |
image.save("Linear_Ramp.png", "PNG") |
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
artAttrInitPaintableAttr; | |
artBlendShapeTargetIndex; | |
artAttrBlendShapeValues artAttrBlendShapeContext; | |
artAttrUpdatePaintValueSlider artAttrCtx; | |
artAttrBlendShapeValues artAttrBlendShapeContext; | |
artAttrPaintOperation artAttrCtx Scale; | |
artAttrBlendShapeValues artAttrBlendShapeContext; | |
artAttrCtx -e -value -1.0 `currentCtx`; | |
artAttrCtx -e -clear `currentCtx`; | |
artAttrPaintOperation artAttrCtx Add; |
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
import math | |
diagonal = lambda w, h: math.sqrt(w ** 2 + h ** 2) | |
wr = 36. # Reference 24mm * 36mm sensor. | |
hr = 24. | |
dr = diagonal(wr, hr) | |
w = 7.6 # Current sensor: http://en.wikipedia.org/wiki/Image_sensor_format | |
h = 5.7 |
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
BACKGROUND_CODES = (("bBlack", "40m"), | |
("bRed", "41m"), | |
("bGreen", "42m"), | |
("bYellow", "43m"), | |
("bBlue", "44m"), | |
("bPurple", "45m"), | |
("bCyan", "46m"), | |
("bWhite", "47m"), | |
("bHighBlack", "100m"), | |
("bHighRed", "101m"), |
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
# PyCharm will complain the the parameters are missing in docstrings with | |
# Numpy style docstrings. | |
def XYZ_to_CIECAM02(XYZ, | |
XYZw, | |
LA, | |
Yb, | |
surround=CIECAM02_VIEWING_CONDITIONS.get( | |
'Average'), | |
discount_illuminant=False): | |
""" |