I decided to beef up this page a bit, since we get a number of questions about whether a script can be written for some task or other, and one quickly realizes that it takes some time to find all the scripts that deal with such a task. What people really need is a quick survey of what's out there, so that they can either modify some existing script themselves, or be able to ask for help with the modification for their particular needs.
I'll try to start with simple scripts first, then go to more complicated or perhaps esoteric ones down the page.
This script does the simple task of taking an image file and making a standard image frame and loading it onto a page. In a modified state, it is one of the scripts included with Scribus, DirectImageImport.py.
The presumption is that you will then resize and reposition this image in most cases. One downside in the modified script is its need for PIL, the Python Imaging Library. The advantage of PIL is that you end up with a frame exactly dimensioned for the image, and importantly the frame ends in a state of scaled to frame proportionally, so resizing keeps the proportions.
With this idea that you have imported an image, but want to adjust various details about it, we come to Image Wizard. I confess I haven't tried this one to make sure it still works, but what it does is use tkinter to create a remote control-like structure for a number of manipulations as shown. While I can understand that for a Scribus novice this might seem a great tool, realistically most of these manipulations are easily done without a script. For example, right-clicking on an image frame brings up a context menu to adjust frame to image or image to frame. Flipping horizontally and vertically are one-click operations in the X,Y,Z tab.
You might also have a look at Align an Image in its Frame . This does the simple task of aligning an image in the frame, such as upper left corner or centering, again using tkinter, though here you can select multiple image frames at once before running the script.
Likewise, there is Scale an Image to Fill a Frame Proportionally. Just as with Image Wizard, this scaling of images is now done so easily on the main screen there is probably little need for this.
- Automatic import of images from a directory using a script
- Image crop, resize and CMYK conversion. Save and reload in TIFF format
- Making a photobook from a directory of images using a script