This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>HSV Display-P3 Background</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <style> | |
| html, | |
| body { |
This file contains hidden or 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
| # this script generates a high pass convolution kernel that we can apply on | |
| # white noise to get something close to blue noise. check out the relevant | |
| # shader in the link below. | |
| # https://www.shadertoy.com/view/l3dBRf | |
| import numpy as np | |
| from scipy.signal import convolve2d | |
| np.set_printoptions(precision=7, linewidth=80000, suppress=True) |
This file contains hidden or 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 numpy as np | |
| import scipy.signal | |
| np.set_printoptions(precision=7, linewidth=80000, suppress=True) | |
| # create NxN matrix (N must be a positive odd integer) | |
| N = 11 | |
| k = np.zeros((N, N), dtype=np.float32) | |
| # generate gaussian kernel |
This file contains hidden or 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
| vec3 bean_non_photorealistic( | |
| vec3 normal, // must be normalized | |
| vec3 view_dir, // must be normalized | |
| vec3 light_dir, // must be normalized | |
| vec3 light_col, | |
| vec3 albedo, | |
| float roughness, | |
| float metallic | |
| ) | |
| { |
This file contains hidden or 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 numpy as np | |
| # https://www.colour-science.org/ | |
| import colour | |
| np.set_printoptions(precision=10, floatmode='fixed', suppress=True) | |
| print(f'mat_bt2020_to_xyz:\n{colour.models.RGB_COLOURSPACE_BT2020.matrix_RGB_to_XYZ}\n') | |
| print(f'mat_xyz_to_bt2020:\n{colour.models.RGB_COLOURSPACE_BT2020.matrix_XYZ_to_RGB}\n') | |
| print(f'mat_bt709_to_xyz:\n{colour.models.RGB_COLOURSPACE_BT709.matrix_RGB_to_XYZ}\n') | |
| print(f'mat_xyz_to_bt709:\n{colour.models.RGB_COLOURSPACE_BT709.matrix_XYZ_to_RGB}\n') |
This file contains hidden or 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
| // Original: | |
| // https://gist.github.com/kimwalisch/c8c40c5505d1b2e2c9389b09ae48f306 | |
| // Fork: | |
| // https://gist.github.com/bean-mhm/ff249cc45ed179b4ed59b9e1afd363f4 | |
| #pragma once | |
| #include <cassert> | |
| #include <cstdint> |
This file contains hidden or 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 numpy as np | |
| # https://www.colour-science.org/ | |
| import colour | |
| mat_bt2020_to_xyz = colour.models.RGB_COLOURSPACE_BT2020.matrix_RGB_to_XYZ | |
| mat_xyz_to_bt709 = colour.models.RGB_COLOURSPACE_BT709.matrix_XYZ_to_RGB | |
| mat_bt2020_to_bt709 = np.matmul( |
This file contains hidden or 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
| # python -m pip install --upgrade pywin32 | |
| # pip install pyautogui | |
| import win32con, ctypes, ctypes.wintypes | |
| import pyautogui | |
| from datetime import datetime | |
| # Your Windows username (to determine the desktop path) | |
| windows_username = 'user' |