Page 1 of 2

Imagemagick script for printing proxies

PostPosted: 04 Jun 2009, 16:38
by olze
Hello,
I would like to share some of my findings
Feel free to comment, improve, post your own tips !

Aim: printing numerous proxies from HQ pictures
Methods:
- transformation of the HQ pictures so that their print size matches the size of a real mtg card,
- creation of N "contact-sheet"-like pages (A4 format) with 9 cards on each,
and (optional),
- creation of a multi-pages PDF file ready to be carried on a USB drive to your favorite 'print-shop'
Tools:
You may use two softwares. Either Imagemagick (natively installed on my Ubuntu distrib) or Graphicsmagick for Windows.

Command-lines:
1)convert -filter Lanczos -resize 744x1038 *.jpg resized_picture
2)montage -density 300 -tile 3x3 -geometry +2+2 *.jpeg montage.jpg
3)convert montag*.jpg montage.pdf

Explanations:
The convert instruction is used to change the number of pixels of the original file to a number of pixels that will produce a picture of the size of a conventional mtg card when printed at the 300 DPI resolution. A mtg cards measures 2.48x3.46 inches. At 300 DPI it gives 2.48x300=744 pixels. If the original number of pixels of the picture is less than 744, it means that the program will enlarge the picture. According to the Imagemagick's manual, the filter 'Lanczos' is a good comprise (time/result) for this transformation (see filters in IM).

The montage instruction is used to create a contact sheet of card pictures arranged in 3 rows and 3 columns (option tile), separated by 2 pixels (option geometry), at a resolution of 300 DPI (option density). For each pool of 9 cards (3 by 3 cards) you will obtain a file named 'montage-X.jpg'. X increases from 0 to a multiple of 9 depending of the total number of card pictures you have in the directory.

The last line make the program create one PDF file gathering all the contact sheets created before.

Weblinks for the softwares:
Imagemagick: http://www.imagemagick.org
Graphicsmagick: http://www.graphicsmagick.org/

Re: Imagemagick script for printing proxies

PostPosted: 04 Jun 2009, 18:30
by Huggybaby
Nice, thank you.

Re: Imagemagick script for printing proxies

PostPosted: 05 Jun 2009, 17:03
by doxaios
I asked this and in printer topic but if you know how to solve my problem let me know. I print the front side but when I put the page oposite down to prin the back side EVERYTIME is a little bit offset...I tried both A4 layout and exact the 9 cards per page but always is this issue... #-o #-o #-o #-o

Re: Imagemagick script for printing proxies

PostPosted: 05 Jun 2009, 22:19
by Huggybaby
Is the offset left to right or top to bottom?

If it's left to right, then the paper guides aren't centered properly.

If the offset is top to bottom, how do you turn the paper over? Hopefully not end over end. The end of the page that goes in the printer first on page one should be the same for side two.

Re: Imagemagick script for printing proxies

PostPosted: 06 Jun 2009, 05:50
by doxaios
It is left-right. I went to a prof. shop for digital copies but the problem remains..I dont know what to do.In adobe photoshop you press File->New. Then what do you select?

Re: Imagemagick script for printing proxies

PostPosted: 06 Jun 2009, 16:16
by Huggybaby
It's clear your layouts aren't centered perfectly then. I don't know Photoshop, maybe someone here can give you a template, or examine yours for you.

Re: Imagemagick script for printing proxies

PostPosted: 06 Jun 2009, 16:50
by doxaios
If someone could give me a layout/template please send me a pm

Re: Imagemagick script for printing proxies

PostPosted: 15 Jun 2009, 16:01
by Snacko
I used this method for printing tokens, however you might want to use something lossless like png in the intermediate steps as with jpeg you loose a bit of quality in each step 1&2.

Also I'm not sure how does the -border functionality in imagemagic work, but you could add bigger black borders and enlarge less to get more proper card printed.

edit.

I used this command to extend the black borders (I work with png to not recompress the files)

convert -filter Lanczos -resize 700x994 -bordercolor black -border 22x22 *.jpg resized_picture.png

