13
Oct

There are many programs/services can do it.
tiling
I just put one way here.

It is from Jos Van Eijndhoven. The method is using python to split a big image into smaller ones.

The original code is

#! /usr/bin/python
import Image, ImageDraw, ImageFont
im = Image.open("input.png")
ni = 4
nj = 4
imarging = 40
jmarging = 40

width=(im.size[0] + (ni-1) * 2 * imarging) / ni
height=(im.size[1] + (nj-1) * 2 * jmarging) / nj
iincr=width - 2 * imarging
jincr=height - 2 * jmarging

f = ImageFont.truetype("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf", 25)

for i in xrange(ni):
    for j in xrange(nj):
        ipos = iincr * i
        jpos = jincr * j
        box = (ipos, jpos, ipos + width, jpos + height)
        print box
        thumb = im.crop(box)
        d = ImageDraw.Draw(thumb)
        d.text( (5,0), str(j+1) + ',' + str(i+1), font=f, fill='blue')
        thumb.save( '/tmp/im' + str(i) + '_' + str(j) + '.png' )

then using convert from ImageMagick package to generate pdf files for printing

convert -units PixelsPerInch -density 160x160 /tmp/im*.png output.pdf

For me, I use a slightly different code in Windows

#! /usr/bin/python
# a large image tiled on 25 pages
import Image, ImageDraw, ImageFont, os
im = Image.open("input.jpg")
ni = 5
nj = 5
# i - width; j - height
imarging = 25
jmarging = 12

width=(im.size[0] + (ni-1) * 2 * imarging) / ni
height=(im.size[1] + (nj-1) * 2 * jmarging) / nj
iincr=width - 2 * imarging
jincr=height - 2 * jmarging

f = ImageFont.truetype("C:\Windows\Fonts\Arial.ttf", 12)

os.makedirs("tiling")

for i in xrange(ni):
    for j in xrange(nj):
        ipos = iincr * i
        jpos = jincr * j
        box = (ipos, jpos, ipos + width, jpos + height)
        print box
        thumb = im.crop(box)
        d = ImageDraw.Draw(thumb)
        d.text( (5,0), str(j+1) + ',' + str(i+1), font=f, fill='blue')
        thumb.save( './tiling/im' + str(i) + '_' + str(j) + '.jpg' )

And, I use Adobe Acrobat to generate the pdf files.

Leave a Reply