Contact Sheet

A python script that generates a contact sheet or index print containing a configurable number of images. Multiple sheets are generated, the filename can also be included.

To install copy to ~/.gimp?-?/plug-ins/ directory or /usr/lib/gimp2-0/plug-ins/ and make executable with chmod +x contactsheet.py

This updated version works with version 2.4 of The Gimp, tiff support is included.

Thanks to Elmar at http://www.sullockenzlin.demon.nl/Gimp.html for the version update and language translations.

Known problems

1. Set topmargin at least 5 mm otherwise contactsheet page will not be visible.
2. German characters (ie umlaut) in the filename will not be recognized and gives an error. Plugin stops.
3. Printing with GIMP gives a rightshift of the contactpage for unknown reasons. Use Gutenprint plugin instead.

Version history

version 2.02

1. Margin round the image can now be changed
2. Font size can now be choosen. Be aware that fontsize automatically will be scaled down to fit the image width
3. added .XCF support
4. added a choice to save a text filelist from the printed images with the directory name where the image is located. Useful if you have a lot of images in several directory's. Name is the same as the contactpage name but with the .TXT extension
5. code has partly been rewritten

version 2.01

1. Dutch language pack added

version 2.00

1. now possible to make contactsheet of a whole directory including subdirs
2. two radiobuttons replaced by option buttons
3. added several paperformats
4. images are sorted in the way the systems sort the images
5. added extension in the filename
6. added support for pcx format
7. added making contactsheets of all registered formats in one batch
8. number of rows is now limited to paperheight (automatic scaled down if necessary)

Installation notes

Windows users:

The plugin works on the following system:
Windows XP pro SP3
GIMP v2.6.6
Python version 2.6.2c1 (r262c1:71369, Apr 7 2009, 18:44:00)
pygtk-2.12.1-3.win32-py2.6
pygobject-2.14.2-2.win32-py2.6
pycairo-1.4.12-2.win32-py2.6