Re: Imagemagick script for printing proxies

PostPosted: 17 Jun 2009, 09:06
by olze
Thanks for the input Snacko !

Indeed, the method I used is not perfect because the final size does not match exactly the real size of a Magic card due to smaller black borders.
I didn't see the option -border, great !
Do the dimensions that you give (ie -resize 700x994 and -border 22x22) lead to a final print size matching the real card size ?

As for the use of png picture format, does that make sense to use it since the first file is in jpeg (in terms of quality)? If it increases substantially the filesize it might ask to much cpu for my computer...

Anyway, I'll test that soon.

Re: Imagemagick script for printing proxies

PostPosted: 17 Jun 2009, 09:29
by Snacko
If you can live with the data loss with each jpeg recompression you can leave out png / any other lossless format.

With jpeg it like:
input (jpeg, 100% orgnial quality)->resize/borders(90% of 100% orginal quality)->lay them out (90% of 90% of 100% quality).
So with each step you loose out a bit of the orginal jpeg.

I measured the cards with a ruler and those dimensions pretty much fit the real card size @ 300dpi.

Re: Imagemagick script for printing proxies

PostPosted: 17 Jun 2009, 09:55
by olze
Thanks for the details !
I went rapidly through the "HQ Card Generator" page using the link in your signature ... I only discover it now... especially the generatePages.bat which should do the job if I understood correctly (?)
I realize that my post was useless :oops: ...
Damn it... I worked on it for days ... #-o

Anyway, great work, I'll go deeper and test your software now.

Re: Imagemagick script for printing proxies

PostPosted: 17 Jun 2009, 10:37
by Snacko
Those are two methods that don't necessarily produce the same output.

When printing the scans you get cards which look and feel 100% how they were printed by WotC, while using a card generator you get similar (or really close) looking card with Oracle text.

It really comes down to whether you want 100% exact card look or get updated text / maybe some more detail that was lost while scanning.

You can read more about the HQ Card Generator http://www.slightlymagic.net/hqpics/4-mtg/13-hqcg and there's a subforum here! viewtopic.php?f=30&t=465

Re: Imagemagick script for printing proxies

PostPosted: 22 Jul 2009, 05:40
by Nate
Doing it from the command line with imagemagick is pretty neat! As Snacko mentioned, it isn't quite the same as using full card scans. You may think it is better or worse. The card generator can't do some special frames like tokens.

I use the card generator to make pages of cards arranged 3x2, then a third row containing two cards rotated 90 degrees. I print them on card stock using an Epson printer with a straight through paper path. I then have an Accucut roller-type paper cutter and I use a custom made die cutter to cut out the cards with rounded corners. When placed in sleeves they look identical to the real deal!

The whole setup was pretty pricey. A friend and I went in on it all, here are all our costs:
Printer $320
Cutter: $390
Die: $139
Each sheet of paper (8 cards): $0.136
Each ink set (prints ~200 sheets): $65
Each sleeve: $0.029333
Each deck box: $1.20

For a 75 card deck, it costs $7.72 for the cards, sleeves, and deck box. Without sleeves or deck box it drops to $4.32. So it is pretty cheap if you ignored the cost of the printer, cutter, and die (which do have resale value).

It takes a long time to print, as each sheet has to be manually fed into the printer. Cutting is fast, but one mistake and a whole sheet can be ruined. We've made probably 30 decks with the setup so far, all for personal use. It is too time consuming to make other people decks.

Re: Imagemagick script for printing proxies

PostPosted: 22 Jul 2009, 13:49
by doxaios
Nate wrote:I use the card generator to make pages of cards arranged 3x2, then a third row containing two cards rotated 90 degrees. I print them on card stock using an Epson printer with a straight through paper path.
I cant understand what you do. Could you explain it a little bit more and upload a sample if you can?

Re: Imagemagick script for printing proxies

PostPosted: 23 Jul 2009, 05:40
by staggerwingjtstw
I think he means it looks like this, with dashes representing cards

| | |
| | |
-- --

That might be sideways....