Home > Uncategorized > Image tiling for poster printing

Image tiling for poster printing

Here is what I tried to print a large image (6000×4000 px) tiled on 16 A4 pages.

Jos van Eijndhoven poster

convert oisan2.png eps:- | poster -c2% -p111.76x68.58cm | ps2pdf - output2.pdf

It works but need one hour to  do the conversion. I guess it’s because it work on a Postscript file.

pdfposter

It’s fast but it does not manage overlap. This is something I really need.

A tiling script with Python imaging.

#! /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 with ImageMagick:

convert -units PixelsPerInch -density 160x160 /tmp/im*.png output.pdf
Advertisements
  1. June 13, 2010 at 22:10

    Cool simple script. Note Pdfposter does do overlap…I think. Look in the patch provided here: http://pdfposter.origo.ethz.ch/node/39.

    Also can you maybe mock up an html interface for your simple script and provide alternatives to using imagemagick, for instance using gd in PHP?

  2. June 21, 2010 at 16:12

    Thanks for the patch Paul. This worked like a charm for me!

  1. May 16, 2012 at 07:29
  2. July 7, 2012 at 19:53

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: