10

I have multiple .png files (for example: pic_001.png, pic_002.png... pic_200.png). These are basically separate pages of the book.

I want to create a single printing job, that will print 2 such pictures per one physical page, so it would look like a usual book spread.

I've tried to do this like this:

lp pic_001.png pic_002.png pic_003.png pic_004.png -d color-printer-1 -o sides=one-sided -o number-up=2 

but it was printing only 1 picture per 1 page.

The same result with the for-loop:

for i in `seq 1 2 8`; do lp pic_00$i.png pic_00$[$i + 1].png -d color-printer-1 -o sides=one-sided -o number-up=2; done 

but also this creates separate jobs per pair of pictures.

4 Answers 4

5

Alternative method to the accepted answer is to use ImageMagick montage command which allows additional flexibility when defining the grid (tile) size:

montage -tile 1x2 -mode concatenate *.png page.png 

The command will generate several page-*.png collages for each set of input files which fit on a single page.

1
  • 1
    add "-geometry +1+1" to get decent spacing between images Commented May 14, 2022 at 16:47
4

Rather than use lp directly, you could try using imageMagick, to make one image out of two or more images, and then print them

convert image1.png image2.png image3.pgn -append output.png 

will put the images one above the other. If you replace -append by +append, the images will be side-by-side instead.

3

Starting with

Initial image

To print one image multiple times set the file name.

terminal-where-image-is$ x="one_image.png" 

To print different images "montaged" together on one page skip the above step and type them in below.

With ImageMagick installed; run

terminal-where-image-is$ montage -tile 2x4 -mode concatenate $x $x $x $x $x $x $x $x -border 1 page.png 

which gives

Multiple images

Note:you can change the border number to get bigger or small borders, you can change the tile arrangement to get different row column configuration.

To print, (using lp)

  1. List your printer options with

    terminal-where-image-is$ lpstat -p -d 
  2. Set printer with

    terminal-where-image-is$ lpoptions -d printer_name 
  3. Optional: to set PPI (pixels per inch) equal to the actual image property PPI

    terminal-where-image-is$ ppi=$(identify -format "%x" page.png) 
  4. Now to print as actual size (from ppi setting)

    terminal-where-image-is$ lp -o ppi=$ppi page.png 
2

lp doesn't know about image files; it can defer that to device-specific drivers, using options which exercise features "likely" to be supported by a variety of devices. The lp manual page does not list any suitable option for your purpose.

Instead, if you want multiple image files to display on a single sheet of paper, you can do this by combining images into single-page images in the arrangement you want. Programs such as ImageMagick are useful for this.

Further reading:

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.