Image crop, resize and CMYK conversion. Save and reload in TIFF format

This scribus scripter script crops and resizes an image, saves it and reloads it in TIFF format. Optionaly, converts color space to grayscale, RGB or CMYK (not recomended, as PIL CMYK don't generate the black plate. Let Scribus do the job). Needs Scribus 1.3.8 and uses Python Image Library.

Use: select a frame with image and run the script. It will create and load a new cropped TIFF image.

Quality matters: The major issue with automatic cropping is JPEG images. JPEG images are compressed in blocks (I think 4x4 pixels, but it might be 16x16). If you crop through a block, that block needs to re-compressed (affecting the quality of the image). So cropping needs to be "rounded" to the nearest block border to make it lossless. I think most other format can be losslessly cropped without problems.

Caveat: PIL currently freezes Scribus in Ubuntu 10, if run as menu script, due to an Ubuntu bug. Runs OK in Scripter console (F9 keystroke) and in Windows XP or Wine.