_ctx
except (NameError):
    NB = False

if NB:
    size(W, H)
    pb = ximport("photobot")
else:
    WIDTH, HEIGHT = W, H
    import photobot as pb

if kwdbg:
    # make random choices repeatable for debugging
    rnd.seed(8)

imagewell = pb.loadImageWell(resultfile="imagewell-files")
tiles = imagewell['landscape']
rnd.shuffle(tiles)

img1path = tiles.pop()
img2path = tiles.pop()

# create the canvas
c = pb.canvas(int(WIDTH), int(HEIGHT))
c.fill((255, 255, 255))

imsize = int((WIDTH - 30) / 2)
x, y = 10, 10
img1, w1, h1 = pb.placeImage(c, img1path, x, y, imsize, "image1")
pb.label(c, "Original Image", x, y)
示例#2
0
    size(W, H)
    background(0.333)
except NameError:
    import photobot as pb
    WIDTH, HEIGHT = W, H
    print("File: %s" % (__file__, ))
RATIO = WIDTH / HEIGHT

# load the image library
# check for command line folders
additionals = sys.argv[1:]

# get all images from user image wells
imagewell = pb.loadImageWell(bgsize=(WIDTH, HEIGHT),
                             minsize=(256, 256),
                             pathonly=True,
                             additionals=additionals,
                             resultfile="imagewell-files",
                             ignoreFolderNames=('+offline', ))

# tiles are images >256x256 and <=WIDTH, HEIGHT
tiles = imagewell['tiles']

# backgrounds are images >W,H
backgrounds = imagewell['backgrounds']

print("tiles: %i" % len(tiles))
print("backgrounds: %i" % len(backgrounds))

# create the canvas
c = pb.canvas(WIDTH, HEIGHT)
c.fill((85, 85, 85))
    _ctx
except (NameError):
    NB = False

if NB:
    size(W, H)
    pb = ximport("photobot")
else:
    WIDTH, HEIGHT = W, H
    import photobot as pb

if kwdbg:
    # make random choices repeatable for debugging
    rnd.seed(8)

imagewell = pb.loadImageWell(resultfile="imagewell-files",
                             ignoreFolderNames=('+offline', ))

tiles = imagewell['landscape']
rnd.shuffle(tiles)

# pick 2 images
img1path = tiles.pop()
img2path = tiles.pop()

# create a white canvas
c = pb.canvas(WIDTH, HEIGHT)
c.fill((192, 192, 192))

#
# Image 1
#
示例#4
0
    _ctx
except (NameError):
    NB = False

if NB:
    size(W, H)
    pb = ximport("photobot")
else:
    WIDTH, HEIGHT = W, H
    import photobot as pb

if kwdbg:
    # make random choices repeatable for debugging
    rnd.seed(8)

imagewell = pb.loadImageWell()
tiles = imagewell['landscape']
rnd.shuffle(tiles)

# pick 2 images
img1path = tiles.pop()
img2path = tiles.pop()

# create a white canvas
c = pb.canvas(WIDTH, HEIGHT)
c.fill((192, 192, 192))

#
# Image 1
#
示例#5
0
    reload(pb)
    size(W, H)
    background(0.333)
except NameError:
    import photobot as pb
    WIDTH, HEIGHT = W, H
RATIO = WIDTH / HEIGHT

# load the image library
# check for command line folders
additionals = sys.argv[1:]

# get all images from user image wells
imagewell = pb.loadImageWell(bgsize=(1024, 768),
                             minsize=(256, 256),
                             pathonly=True,
                             additionals=additionals,
                             ignorelibs=True)

# tiles are images >256x256 and <=1024x768
# pp(imagewell['fractions'])
tiles = imagewell['allimages']

print("tiles: %i" % len(tiles))

# CONFIGURATION
# A4 = 210mm x 297mm
# 150 dots/inch ~ 60 dots/cm --> 6 dots / mm

dpmm = 6