jslice - Command line based JPEG slicing program ------------------------------------------------ ========= Purpose - jslice is designed to read in a JPEG file, and then allow you [the user] to select portions of it to be saved [also] as JPEG files. ============== Why do that? - If you've ever tried to make a WWW page out of a full-size JPEG splash-screen,complete with javascript buttons, then you'll understand that slicing your splash-screen into little bits can prove to be quite a nightmare. Worse still, is no sooner do you get that splash screen out, than the person who wants it says "Ermm... can we add something?" =============================== Oh, okay, so how do I use it? - Lets set the scene, you have a splash screen JPEG file called frontpage.jpg You wish to make lots of slices, named like fp001.jpg fp002.jpg ... fp013.jpg You also want the output quality of the JPEG to be 80%. First off, you need to work out the coordinates of the slices you wish to take out of your main JPEG file. Specifically, the opposing corners of your rectangular "slice". ie, here are the coordinates of slices that I wanted to take out of one of my splash screens NOTE - Comments are denoted by the 1st char of each line being a '#' # Start of the file... # # some arb comments # 0 0 120 24 reservations.html 120 0 200 24 location.html 200 0 270 24 rates.html 270 0 360 24 facilities.html 360 0 460 24 conference.html 460 0 570 24 restaurant.html 570 0 640 24 gallery.html 640 0 704 24 / # # This is just a spacer # 0 25 600 45 600 25 704 45 mailto:contact@somearbplace.com # # More spacers # 0 46 704 389 # #----end of the file The format of each line is x1 y1 x2 y2 <URL> Each line represents ONE slice. You'll also note that the slices are ordered left->right, top->bottom. Place these coordinates into a text file, say frontpage.cut (use vi or your other favorite form of torture). Then, finally, to put it all together, you run jslice in the following way... jslice frontpage.jpg fp frontpage.cut 80 jslice will dump the HTML to stdout, so u can redirect it to what ever file name you wish, ie... jslice frontpage.jpg fp frontpage.cut 80 > frontpage.html where ... frontpage.jpg is the source picture fp is the destination file[s] prefix frontpage.cut is the text file containing the slice coordinates 80 is the quality of the output JPEG's. So, that's it... nothing else. Enjoy. You can post your compliments to jack@spyda.co.za, and your complaints to /dev/null ;)