Note for installation on Windows.
First install Python -> restart
Install pygtk, pygobject, pycairo -> restart
(Re)install GIMP
Unzip the language pack (newer versions at Elmar's site)
Install language pack (contactsheet.mo) in the GIMP locale directory ([drive]:\Program Files\GIMP-2.0\share\locale\[your language dir]\contactsheet.mo
Install your plugin in: [drive]:\Documents and Settings\[user]\.gimp-2.6\plug-ins\contactsheet.py. The plugin is now only available for you.

LINUX users

Install python
Copy the script contactsheet.py to /home//.gimp-2.6/plug-ins/
make the script executable with chmod +x /home//.gimp-2.6/plug-ins/contactsheet.py
Translations, not certain how to do this with linux yet will update when figured out

Average: 2.1 (14 votes)
AttachmentSize
contactsheet.py20.37 KB
Languages.zip2.72 KB

Comments

Dialogue Window Size

I did write in before about not being able to see the full dialogue window on my small screen.

I was wondering if you could tell me how to modify the code so that I could just accept the default parameters for "left/right Page border" "Top/bottom Page Border" and "Margin round image" and remove these options from the menu, and this should do the trick.

I'm no programmer, and in just editing the script to remove these options tosses out a 14 need 17 parameter error.

Ideally it would be nice if there was just an option to show/hide all the the options after "Orientation", but I don't know how much trouble this would be.

Thanks for a great plugin-- working via "alt-o"

Fred

Dialogue Window Size

On may 11 you have already written that you have problems with resizing and you are not alone with this problem. That's also why I've grouped the margins to overcome these problems.

It's not difficult to modify the code so what I can do for you is omitting the pageborders and the margin round the image. In the code I will write a line how to modify the borders and image margin. In the latest version (still beta on my site, follow the link above) I've added a printing option should I omit this too and should I also omit the page format (to eg default .JPG)??

Until I know how to program my own 'screen' this problem will exist for small screens or if the 'register' section get side by side options the problem will also be over but as far as I know this is still impossible.

Elmar

Dialogue Window Size

Elmar,

I did figure out how to set the defaults and drop the option buttons... Your idea about the margins seems to be a better way around this, and I look forward to see how this is done.

I am trying to find out info about the "register" section too, since I thought "side by side" or being able to "show/hide" the options would solve the problem in a better way.

Fred

Dialogue Window Size

I've made a special version for small screens and put it on my website, follow the link above.

In the code (def Contact_Sheet_Small) I've put some lines with comments. Look also at the register section what I have done.

I've also renamed this plugin to contactsheet-smallscreen.py. This is also done on several places in the code. It is not neccessary to rename the plugin or delete contactsheet.py. You will find the plugin in the same place as contactsheet but with the name "contactsheet small".

And
"I am trying to find out info about the "register" section too, since I thought "side by side" or being able to "show/hide" the options would solve the problem in a better way." if you find something let me know.

Elmar

If you want a different

If you want a different layout of the option, then you will have to create your own UI with (Py)GTK+.

If you want a different

Thank you I will have a look at it. I already found a tutorial. Do you know if there is a (small) plugin/script with a own build GUI so I can play with it. I've already looked at Gutenprint but that one is too big.

Elmar

UTF-8 codification?

It works very well as long as all image filenames have no strange characters, for instance ñ, ü, ô or á, etc, etc. If so, then the script just freeze.

I guess it is a codification problem. ¿should it be in utf-8 and not ansi?
Anyway, great work.
Thank you.

UTF-8 codification?

Thank you for your comments, I will update the strange characters 'section' on my website.

About codification: I think your are right. I have to look at the documentation how to set it to utf-8 or ansi if it is possible.

Elmar

Works just fine in my XP SP2 + Gimp 2.6.6

Great Code!
I love it.

Today I installed Python 2.6 (and also Pycairo, Pyobject & PyGTK).
Then I downloaded and installed the 2.6.6 version of the Gimp. All runs properly.
Your code works very well. Thank you for the script!

Cheers,
Emilio from Usando The Gimp

Xp

Jabba
Is therea any that work with XP and GIMP 2.6 easily?

How to use plugin in linux?

Hi,

I've tossed contactsheet.py in my /home//.gimp-2.4/plug-ins folder, and ran the chmod +x command, (which returns nothing, so I figured it worked, saw no change to the plug-ins folder,) and now what do I do? I don't seem to find it in the plug-ins tree or list view. Thanks!

How to use plugin in linux?

Hi,

I don't know much about Linux but:

Why do you use gimp 2.4 instead of 2.6?? I modified the plugin to work with 2.6.

And:

-Look if the mode has really changed. If not you have done something wrong.
-As far as I know you have to restart GIMP before you can see the plugin. The plugin will show himself up as "batch" in the filter-tab.
-Check your preferences about plugins. Your folder should be noted here.

Regards,

Elmar

window resize and mouse problem

I'm new to Ubuntu, using 9.04 Jaunty, Gnome, with Gimp 2.6.
I read and followed the script fix and I am able to create a contact sheet.

There are 2 problems that I am having though.
I can't get the window to resize properly, either "full screen" or from dragging. The bottom "cancel" and "OK" buttons are only visible if I "click around" on the screen.

If I do get the buttons visible, a mouse click has no effect.

Using alt O gets the job done, whether buttons are visible or not.

Is there a fix for this?

Thanks for a very useful plugin script!

Fred

Unfortunately I don't know

Unfortunately I don't know nothing of Ubuntu, but I know that the window is not resizable! So if your screen is small you will have a problem to see all buttons. There is a new version with a smaller window size but Robin hasn't released it yet.

Check also you python version, it should work with v2.6 and all python related additional programs must also have v2.6.

Elmar

Preview of most the plugin

Preview of most the plugin at least on windows IS resizable
(by enlarging the plugin interface.
Note that you have to drag BOTH horizzontally and vertically to see results ..)

But i am not sure if the same is valid for Python plugin as this

window resize and mouse problem

You are right, the window is resizable but it's impossible to make it as small as your monitorscreen. I've had this problem with a 15" screen.

Elmar

sorry-- an addition

I also encountered another problem.

I have some .jpg's on a Windows network shared folder. The folder is mounted and fully accessable in Nautilus, but it does not show up as a possibility in the create contact page window.

Can this be remedied too?

sorry-- an addition

This is not a problem of the contactsheet plugin.

Elmar

Crash in Gimp 2.6

Running Ubuntu 9.04 and Gimp 2.6
I get the following error message:
Traceback (most recent call last):
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 692, in response
dialog.res = run_script(params)
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 353, in run_script
return apply(function, params)
File "/usr/lib/gimp/2.0/plug-ins/contactsheet.py", line 182, in Contact_Sheet
files = images[sheetcount*ThumbsPerSheet:(sheetcount+1)*ThumbsPerSheet]
TypeError: slice indices must be integers or None or have an __index__ method

any ideas?

Crash in Gimp 2.6: TypeError

Hi,

There is a new contactsheetscript and it works fine with Gimp 2.6.6 and with python 2.6 and python related programs. But if you cannot wait give me your emailaddress or modify contactsheet.py. Look for:

ThumbsPerSheet = int(num_col*num_rows) #added 'int' for python v2.6

Regards,

Elmar

Hello, When do you plan to

Hello,
When do you plan to release this new version of you script ?
I’m under Ubuntu 9.04 too and finding the same error.

Regards,
Olivier.

Hello, When do you plan to

You have to ask Robin, but if you gave me your emailaddress I will send it to you or search for "GIMP contactsheet" on the web (domain:nl). Here you will find the script too but be aware its ment for testers.

Elmar

thank

thank, i get it

Crash in Gimp 2.6

As requested, email address
lkalmakoff@gmail.com

Crash in Gimp 2.6

Got it working, thanks.

No success with Windows XP and Gimp 2.6

I'm missing something. Installed but don't find Contact Sheet.
I tried following these instructions:
http://dgowers-tech.livejournal.com/4494.html

and don't get the gimp-python console.

What am I doing wrong?

System:
- Windows XP
- Gimp 2.6.3

Thanks

-Allen

No success with Windows XP and Gimp 2.6

In windows you need to add python support to gimp.

that is no easy how add a plugin ,as example require also unistall and reinstall gimp.

but is not difficult, i included all what is needed including instruction a single pack here
http://photocomix-resources.deviantart.com/art/Gimp-Phython-support-easi...

That should be sufficient anyway here you may found more details,
http://www.gimptalk.com/forum/python-and-gimp-t25587.html

So... what do I do with it?

Sorry, but I don't have much experience with Gimp.
I've installed the plugin in
C:\Programme\Graphics\GIMP-2.0\lib\gimp\2.0\plug-ins
but I can't seem to find it in the Xtns directory.

I have a Python installed, but still this does not seem to be of any help.

Any help would be appreciated, this plugin seems to be what I need.

Alex

Win XP SP2
Gimp 2.4.2
Python 2.3.5 (#62, Feb 8 2005, 16:23:02)

Re :So... what do I do with it?

Hi,

Try C ://Documents and Settings/yourname/.gimp-xx/plugin or C ://Documents and Settings/yourname/gimp/plugin

Relaunch Gimp.

Menu 'Extn' ---> 'Batch' ---> 'Contact Sheet'

Good luck
Bulbab

Any plans for U.S. paper size?

Hello Robin, great job on the script. Just used it to generate 54 pages of thumbnailed images of jewelry for the wife (hobbyist jewelry maker). I noticed A4 paper size was available -- any plans to add U.S. paper sizes, such as 8.5 wide by 11.0 inches tall (we Yanks call it "letter size")? Thanks again for such a nice script, it worked beautifully.

Mod for US Paper Sizes

It's an easy mod to Robin's script...

in the def Contact_Sheet() function, add the following lines after the definition for 8x10:


elif (contact_size == "Letter"):
width,height = (216,279)
elif (contact_size == "Legal"):
width,height = (216,356)
elif (contact_size == "Tabloid"):
width,height = (279,432)

Next, edit the register() section at the bottom, change the radio button options for contact_size like so:


(PF_RADIO, "contact_size", "Contact page sheet size:", "A4", (("A4 (20.9x29.7 cm)", "A4"), ("Jumbo (10.2x15.2 cm)", "Jumbo"), ("6x8 (15.2x20.3 cm)", "6x8"), ("8x10 (20.3x25.4 cm)", "8x10"), ("Letter (8.5x11 in)", "Letter"), ("Legal (8.5x14 in)", "Legal"), ("Tabloid (11x17 in)", "Tabloid"))),

Save the file and restart GIMP.

- Dan

nice one

... and cool photos, too :)

Is it possible to crop all picture to be square, so that the index is regular?

Thanks for the comment

Currently it is not possible to crop the images to be square. But I will add this as an option to the script.