Skip to content

Instantly share code, notes, and snippets.

View Iunius118's full-sized avatar

iunius118 Iunius118

View GitHub Profile
@Iunius118
Iunius118 / gimp_autosave.py
Last active June 23, 2022 14:25
Auto save plug-in for GIMP [2.8, 2.10]
#!/usr/bin/env python
# Original (by yahvuu): https://www.gimpusers.com/forums/gimp-developer/11718-autosave-plugin
import tempfile
import os
from time import *
from gimpfu import *
def autosave(image, layer):
# Backup interval in seconds (600 = 10 minutes)
@Iunius118
Iunius118 / marge_alpha.py
Last active January 8, 2022 10:55
Merge alpha channel from an image to another image (OpenCV is required)
import argparse
import cv2
def main():
args = parse_args()
alpha, img = read_images(args)
new_img = marge_alpha(args, alpha, img)
write_image(args, new_img)
def parse_args():
@Iunius118
Iunius118 / get_structure_nbt_block_list.py
Last active June 30, 2021 14:24
Output the list of block IDs and quantities from a structure .nbt file.
import sys
# Requires Python-NBT
# pip install Python-NBT
import python_nbt.nbt as nbt
def main():
nbt_file = open_file()
block_list = count_blocks(nbt_file)
output_block_list(block_list)