コード例 #1
0
def sketchy_large(image_path, path, color):

    im = Image.open(image_path)
    im = im.resize((1000,1000), Image.ANTIALIAS)
    im.save(image_path)

    sketchy.draw(image_path,            # input
                path,                   # output
                2,                      # nibsize (line size in output svg)
                100,                    # max line length
                color,                  # line color
                1.06,                   # scaling factor
                1,                      # line size (internal line size for calculations)
                820,975,0.3            # signature transform
                )
コード例 #2
0
def sketchy_pen_a3_landscape(image_path, path, color):

    im = Image.open(image_path)
    im = im.resize((1000,572), Image.ANTIALIAS)
    im.save(image_path)

    sketchy.draw(image_path,            # input
                path,                   # outputsketchy_pen_a3
                2,                      # nibsize (line size in output svg)
                100,                    # max line length
                color,                  # line color
                0.34,                   # scaling factor
                1,                      # line size (internal line size for calculations)
                830, 550, 0.3           # signature transform
                )
コード例 #3
0
def sketchy_extra_large(image_path, path, color):

    im = Image.open(image_path)
    im = im.resize((1390,1390), Image.ANTIALIAS)
    im.save(image_path)

    sig_scale = 1.0/1.39

    sketchy.draw(image_path,            # input
                path,                   # output
                2,                      # nibsize (line size in output svg)
                100,                    # max line length
                color,                  # line color
                1.00,                   # scaling factor
                1,                      # line size (internal line size for calculations)
                1225, 1370, 0.3   # signature transform
                )
コード例 #4
0
def sketchy_pen_a3(image_path, path, color):

    im = Image.open(image_path)
    im = im.resize((1000, 1000), Image.ANTIALIAS)
    im.save(image_path)

    sketchy.draw(
        image_path,  # input
        path,  # output
        3,  # nibsize (line size in output svg)
        100,  # max line length
        color,  # line color
        0.21,  # scaling factor
        # line size (internal line size for calculations)
        1,
        730,
        970,
        0.5  # signature transform
    )
コード例 #5
0
def sketchy_small(image_path, path, color):

    im = Image.open(image_path)
    im = im.resize((500, 500), Image.ANTIALIAS)
    im.save(image_path)

    sketchy.draw(
        image_path,  # input
        path,  # output
        2,  # nibsize (line size in output svg)
        100,  # max line length
        color,  # line color
        1.00,  # scaling factor
        # line size (internal line size for calculations)
        1,
        380,
        500,
        0.2  # signature transform
    )
コード例 #6
0
import sys, getopt
from blackstripes import sketchy

outputFile = "/mnt/c/Users/Dave"
inputFile = "/mnt/c/Users/Dave"
nibSize = 2
color = "#000000"
scale = 1
levels = [180, 108, 180, 108]
lineSize = 2
maxLineLength = 100
argv = sys.argv[1:]
opts, args = getopt.getopt(argv, "i:o:n:f:s:l:m:")
for opt, arg in opts:
    if opt == "-i":
        inputFile = inputFile + '/{}'.format(arg)
    if opt == "-o":
        outputFile = outputFile + '/{}'.format(arg)
    if opt == "-n":
        nibSize = int(arg)
    if opt == "-f":
        color = arg
    if opt == "-s":
        scale = float(arg)
    if opt == "-l":
        lineSize = int(arg)
    if opt == "-m":
        maxLineLength = int(arg)
sketchy.draw(inputFile, outputFile, nibSize, maxLineLength, color, scale,
             lineSize, 0, 0, 0.0)
コード例 #7
0
from blackstripes import sketchy

sketchy.draw("ali.png",   # input
             "ali_sketchy.svg",          # output
             1,                          # nibsize (line size in output svg)
             100,                        # max line length
             "#000000",                  # line color
             0.32,                       # scaling factor
             1,                          # line size (internal line size for calculations)
             540, 1021, 0.7              # signature transform tx, ty, scale
            )
コード例 #8
0
from blackstripes import sketchy

sketchy.draw("tini.png",   # input
             "tini_sketchy.svg",          # output
             1,                          # nibsize (line size in output svg)
             100,                        # max line length
             "#000000",                  # line color
             0.32,                       # scaling factor
             # line size (internal line size for calculations)
             1,
             1000, 1000, 0.7              # signature transform tx, ty, scale
             )