ANN: Phatch = PHoto bATCH processor and renamer based on PIL

  • Thread starter SPE - Stani's Python Editor
  • Start date
S

SPE - Stani's Python Editor

I'm pleased to announce the release of Phatch which is a
powerful batch processor and renamer. Phatch exposes a big part of the
Python Imaging Library through an user friendly GUI. (It is using
python-pyexiv2 to offer more extensive EXIF and IPTC support.) Phatch
is not targeted at manipulating individual pictures (such as with
Gimp), but repeating the same actions on hundreds or thousands of
images.

If you know PIL and have some nice recipes laying around, it is very
easy to write plugins as Phatch generates the corresponding GUI
automagically just like in Django. Any existings PIL scripts can be
added very easily. Let me know if you want to contribute or have any
questions.

Homepage: http://photobatch.stani.be (free download link below)
Tutorials: http://photobatch.wikidot.com/tutorials
Translations: https://translations.launchpad.net/phatch/trunk/+pots/phatch
License: GPLv3
Screenshot: http://photobatch.wikidot.com/local--files/start/Screenshot-Phatch3d.jpg
(the perspective and reflection is produced by Phatch itself)

Phatch has many features, like:
- EXIF information inspector with thumbnail
- limit jpeg file size when saving
- tons of actions organized by tags (including perspective, round
corners, shadow, reflection, ...)
- console version (Phatch can now run without a gui on servers)
- batch rename and copy files based on exif metadata
- data stamping (http://photobatch.wikidot.com)
- online documentation wiki (http://photobatch.wikidot.com)

Linux only features:
- desktop or panel droplets on which images or folders can be dropped
(will be ported to Windows & Mac)
- Nautilus and desktop integration (with its own mime type and
nautilus extension)
- manpage with examples

With python-pyexiv2 the following featues are added:
- embedding the original EXIF and IPTC tags in the image

All actions mostly have a separate pil function in their source code,
so they could be read as a recipe book for PIL:
* Auto Contrast - Maximize image contrast
* Background - Put colour under transparent image
* Border - Crop or add border to all sides
* Brightness - Adjust brightness from black to white
* Canvas - Crop the image or enlarge canvas without resizing the image
* Colorize - Colorize grayscale image
* Common - Copies the most common pixel value
* Contrast - Adjust from grey to black & white
* Convert Mode - Convert the color mode of an image (grayscale, RGB,
RGBA or CMYK)
* Copy - Copy image file
* Effect - Blur, Sharpen, Emboss, Smooth, ...
* Equalize - Equalize the image histogram
* Fit - Downsize and crop image with fixed ratio
* Grayscale - Fade all colours to gray
* Invert - Invert the colors of the image (negative)
* Maximum - Copies the maximum pixel value
* Mask - Apply a transparency mask
* Median - Copies the median pixel value
* Minimum - Copies the minimum pixel value
* Offset - Offset by distance and wrap around
* Posterize - Reduce the number of bits of colour channel
* Perspective - Shear 2d or 3d
* Rank - Copies the rank'th pixel value
* Reflect - Drops a reflection
* Rename - Rename image file
* Rotate - Rotate with random angle
* Round - Round or crossed corners with variable radius and corners
* Saturation - Adjust saturation from grayscale to high
* Save - Save an image with variable compression in different types
* Scale - Scale an image with different resample filters.
* Shadow - Drop a blurred shadow under a photo with variable position,
blur and color
* Solarize - Invert all pixel values above threshold
* Text - Write text at a given position
* Transpose - Flip or rotate an image by 90 degrees
* Watermark - Apply a watermark image with variable placement (offset,
scaling, tiling) and opacity

I develop Phatch on Ubuntu/Linux, but I have tested and polished it
regularly on Windows and Mac Os X. (Only the droplet functionality
needs to be ported.) Phatch is submitted to Debian unstable and
Ubuntu Hardy. Packagers for other platforms are welcome.

Requirements:
- PIL 1.1.5 or higher
- wxPython 2.6 or higher
- pyexiv2 (optional)
- python nautilus bindings (optional)

Best regards,
Stani
 
D

Daniel Fetchinson

I'm pleased to announce the release of Phatch which is a
powerful batch processor and renamer. Phatch exposes a big part of the
Python Imaging Library through an user friendly GUI. (It is using
python-pyexiv2 to offer more extensive EXIF and IPTC support.) Phatch
is not targeted at manipulating individual pictures (such as with
Gimp), but repeating the same actions on hundreds or thousands of
images.

If you know PIL and have some nice recipes laying around, it is very
easy to write plugins as Phatch generates the corresponding GUI
automagically just like in Django. Any existings PIL scripts can be
added very easily. Let me know if you want to contribute or have any
questions.

Homepage: http://photobatch.stani.be (free download link below)
Tutorials: http://photobatch.wikidot.com/tutorials
Translations: https://translations.launchpad.net/phatch/trunk/+pots/phatch
License: GPLv3
Screenshot:
http://photobatch.wikidot.com/local--files/start/Screenshot-Phatch3d.jpg
(the perspective and reflection is produced by Phatch itself)

Phatch has many features, like:
- EXIF information inspector with thumbnail
- limit jpeg file size when saving
- tons of actions organized by tags (including perspective, round
corners, shadow, reflection, ...)
- console version (Phatch can now run without a gui on servers)
- batch rename and copy files based on exif metadata
- data stamping (http://photobatch.wikidot.com)
- online documentation wiki (http://photobatch.wikidot.com)

Linux only features:
- desktop or panel droplets on which images or folders can be dropped
(will be ported to Windows & Mac)
- Nautilus and desktop integration (with its own mime type and
nautilus extension)
- manpage with examples

With python-pyexiv2 the following featues are added:
- embedding the original EXIF and IPTC tags in the image

All actions mostly have a separate pil function in their source code,
so they could be read as a recipe book for PIL:
* Auto Contrast - Maximize image contrast
* Background - Put colour under transparent image
* Border - Crop or add border to all sides
* Brightness - Adjust brightness from black to white
* Canvas - Crop the image or enlarge canvas without resizing the image
* Colorize - Colorize grayscale image
* Common - Copies the most common pixel value
* Contrast - Adjust from grey to black & white
* Convert Mode - Convert the color mode of an image (grayscale, RGB,
RGBA or CMYK)
* Copy - Copy image file
* Effect - Blur, Sharpen, Emboss, Smooth, ...
* Equalize - Equalize the image histogram
* Fit - Downsize and crop image with fixed ratio
* Grayscale - Fade all colours to gray
* Invert - Invert the colors of the image (negative)
* Maximum - Copies the maximum pixel value
* Mask - Apply a transparency mask
* Median - Copies the median pixel value
* Minimum - Copies the minimum pixel value
* Offset - Offset by distance and wrap around
* Posterize - Reduce the number of bits of colour channel
* Perspective - Shear 2d or 3d
* Rank - Copies the rank'th pixel value
* Reflect - Drops a reflection
* Rename - Rename image file
* Rotate - Rotate with random angle
* Round - Round or crossed corners with variable radius and corners
* Saturation - Adjust saturation from grayscale to high
* Save - Save an image with variable compression in different types
* Scale - Scale an image with different resample filters.
* Shadow - Drop a blurred shadow under a photo with variable position,
blur and color
* Solarize - Invert all pixel values above threshold
* Text - Write text at a given position
* Transpose - Flip or rotate an image by 90 degrees
* Watermark - Apply a watermark image with variable placement (offset,
scaling, tiling) and opacity

I develop Phatch on Ubuntu/Linux, but I have tested and polished it
regularly on Windows and Mac Os X. (Only the droplet functionality
needs to be ported.) Phatch is submitted to Debian unstable and
Ubuntu Hardy. Packagers for other platforms are welcome.

Requirements:
- PIL 1.1.5 or higher
- wxPython 2.6 or higher
- pyexiv2 (optional)
- python nautilus bindings (optional)


This is pretty cool! I have one question about the equally cool
website: what tool did you use for creating this image:

http://photobatch.wikidot.com/local--files/start/Screenshot-Phatch3d.jpg


Cheers,
Daniel
 
S

SPE - Stani's Python Editor

This is pretty cool! I have one question about the equally cool
website: what tool did you use for creating this image:

http://photobatch.wikidot.com/local--files/start/Screenshot-Phatch3d.jpg
This is Phatchs own dogfood. I guess you missed the tutorials link.
There is a tutorial how you can achieve this effect:
http://photobatch.wikidot.com/tutorial-round-3d-reflect

I run Phatch on three screenshots I have to put them in perspective
with rounded corners and perspective. I let Phatch save them as a png
so transparency is preserved. Afterwards I opened Gimp and put the
three together on the background of a radial gradient.

Let me know if it works for you.

Stani
 
S

Steve Holden

SPE said:
I'm pleased to announce the release of Phatch which is a
powerful batch processor and renamer. Phatch exposes a big part of the
Python Imaging Library through an user friendly GUI. (It is using
python-pyexiv2 to offer more extensive EXIF and IPTC support.) Phatch
is not targeted at manipulating individual pictures (such as with
Gimp), but repeating the same actions on hundreds or thousands of
images.
Perhaps you could put a link to the source on the Windows instalL page?
I don't mind being a second-class citizen, but it's annoying to have to
jump around like that.

Looks like a nice piece of work.

regards
Steve
 
S

Steve Holden

SPE said:
I'm pleased to announce the release of Phatch which is a
powerful batch processor and renamer. Phatch exposes a big part of the
Python Imaging Library through an user friendly GUI. (It is using
python-pyexiv2 to offer more extensive EXIF and IPTC support.) Phatch
is not targeted at manipulating individual pictures (such as with
Gimp), but repeating the same actions on hundreds or thousands of
images.
Perhaps you could put a link to the source on the Windows instalL page?
I don't mind being a second-class citizen, but it's annoying to have to
jump around like that.

Looks like a nice piece of work.

regards
Steve
 
F

Fred Pacquier

Steve Holden said:
Perhaps you could put a link to the source on the Windows instalL page?
I don't mind being a second-class citizen, but it's annoying to have to
jump around like that.

I'm interested too, and was also wondering if Phatch is as full-featured
unders Windows as under Linux, specifically the EXIF/IPTC functions made
available through pyexiv2 : exiv2 itself seems to discriminate between the
two, the Windows package only has the executable, not the library.
 
D

Daniel Fetchinson

I'm pleased to announce the release of Phatch which is a
This is Phatchs own dogfood. I guess you missed the tutorials link.
There is a tutorial how you can achieve this effect:
http://photobatch.wikidot.com/tutorial-round-3d-reflect

I run Phatch on three screenshots I have to put them in perspective
with rounded corners and perspective. I let Phatch save them as a png
so transparency is preserved. Afterwards I opened Gimp and put the
three together on the background of a radial gradient.

Let me know if it works for you.

Yep, I indeed missed the tutorial :)
Now it's clear, thanks a lot!

Cheers,
Daniel
 
W

Wolfgang Strobl

SPE - Stani's Python Editor said:
I develop Phatch on Ubuntu/Linux, but I have tested and polished it
regularly on Windows and Mac Os X. (Only the droplet functionality
needs to be ported.) Phatch is submitted to Debian unstable and
Ubuntu Hardy. Packagers for other platforms are welcome.

Requirements:
- PIL 1.1.5 or higher
- wxPython 2.6 or higher
- pyexiv2 (optional)
- python nautilus bindings (optional)

Hm. I just gave it a try on Windows, but in vain. See below.

C:\build\phatch-0.1.bzr385>python setup.py install

just says

Sorry your platform is not yet supported.
'2.8.7.1'

By greping for "Sorry you platform", I found config.py and there
(abbreviated) the following function:

def check_config_paths(config_paths):
if config_paths: return config_paths
p = sys.prefix
if sys.platform[:5] == 'linux':
return {
"PHATCH_IMAGE_PATH" :
...
}
else:
sys.stderr.write('Sorry your platform is not yet supported.\n')
sys.exit()

How is this supposed to work on Windows?
 
S

Steve Holden

Wolfgang said:
SPE - Stani's Python Editor said:
I develop Phatch on Ubuntu/Linux, but I have tested and polished it
regularly on Windows and Mac Os X. (Only the droplet functionality
needs to be ported.) Phatch is submitted to Debian unstable and
Ubuntu Hardy. Packagers for other platforms are welcome.

Requirements:
- PIL 1.1.5 or higher
- wxPython 2.6 or higher
- pyexiv2 (optional)
- python nautilus bindings (optional)

Hm. I just gave it a try on Windows, but in vain. See below.

C:\build\phatch-0.1.bzr385>python setup.py install

just says

Sorry your platform is not yet supported.
'2.8.7.1'

By greping for "Sorry you platform", I found config.py and there
(abbreviated) the following function:

def check_config_paths(config_paths):
if config_paths: return config_paths
p = sys.prefix
if sys.platform[:5] == 'linux':
return {
"PHATCH_IMAGE_PATH" :
...
}
else:
sys.stderr.write('Sorry your platform is not yet supported.\n')
sys.exit()

How is this supposed to work on Windows?
RTFM: the web site instructions clearly state that setup.py doesn't
currently work with Windows. You should be able to double-click on the
program in Explorer, or use any of the standard ways of creating a link
shortcut.

regards
Steve
 
W

Wolfgang Strobl

Steve Holden said:
RTFM: the web site instructions clearly state that setup.py doesn't
currently work with Windows.

Do they? http://photobatch.stani.be/ doesn't, following "documentation"
http://photobatch.stani.be/ doesn't, either. I missed "start phatch in
trunk/phatch" while browsing through the web site, though. Not finding
any specific instructions in README and finding no INSTALL at all, I
expected setup.py to work on any platform.
You should be able to double-click on the
program in Explorer, or use any of the standard ways of creating a link
shortcut.

Just starting phatch.py in phatch, as documented, does it, too. Thanks!
 
S

Steve Holden

Wolfgang said:
Do they? http://photobatch.stani.be/ doesn't, following "documentation"
http://photobatch.stani.be/ doesn't, either. I missed "start phatch in
trunk/phatch" while browsing through the web site, though. Not finding
any specific instructions in README and finding no INSTALL at all, I
expected setup.py to work on any platform.


Just starting phatch.py in phatch, as documented, does it, too. Thanks!
Pardon me for reading the install instructions :) -- from
http://photobatch.wikidot.com/install:

Windows

Requirements

Install first Python (2.5 or 2.4), wxPython (2.8 or 2.6) and Python
Imaging Library (1.1.6 or 1.1.5).
Installation

Fetch the tar.gz source package from the phatch download page. Unzip the
downloaded file. Do not run "python setup.py install", as this is only
supported for linux! Start Phatch in trunk/phatch with:

python phatch.py
"""

regards
Steve
 
S

Stani

> Perhaps you could put a link to the source on the Windows instalL page?
> I don't mind being a second-class citizen, but it's annoying to have to
> jump around like that.
It is an open wiki, but I changed it. I am a bit reluctant as the only
website which is fixed now is http://photobatch.stani.be and all other
parts (dedibox, wikidot) might change once I've got the time to build my
own website. So those references run the risk of being outdated in the
future.
> Looks like a nice piece of work.
Thanks, have a nice day!

Stani
 
S

Stani

Fred Pacquier said:
I'm interested too, and was also wondering if Phatch is as full-featured
unders Windows as under Linux, specifically the EXIF/IPTC functions made
available through pyexiv2 : exiv2 itself seems to discriminate between the
two, the Windows package only has the executable, not the library.

Even without python-pyexiv2 Phatch features read-only EXIF support thanks to
PIL. So you can name your files or write data stamps (date, aperature, velocity,
....) based on EXIF information. If you want to save EXIF and IPTC information to
files you need python-pyexiv2. From its website:
"However, the library and all the tools used are cross-platform, so very little
tweaking should be needed to get it to work fine on Windows or MacOS X."
http://tilloy.net/dev/pyexiv2/developers.htm

The exiv2 website says:
"The Windows package only contains the command line utility exiv2.exe
(statically linked), manpage and a sample command file; get the source and doc
packages for the library, documentation and other tools."
http://www.exiv2.org/download.html

So maybe someone can compile it.


But... Phatch is designed with flexibility in mind. If someone can point me to a
free python library for Windows for EXIF and other metadata, I'll be happy to
integrate support for it in Phatch. Ideas anyone?

Or you could write a python wrapper around the executable.

Stani
 
S

Stani

Wolfgang Strobl said:
Do they? http://photobatch.stani.be/ doesn't, following "documentation"
http://photobatch.stani.be/ doesn't, either.
Strange. If you follow documentation on http://photobatch.stani.be you get on
the documentation website, where there are clearly links to install.
I missed "start phatch in
trunk/phatch" while browsing through the web site, though. Not finding
any specific instructions in README and finding no INSTALL at all, I
expected setup.py to work on any platform.
For the next release I added a remark in README. I hope that helps.

I strongly advise you to read the tutorials:
http://photobatch.wikidot.com/tutorials (for your convenience one of them is
even translated in german, feel free to translate the other one)

Thans to Frédéric, there is now a tutorial for writing your own actions with PIL
(no knowledge of wxpython needed):
http://photobatch.wikidot.com/writing-actions

Also to understand fully how variables work in Phatch for filenames and folders:
http://photobatch.wikidot.com/variables

As a general note, the documentation website is an open wiki, so feel free to
improve or contribute (eg how to install Phatch on Windows ;-) ).
 
F

Fred Pacquier

Stani said:
Even without python-pyexiv2 Phatch features read-only EXIF support
thanks to PIL. So you can name your files or write data stamps (date,
aperature, velocity, ...) based on EXIF information.

Oh, that's good. I hadn't looked at PIL for a long while and wasn't aware
it did that.
If you want to
save EXIF and IPTC information to files you need python-pyexiv2. From
its website: "However, the library and all the tools used are
cross-platform, so very little tweaking should be needed to get it to
work fine on Windows or MacOS X."
http://tilloy.net/dev/pyexiv2/developers.htm
The exiv2 website says:
"The Windows package only contains the command line utility exiv2.exe
(statically linked), manpage and a sample command file; get the source
and doc packages for the library, documentation and other tools."
http://www.exiv2.org/download.html
So maybe someone can compile it.

Thanks for the confirmation Stani : as I suspected, this means exiv2 is
(deliberately ?) not end-user-ready for Windows (as in, download, install
and configure). I have Googled around a bit but there doesn't seem to be
anyone supplying a ready-made binary lib. Too bad.
But... Phatch is designed with flexibility in mind. If someone can
point me to a free python library for Windows for EXIF and other
metadata, I'll be happy to integrate support for it in Phatch. Ideas
anyone?

That is exactly the problem. EXIF/IPTC were fashionable in python circles
some years ago but apart from a long-dead sourceforge project and a
couple of read-only modules, nothing really came out of it.

In fact, I was coincidentally searching for just such a thing when I came
across a pointer to Phatch, a few days before you announced it here...
 
I

Istvan Albert

I'm pleased to announce the release of Phatch which is a
powerful batch processor and renamer. Phatch exposes a big part of

This program is fantastic! Very accesible user interface and produces
ggreat images.

Thanks!

Istvan

PS. the name Phatch is a bit hard to prononunce (easily confusable
with fetch), it is not easy to talk about it in a live conversation.
You should just call it photo-batch, in the end all the acronym saves
you is four letters and you lose the obvious meaning of what the tool
does. Anyhow, just a suggestion based on the first impressions, great
tool, great functionality. We can surely nominate it for the best
Python based tool of 2008 ... so far ;-)
 
M

Mike Driscoll

Fred Pacquier <xnews2 <at> fredp.lautre.net> writes:





Even without python-pyexiv2 Phatch features read-only EXIF support thanks to
PIL. So you can name your files or write data stamps (date, aperature, velocity,
...) based on EXIF information. If you want to save EXIF and IPTC information to
files you need python-pyexiv2. From its website:
"However, the library and all the tools used are cross-platform, so very little
tweaking should be needed to get it to work fine on Windows or MacOS X."http://tilloy.net/dev/pyexiv2/developers.htm

The exiv2 website says:
"The Windows package only contains the command line utility exiv2.exe
(statically linked), manpage and a sample command file; get the source and doc
packages for the library, documentation and other tools."http://www.exiv2.org/download.html

So maybe someone can compile it.


I'm confused. What needs to be compiled exactly? Are there any
directions? I'm not seeing any at that website. I can give it a go if
someone can give me advice.
But... Phatch is designed with flexibility in mind. If someone can point me to a
free python library for Windows for EXIF and other metadata, I'll be happy to
integrate support for it in Phatch. Ideas anyone?

Or you could write a python wrapper around the executable.

Stani

Thanks,

Mike
 
S

SPE - Stani's Python Editor

I'm confused. What needs to be compiled exactly? Are there any
directions? I'm not seeing any at that website. I can give it a go if
someone can give me advice.
You need to compile two things:
1. the exiv2 library
2. the python-pyexiv2 bindings

For the exiv2 library, you will have to dive into the project:
The Windows executable provided here was compiled with the MinGW cross
compiler on an Intel 32 bit machine running Debian.

Maybe the exiv2 Yahoo! group is the right place to be. If you look
there for Windows threads maybe some might be helpful:
http://uk.groups.yahoo.com/group/exiv2/message/956

The author of python-pyexiv2 is active there as well and explains his
project uses Scons:
http://uk.groups.yahoo.com/group/exiv2/message/1002

I am not an expert on compiling extensions. In fact I only know
Python. A windows version of exiv2 and python-pyexiv2 will only exist
if some Windows programer(s) take the initiative.

In case you can't compile, it wouldn't be so hard to write a wrapper
around the provided windows executable to mimic the API of python-
pyexiv2.

I am afraid I can't help you more.

Stani
 
S

SPE - Stani's Python Editor

This program is fantastic! Very accesible user interface and produces
ggreat images.

Thanks!

Istvan

PS. the name Phatch is a bit hard to prononunce (easily confusable
with fetch), it is not easy to talk about it in a live conversation.
You should just call it photo-batch, in the end all the acronym saves
you is four letters and you lose the obvious meaning of what the tool
does. Anyhow, just a suggestion based on the first impressions,
I like the name Phatch as it close to "patching photos" as well. Most
people remember it as a contraction of PHoto bATCH, which I would not
use as a name because it is too general and many programs are called
like that. Phatch is also not such a polluted namespace when you
google. There only seems to be chef cook called Phatch, of which I now
follow his recipes through Google Alerts. That is rather amusing than
disturbing.
great
tool, great functionality. We can surely nominate it for the bestPythonbased tool of 2008 ... so far ;-)
Well, thanks a lot for all the compliments. Feel free to spread the
word or to get involved:
- by contributing back on the wiki (tutorials, review my non-native
english, screencasts, ...)
http://photobatch.wikidot.com
- by translating:
https://translations.launchpad.net/phatch/trunk/+pots/phatch
- at the moment Phatch has no known bugs, I really wish someone could
fine one so I can fix it:
https://bugs.launchpad.net/phatch/

I hope a lot of people give this program a try as it only requires you
to set up wxPython and PIL.

Stani
 
S

Steve Holden

SPE - Stani's Python Editor wrote:
[...]
Well, thanks a lot for all the compliments. Feel free to spread the
word or to get involved:
- by contributing back on the wiki (tutorials, review my non-native
english, screencasts, ...)
http://photobatch.wikidot.com
- by translating:
https://translations.launchpad.net/phatch/trunk/+pots/phatch
- at the moment Phatch has no known bugs, I really wish someone could
fine one so I can fix it:
https://bugs.launchpad.net/phatch/
I just reported a Windows font issue.
I hope a lot of people give this program a try as it only requires you
to set up wxPython and PIL.
I also blogged about it

http://holdenweb.blogspot.com/2008/02/phatch-photo-batch-processor.html

so my reader may take a look :)

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top