ANN: tiff2sth 0.2 - a tool for reading Cocoa TIFFs and converting with PIL

Dinu Gherman dinu@mac.com
Wed, 24 Sep 2003 14:26:31 +0200


This is to announce tiff2sth, a tool/module to convert TIFF files
to something else, namly other bitmap formats by using PIL on
Mac OS X. Doing so allows PIL to read such converted files which
otherwise it would not be able to. Please see the Readme below.

Regards,

Dinu

--
Dinu C. Gherman
......................................................................
"Of course America had often been discovered before Columbus,
but it had always been hushed up." (Oscar Wilde)


tiff2sth
========

Summary
-------

A tool for converting Cocoa TIFFs on Mac OS X to other bitmap formats.

Overview
--------

This module/tool is a first attempt at converting TIFF files created
on Mac OS X using the Cocoa classes NSImage and NSBitmapRep to other
bitmap formats, like JPEG, GIF, PNG, etc. The conversion is delegated
to PIL, the Python Imaging Library.

Basics
------

Because PIL is used for generating the destination bitmap, all of its
formats are available in principle. In practice, only JPEG, GIF and
PNG have been tested with the current code. BMP would require small
modifications only (removing the alpha channel).

History
-------

:0.2:   first release

Requirements
------------

You need PyObjC [1]_ and PIL [2]_ (both free) to run tiff2sth.

Licence
-------

tiff2sth is released under the GPL - see the included file, "GPL.txt".

Download
--------

The tiff2sth distribution, including two PDF input samples and TIFF
output samples, as well as a few tests, is available from:

   http://python.net/~gherman/tiff2sth.html

Notes
------

This is a crude hack and does not perform any checks whatsoever with
respect to compression, multi-TIFF files, etc. etc. But it does work
on the vanilla TIFFs I'm generating using Cocoa. More features might
be added later as needed.

The whole issue of writing this code is that PIL, up to version 1.1.4,
cannot read TIFF files generated from the Cocoa AppKit. You can use
tiff2sth, though, to generate files in a TIFF format which PIL does
understand and is able to reload (you just have to provide '.tif' as
extension for the destination file).

Future
------

More features and sanity checks might be added later as needed.

Links
-----

.. [1] http://pyobjc.sourceforge.net
.. [2] http://www.pythonware.com/products/pil

Author
------

Dinu Gherman,
dinu at mac dot com,
2003-09-24