- Get all of these files into the target folder
- Run the following commands:
chmod +x *.sh
./nginx-start.sh
chmod +x *.sh
./nginx-start.sh
#!/usr/bin/python | |
import sys | |
from gi.repository import Vips | |
N_BINS = 10 | |
BIN_SIZE = 256 / N_BINS | |
im = Vips.Image.new_from_file(sys.argv[1], access = Vips.Access.SEQUENTIAL) |
#!/usr/bin/python | |
import sys | |
from gi.repository import Vips | |
im = Vips.Image.new_from_file(sys.argv[1], access = Vips.Access.SEQUENTIAL) | |
text = Vips.Image.text(sys.argv[3], width = 500, dpi = 300) | |
text = (text * 0.3).cast("uchar") | |
text = text.embed(100, 100, text.width + 200, text.width + 200) |
#!/usr/bin/env python | |
import sys | |
from gi.repository import Vips | |
# An equivalent of ImageMagick's -trim in pyvip8 ... automatically remove | |
# "boring" image edges. | |
# We use .project to sum the rows and columns of a 0/255 mask image, the first |
#!/usr/bin/python | |
import sys | |
from gi.repository import Vips | |
image = Vips.Image.new_from_file(sys.argv[1]) | |
# get the alpha | |
alpha = image[3] |
#!/usr/bin/env python | |
import sys | |
import gi | |
gi.require_version('Vips', '8.0') | |
from gi.repository import Vips | |
# load the array from the file |
#!/usr/bin/python | |
import sys | |
import json | |
from gi.repository import Vips | |
def cut_image(im, json_data, debug = False): | |
# Coordinates are stored in json format as list of x/y-coords | |
# [[x0,y0],[x1,y1],...,[xn,yn]] |
#!/usr/bin/python | |
# smartcrop with libvips, based very roughly on | |
# https://github.com/jwagner/smartcrop.js | |
import sys | |
import gi | |
gi.require_version('Vips', '8.0') | |
from gi.repository import Vips |
#!/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. | |
# |
#!/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. | |
# |