9.99999% Guaranteed uptime. Six nines!

MakePlayingCards

I love making customized things. There are places that will let you print playing cards with a custom backing, but I thought it would be more fun to have pictures of people I knew on all the different cards.

This program generates high quality pictures that I then printed at a photo store (I used PE Photo, but any photo store that will print pictures without printing the filenames on the back will do, keep in mind that that'll be a special request, PE Photo charges me an extra $5/order to do that). I then cut each picture in half with a paper cutter. IT usually costs me about $4 a deck to make these cards and people love them.

You can download makePlayingCards (16 megs) here, unzip it and start.

Quick Start

If you already have 54 pictures you like, rename them to:

  • Diamonds: da.jpg, d2.jpg, d3.jpg, d4.jpg, d5.jpg, d6.jpg, d7.jpg, d8.jpg, d9.jpg, d10.jpg, dj.jpg, dk.jpg, dq.jpg, djoker.jpg
  • Hearts: ha.jpg, h2.jpg, h3.jpg, h4.jpg, h5.jpg, h6.jpg, h7.jpg, h8.jpg, h9.jpg, h10.jpg, hj.jpg, hk.jpg, hq.jpg
  • Spades: sa.jpg, s2.jpg, s3.jpg, s4.jpg, s5.jpg, s6.jpg, s7.jpg, s8.jpg, s9.jpg, s10.jpg, sj.jpg, sk.jpg, sq.jpg, sjoker.jpg
  • Clubs: ca.jpg, c2.jpg, c3.jpg, c4.jpg, c5.jpg, c6.jpg, c7.jpg, c8.jpg, c9.jpg, c10.jpg, cj.jpg, ck.jpg, cq.jpg

And then run "makecards [picturedirectory]" and wait, your prints will appear in the finished directory

Syntax

makecards path/to/pictures [labels: path/to/labels] [font: (font|path/to/font)] [1suit|2suits|4suits]

Will generate 28 1800 by 1200 pixel jpg files, that can then be printed at a photo shop for thick sturdy playing cards.

What you need to do & decide start

How many?

How many distinct cards do you want to make? MakePlayingCards will always generate 54 cards (13 in each suit and 2 jokers), but you have 3 choices:

  • 4Suits: Supply 54 pictures (52 cards + 2 jokers) and have a different picture on every card. This is the default.
  • 2Suits: Supply 28 pictures (26 cards + 2 jokers) where cards with the same colour and suit have the same picture.
  • 1Suit: Supply 14 pictures (13 cards + 1 joker) and each rank will have a different pictures

Text?

If you'd like text (up to 3 lines) on each card make text files with the same names as the pictures

You can also choose a font, I've included a few of my (free) favourites in the fonts directory.

Making cards

First you need to rename your pictures so that the software knows which picture goes on which card.

The naming convention is one letter for the suit (d, h, s, c for diamonds, hearts, spades and clubs) and then a letter, number or the word joker for the rank. - If you're making only 1 suit, name your pictures as diamonds. So da.jpg for the ace, d2.jpg through d10.jpg for the numbers, and dj.jpg, dq.jpg, dk.jpg and djoker.jpg for the face cards. - For 2 suits, name your pictures for the red cards as diamonds, name the pictures for the black cards as spades, so sa.jpg, s2.jpg.... s10.jpg, sj.jpg, sq.jpg, sk.jpg, sjoker.jpg. - For 4 suits, add ha.jpg through hk.jpg, and ca.jpg through ck.jpg. You don't need to add any extra jokers.

Running

From the command prompt run:

makecards path/to/pictures labels: path/to/labels font: fontnameorpath 1suit/2suits/4suits

If that's confusing just take a look at the examples.

Examples:

All of these examples will use some boring pictures of the Tibetan countryside that I've included in the sample directory. You might notice that it doesn't matter how large the source pictures are, they'll be resized. But starting with higher resolution pictures will give better results.

All of the samples are included as batch files, so you can run them witha single click

Warning: this is really slow, it takes a few minutes to generate a deck.

Sample.bat: Standard deck with text

makecards sample/tibet labels: sample/labels font: fonts/casual.ttf 4suits

This will generate four different suits, with the words "Text Text Text" in a bubbly text

SampleNames.bat: Names for face cards

makecards sample/tibet labels: sample/paris 4suits

This will generate 4 suits, where the face cards have their 16th century traditional court names in the default font (usually Arial).

SampleEights.bat: Crazy Eights rules

makecards sample/tibet labels: sample/paris 4suits

This will generate 1 suit worth of pictures (the pictures will be the same as the diamonds from the previous examples) with crazy eights rules on the special cards.

Trivia

I'm used to a "standard" 54 card deck, so that's what gets printed here, but if there's demand I'll add options for other kinds of decks, like Tarot.

From Wikipedia: - The joker is an American innovation (1865). Created for the Alsatian game of Euchre, it spread to Europe from America along with the spread of Poker. -In early games the kings were always the highest card in their suit. However, as early as the late 14th century special significance began to be placed on the nominally lowest card, now called the Ace, so that it sometimes became the highest card and the Two, or Deuce, the lowest. This concept may have been hastened in the late 18th century by the French Revolution, where games began being played "ace high" as a symbol of lower classes rising in power above the royalty.

License

This software includes parts of the fantastic ImageMagick program, which is free to use and distribute. If you're interested in graphics, I'd take a look at it.



Programming Math etc

What I've said lately

Loading feeds

More of me on the web