[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]
Simon Waters wrote: > Julian Hall wrote: >> >> Does GIMP have this functionality? > > GIMP has a batch mode, and can also have modules added (including Python). > >> Tedious to do it for every picture, but better than doing every step >> manually. > > The netpbm tools are far better for bulk image manipulation. > > Of course you need some basic shell scripting skills, but it is so > useful (and cool) to be able to resize, crop, and handle so many > different image formats, so quickly. > > http://netpbm.sourceforge.net/doc/#prognotes > > The example above show, converting png to jpeg (why?), and how to > brighten and image, but there are a lot of other programs in the suite. > > > Say you have some "png" files and you want them all the same width as > they'll all appear on the same web page template, and saved as "jpeg" > files because the customer likes jpeg for some weird reason, but you > don't want any compression artifacts introduced into the jpegs. > > > So you start with a set of files.... > > for afile in photodir/*.png > do > ....magic goes here... > done > > > The first step in the pipeline is usually to covert the image to pnm, so > there are a load of programs names {imageformat}topnm. > > "pngtopnm $afile |" > > Then we want to make the resulting "pnm" the same width (say 200). > > "pnmscale -xsize=200 |" > > Then we want to convert to a jpeg, but preserve the quality. > > "pnmtojpeg -quality=100" > > And then save it to a file ">$afile.jpeg". > > > Putting it together; > > for afile in photodir/*.png > do > pngtopnm $afile | pnmscale -xsize=200 | pnmtojpeg -quality=100 >$afile.jpeg > done > > And you can use "mmv" to rename them if the ".png.jpeg" ending offends > your sensibilities. > > It may seem a bit weird at first, but this is exactly how Unix/Linux was > suppose to be used. Lots of small programs, that are efficient and do > one task well, that hook together to produce a flexible system. If one > step in the pipeline fails, it just skips that image. > > I use netpbm for thumbnails for product images for customer sites, and > that sort of thing. But because the programs mostly have obvious names > you can usually just type "pnm" (or type a graphic extension like > "png"), and use the Bash shell tab auto-completion to find which program > you need. Each program has a standard manual page, that explains its > options. > > Here is a list of the programs in Debians netpbm package..... > > 411toppm anytopnm asciitopgm atktopbm bioradtopgm bmptopnm bmptoppm > brushtopbm cmuwmtopbm eyuvtoppm fiascotopnm fitstopnm fstopgm g3topbm > gemtopbm gemtopnm giftopnm gouldtoppm hipstopgm icontopbm ilbmtoppm > imgtoppm jpegtopnm leaftoppm lispmtopgm macptopbm mdatopbm mgrtopbm > mtvtoppm neotoppm palmtopnm pamcut pamdeinterlace pamdice pamfile pamoil > pamstack pamstretch pamstretch-gen pbmclean pbmlife pbmmake pbmmask > pbmpage pbmpscale pbmreduce pbmtext pbmtextps pbmto10x pbmtoascii > pbmtoatk pbmtobbnbg pbmtocmuwm pbmtoepsi pbmtoepson pbmtog3 pbmtogem > pbmtogo pbmtoicon pbmtolj pbmtomacp pbmtomda pbmtomgr pbmtonokia > pbmtopgm pbmtopi3 pbmtoplot pbmtoppa pbmtopsg3 pbmtoptx pbmtowbmp > pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc pbmupc pcxtoppm pgmbentley > pgmcrater pgmedge pgmenhance pgmhist pgmkernel pgmnoise pgmnorm pgmoil > pgmramp pgmslice pgmtexture pgmtofs pgmtolispm pgmtopbm pgmtoppm > pi1toppm pi3topbm pjtoppm pngtopnm pnmalias pnmarith pnmcat pnmcolormap > pnmcomp pnmconvol pnmcrop pnmcut pnmdepth pnmenlarge pnmfile pnmflip > pnmgamma pnmhisteq pnmhistmap pnmindex pnminterp pnminterp-gen pnminvert > pnmmargin pnmmontage pnmnlfilt pnmnoraw pnmnorm pnmpad pnmpaste pnmpsnr > pnmquant pnmremap pnmrotate pnmscale pnmscalefixed pnmshear pnmsmooth > pnmsplit pnmtile pnmtoddif pnmtofiasco pnmtofits pnmtojpeg pnmtopalm > pnmtoplainpnm pnmtopng pnmtops pnmtorast pnmtorle pnmtosgi pnmtosir > pnmtotiff pnmtotiffcmyk pnmtoxwd ppm3d ppmbrighten ppmchange ppmcie > ppmcolormask ppmcolors ppmdim ppmdist ppmdither ppmfade ppmflash > ppmforge ppmhist ppmlabel ppmmake ppmmix ppmnorm ppmntsc ppmpat ppmquant > ppmquantall ppmqvga ppmrainbow ppmrelief ppmshadow ppmshift ppmspread > ppmtoacad ppmtobmp ppmtoeyuv ppmtogif ppmtoicr ppmtoilbm ppmtojpeg > ppmtoleaf ppmtolj ppmtomap ppmtomitsu ppmtompeg ppmtoneo ppmtopcx > ppmtopgm ppmtopi1 ppmtopict ppmtopj ppmtopuzz ppmtorgb3 ppmtosixel > ppmtotga ppmtouil ppmtowinicon ppmtoxpm ppmtoyuv ppmtoyuvsplit ppmtv > psidtopgm pstopnm qrttoppm rasttopnm rawtopgm rawtoppm rgb3toppm > rletopnm sbigtopgm sgitopnm sirtopnm sldtoppm spctoppm sputoppm st4topgm > tgatoppm thinkjettopbm tifftopnm wbmptopbm winicontoppm xbmtopbm > ximtoppm xpmtoppm xvminitoppm xwdtopnm ybmtopbm yuvsplittoppm yuvtoppm > zeisstopnm > > I'm told you can usually ignore (pbm, pgm, ppm) as they are hidden > behind the "pnm" commands most of the time. Certainly I get everything I > need done with "pnm" commands. > > The pnm ones....... you can just guess what half of them do. > > anytopnm bmptopnm fiascotopnm fitstopnm gemtopnm giftopnm jpegtopnm > palmtopnm pngtopnm pnmalias pnmarith pnmcat pnmcolormap pnmcomp > pnmconvol pnmcrop pnmcut pnmdepth pnmenlarge pnmfile pnmflip pnmgamma > pnmhisteq pnmhistmap pnmindex pnminterp pnminterp-gen pnminvert > pnmmargin pnmmontage pnmnlfilt pnmnoraw pnmnorm pnmpad pnmpaste pnmpsnr > pnmquant pnmremap pnmrotate pnmscale pnmscalefixed pnmshear pnmsmooth > pnmsplit pnmtile pnmtoddif pnmtofiasco pnmtofits pnmtojpeg pnmtopalm > pnmtoplainpnm pnmtopng pnmtops pnmtorast pnmtorle pnmtosgi pnmtosir > pnmtotiff pnmtotiffcmyk pnmtoxwd pstopnm rasttopnm rletopnm sgitopnm > sirtopnm tifftopnm xwdtopnm zeisstopnm > > Now why would I want to do this in something like the GIMP, often I'm > done before the GIMP would finish loading? Although a "previewing file > managers" which show a thumbnail view of every image in a directory is a > great help here, as you can spot when you mess up quickly. > > Anyone fancy a play -- try writing a script that makes outline/sketch > like versions of a directory of images, all at the same small size, > using png, and then looks around for a tool that ensures all the png > files are as small as possible. pnmconvol can be used as a kind of > Gaussian filter to do this. The ambitious can then add borders to them, > and mount them in montages. It should be much more than the example given. AMAZING. Why was there so much enthusiasm about imagemagick when we have this!?!? -- The Mailing List for the Devon & Cornwall LUG http://mailman.dclug.org.uk/listinfo/list FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html