Short: Pans image, producing video frames Author: jbb@airvideo.net (Jim Belcher) Uploader: jbb airvideo net (Jim Belcher) Type: util/rexx Version: 0.9 (Beta) Requires: PPaint 7.1, ARexx, A4000 (2 meg chip ram), and possibly OS3.0 Architecture: m68k-amigaos Distribution: This script may be freely distributed amongst Amiga and Draco users, provided that all the contents are distributed with the script. What is this thing? For some time, I've wanted a simple way to pan across photographs, producing individual video frames. There may be offerings for the Amiga, but I haven't spotted them (or possibly they cost too much money, and I haven't evaluated the package!). It would be nice to scan in a photo, somewhat larger than the desired size for the final image, specify a start and end point for a pan across the photo, and get frames as a result. That's what this AREXX script does. I intend this script to be used to produce frames for Movie Shop/VLAB/Draco. That doesn't mean it won't produce frames for say, an anim, or some other frame playing program. It does mean I'm testing it with Movie Shop, and you can be relatively certain it works satisfactorily with that software. You can be less certain about it's functionality with other software, but it may very well work satis factorily for your purposes. For example, to create the demonstration anim, I imported the frames pan created into DPaint V. Sharp eyed readers will note the animation is stored with a PPaint ICON: t hat's because I didn't want to create the need for anyone to have anything but PPaint. I only put ten frames in this pan, to keep the distribution size small, yet demostrate what it does. It really n eeds about 150 frames to avoid the jerkiness. What do I need? Nothing that isn't or hasn't been available on Aminet. But I'll discuss that as I explain how the program works, and its uses and limitations. Install PPaint somewhere convenient, and copy the Pan.Re xx script into the PPaint Rexx directory. You'll launch the script from the Icon, so be sure it's present also. I have an assign for PPaint; it would be a good idea if you did also. How does it work? As I said before, I'd wanted a panning program for some time. I have a small video business, and I'd like to supplement the video I shoot with a pan of some of the excellent stills my wife captures. I considered reading in the IFF files, decoding the file, doing the pan, and generating the frames, but it was all just too much work. I wasn't going to have a pan tool in this lifetime. I decided to base the tool around an existing program, which could already read and write graphics files, and which could move around within a picture larger than the screen. PPaint does these things, and accepts AREXX commands. I found a few things I wish it did do (or perhaps I don't yet understand how it does them). I wrote an AREXX script which calls PPaint to do the dirty work. This is a BETA version, with all that implies. I could either wait around until I tested many more cases, and resolved some of the problems I was having understanding a couple of commands, or relea se a working version with some limitations. I chose to do the latter. If this script is of use to you, but something doesn't work as desired, let's work together and improve the tool. By distributing this as a Beta, you get the advantage of earlier availability, and influencing what features get added. I get the benefit of additonal debuggers and idea sources. The script considers three cases: a vertical pan, a horizontal pan, and a diagonal pan (the cases were treated separately for technical reasons). Most of the time, I just need a horizontal pan. Nothi ng fancy, no scaling, no variable pan rates, etc. Once in a while, I need a vertical pan. And even less frequently, I need a diagonal pan. I've tested the horizontal and vertical pans pretty thorough ly; the diagonal pan has been tested less thoroughly. First off, after installation and assigning PPaint, scan in a photo. I've supplied a sample photo (Beach.jpg) for a horizontal scan with the archive. When you scan your photos, I recommend you scan t hem slightly larger than the largest dimensions you'll need*. Look at the photo in PPaint. Decide where you want the scan to start and end. This beta version of Pan is hard coded to produce 640x464 i mages, which by some coincidence, is the size frames I have Movie Shop set to accept. What scanner or scanning software you use is entirely up to you. PeeCee stuff is cheap (and almost worth what you pay for it), so I use one as a peripheral to my Amigas, and scanned the image in it. PPaint7.1 will read a fairly wide variety of image formats, so make life easy. The output, though, will be IFF. I look at the image in PPaint, enable the coordinate locator, and simply move the cursor to what looks like a good center for the first image, note the coordinates, then do the same for the end point . You'll need these numbers later, so write them down! The Pan.rexx script (screen grab 1) will launch PPaint, so it isn't necessary to have it running before starting the script. However, PPaint has an annoying way of interrupting your typing, if you do n't already have it running. I haven't tested having PPaint already running before starting the script under a variety of conditions, so if you have trouble, you might try not starting PPaint first. When you click on the Pan.rexx script, you'll get a requester. The second screen grab shows most of the dialog Pan will have with you. My source image happened to be located in an assign named 'Source:', and was named 'Beach.jpg.' That's the sample image supplied. My destination path was Video1:Beach. Video1 is a drive partition I u se for (guess what?) videos, and Beach was a directory I set up earlier for this pan. Note that no "/" is required after the path; Pan will add it. Be sure there are no old frames in the destination path whose names start "PIC..", or Pan may hiccup. My earlier check showed that I wanted the pan to start at a center of 786, 232 (X,Y). That's well to the right of center. My end point was 320, 232 (X,Y). 320 is as far left as one can go in any imag e; 232 is as far up as one can go. I chose 10 as the number of frames. If this number is too small (several pixels per step), the pan will be jerky. If it's too large, the whole thing is going to move as slow as molasses in January. P ick a number which matches your image. Pan will handle as many as 999 frames. That's 30+ seconds in NTSC, or almost 40 seconds in PAL. Surely no one wants a plan that long! If I were doing this parti cular pan for use in a video, I'd probably pick 150 to 300 frames. Note that this will produce 30 to 70 megabytes of images: you need a lot of memory to do video and animations. Pan pretty much takes over at this point. You'll see PPaint step along frame by frame, saving frames to disk. Pan creates files in your stated path with the names "PIC0001 .. PIC0999". When the fat l ady is through singing, it will stop. Limitations I again emphasize that this is a Beta version. If there is enough interest and positive suggestions, I will consider additional work on the script. Right now, it: * Is limited to 640x464 output * Is limited to 256 colors * Does not scale images and therefore: * Does not zoom in or out * It eats a lot of chip memory! I admit I'd like the option of a different numbmer of colors, and I can see easily why PAL users would like a different resolution. If there's enough demand, it would not be difficult to add a PAL as pect ratio. But a broad, user selectable ratio is harder to achieve. The chip memory is a limitation of using PPaint as a base. I doubt the program has much value on anything but an A4000 with 2mbyte of chip ram, and a lot of disk storage (I have 2 mbytes of chip, 70 mbytes of fast, and 16gb of disk). Decreasing the number of colors would decrease the amount of chip ram, but obviously have less dedsirable effects. Have fun! Email me your ideas! I'd love to see any animations you produce. *The size of your photo determines the amount of chip memory you'll need. But it obviously must be larger than the pan distance, plus the frame size. Elements in the Distribution: Pan.rexx (the Arexx script) Beach.jpg (the sample scanned image) ArexxIcon (the screen grabbed copy of the Rexx startup icon) ConsoleWindow (the screen grabbed copy of the script dialog) readme (the thing you're reading!) Beach.anim (an anim of the result - also runs under PPaint) Credits The PPaint startup part of the script is cloned directly from one of Cloanto's PPaint Rexx scripts. I figure they should know how to start up their own program better than anyone else, so why try to compete?