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
#!/usr/bin/python | |
# untile a dzsave --layout dz level | |
# tiles are expected to be named as ARG/x_y.jpeg, so use as: | |
# | |
# untile-dz.py ~/pics/somepyramid_files/11 out.jpg | |
# | |
# to make out.jpg, level 4 of somepyramid reassembled | |
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
#!/usr/bin/python | |
# untile a dzsave --layout google level | |
# tiles are expected to be named as ARG/y/x.jpg, so use as: | |
# | |
# untile-google.py ~/pics/somepyramid/4 out.jpg | |
# | |
# to make out.jpg, level 4 of somepyramid reassembled | |
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
#!/usr/bin/python | |
import sys | |
R = int(sys.argv[1]) | |
G = int(sys.argv[2]) | |
B = int(sys.argv[3]) | |
# assume RGB are 0 - 255 ... convert to 0 - 1 | |
R /= 255.0 |
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
#!/usr/bin/env python | |
import sys | |
import gi | |
gi.require_version('Vips', '8.0') | |
from gi.repository import Vips | |
# this makes vips report peak mem use on exit | |
Vips.leak_set(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
#!/usr/bin/env python | |
import sys | |
import gi | |
gi.require_version('Vips', '8.0') | |
from gi.repository import Vips | |
# this makes vips report peak mem use on exit | |
Vips.leak_set(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
#!/usr/bin/python | |
import sys | |
from gi.repository import Vips | |
snow = Vips.Image.new_from_file("SnowStorm.png") | |
bg = Vips.Image.new_from_file(sys.argv[1]) | |
# stretch snow image to fit over background |
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
#!/usr/bin/env python | |
import os | |
import numpy as np | |
import shutil | |
import tempfile | |
import itertools | |
import logging | |
import argparse | |
from gi.repository import Vips |
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
#!/usr/bin/python | |
import csv | |
import sys | |
# we store a hash from name to list of phone numbers | |
name_table = {} | |
# for all command-line arguments | |
for filename in sys.argv[1:]: |
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
#!/usr/bin/python | |
# smartcrop with libvips, based very roughly on | |
# http://stackoverflow.com/a/1517178/894763 | |
import sys | |
from gi.repository import Vips | |
image = Vips.Image.new_from_file(sys.argv[1]) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# This file is part of the Z9 Slide Imaging & Analysis Platform. | |
# Copyright (C) 2015 Jonas Ogaard | |
# | |
# Z9 is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |