Skip to content

Instantly share code, notes, and snippets.

@jedypod
jedypod / opusencdir
Created August 2, 2020 21:17
opusencdir is a Python tool to recursively encode contents of source directory into Opus audio files.
#!/usr/bin/python3
import os, sys, re, shutil
import logging
import threading
import concurrent.futures
import multiprocessing
import argparse, shlex
@jedypod
jedypod / aftershot3_enable_dng_support.md
Last active October 17, 2020 15:19
Enable Adobe DNG Support in Corel AfterShot Pro 3

Enable DNG Support for Your Camera in Corel AfterShot Pro 3

AfterShot 3 does not support DNG files well, despite their claims to the contrary.

What if we need to use DNG files in our photo collection? There are valid reasons to need this, for example if you use Magic Lantern Dualiso raw files on your Canon camera and you need to use the DNG format to store the raw image after blending the exposures.

AfterShot does open DNG files if certain conditions are met. If you have specific supported cameras, AfterShot will open DNG files, but only if it has the right compression settings and metadata. The DNG file has to be uncompressed, and it must contain the Exif.Image.Model metadata matching a "known" camera.

Hack Your Own Camera Profile

  1. On the Aftershot Downloads Page there are AfterShot Pro Camera Profiles available for download.
@jedypod
jedypod / Distort.cpp
Created October 19, 2020 19:59
Distorts an input image based on an input uv map or vector map.
kernel Distort : ImageComputationKernel<ePixelWise> {
Image<eRead, eAccessRandom, eEdgeClamped> in;
Image<eRead, eAccessPoint, eEdgeClamped> uv;
Image<eWrite, eAccessPoint> out;
param:
bool stmap;
bool enable_blur;
float blur_size;
int blur_samples;
@jedypod
jedypod / BoxBlur.cpp
Created October 19, 2020 20:04
Perform a multiple iteration box blur on the input image. Works in a single dimension so 2 copies are needed for a 2 dimensional blur.
/* Perform a horizontal or vertical Box Blur
Can perform multiple iterations in order to approximate a Gaussian Blur.
*/
kernel BoxBlur : ImageComputationKernel<eComponentWise> {
Image<eRead, eAccessRandom, eEdgeClamped> src;
Image<eReadWrite, eAccessRandom, eEdgeClamped> dst;
param:
float2 size; // blur size
int iterations; // number of iterations to perform
@jedypod
jedypod / SummedAreaTable.cpp
Last active October 19, 2020 20:10
Perform a spatially varying box blur based on an input map. Box blur only for the moment. Uses a summed area table.
/* Create a summed area table in one direction, based on an input image.
In order to create a 2-dimensional summed area table,
you need two copies of the node, the 2nd with col=true
Currently there are issues with precision for higher resolution images...
*/
kernel SummedAreaTable : ImageComputationKernel<eComponentWise> {
Image<eRead, eAccessRandom, eEdgeConstant> src;
Image<eReadWrite, eAccessRandom> dst;
@jedypod
jedypod / hidden_input_handler.py
Last active November 12, 2020 10:38
Python tool to enhance the default behavior when copying / cutting and pasting nodes with hidden inputs. Instead of the pasted copy becoming disconnected, the node with the hidden input is connected to the node that the original was connected to.
import nuke, nukescripts, os
'''
## Hidden Input Handler
# Add these lines to your menu.py:
import hidden_input_handler
nuke.toolbar('Nodes').addCommand('Other/PostageStamp', 'hidden_input_handler.create()', 'alt+shift+p')
nuke.menu("Nuke").addCommand('Edit/Cut', lambda: hidden_input_handler.cut(), 'ctrl+x')
This file has been truncated, but you can view the full file.
@jedypod
jedypod / README.md
Created February 21, 2020 17:00
Nuke Python script to retime selected Roto, RotoPaint. or SplineWarp nodes.

Retime Roto

This is a python script for Nuke to retime roto shapes. It supports shapes only, not strokes, not opensplines.

It works by looping through each roto node, each shape in the roto node, and each point on the shape. It creates an expression on each point referencing a frame_lookup knob. Put a retime curve on this knob and your shapes will be retimed.

@jedypod
jedypod / photo_autoexpose.py
Last active November 24, 2021 06:08
Python script using OpenImageIO to automatically expose scene linear aces ap0 openexr source files and render into jpeg
import OpenImageIO as oiio
from OpenImageIO import ImageInput, ImageOutput
from OpenImageIO import ImageBuf, ImageSpec, ImageBufAlgo
import os, sys
import shlex, subprocess
import glob
#--------------------------------------------