Skip to content

Instantly share code, notes, and snippets.

@pjessesco
pjessesco / reduced_peanut_example.cpp
Created July 31, 2022 12:24
Single-file reduced Peanut example for blog
//
// This software is released under the MIT license.
//
// Copyright (c) 2022 Jino Park (http://github.com/pjessesco)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@pjessesco
pjessesco / image_viewer.py
Created February 15, 2021 08:28
Python full-screen image viewer using PyQT5, without white board which appears in `cv2.imshow()`
# Reference : https://stackoverflow.com/a/59539843
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import QObject, pyqtSignal
import sys
import time
import threading
@pjessesco
pjessesco / differential_rendering.py
Created January 15, 2021 01:28
Differential Rendering (Deb98) for Mitsuba 2
# Differential rendering (Deb98) script for mitsuba2
import mitsuba
mitsuba.set_variant('scalar_rgb')
from mitsuba.core import Thread, Float, Color3f
from mitsuba.core.xml import load_file
from mitsuba.python.util import traverse
import pyexr
import numpy as np
import pyexr
import numpy as np
if __name__ == '__main__':
shift_coords = [[]]
path = "path_to_exr.exr"
img = pyexr.read(path)