Article View: alt.sys.pc-clone.dell
Article #418Re: Batch image processing [Was: Cropping Photos]
From: Toke Eskildsen
Date: Mon, 12 Apr 2004 15:05
Date: Mon, 12 Apr 2004 15:05
32 lines
2776 bytes
2776 bytes
Crossposted to alt.sys.pc-clone.dell, alt.comp.freeware and aus.photo, follow-up to alt.comp.freeware Phred wrote: > [...] I would like to be able to set > up a batch job to edit the files (JPEGs probably, perhaps GIFs > too) and crop them to the same set of specified coordinates within > the image (say the rectangle contained within 45,25/650,410 pixels > or whatever from the bottom left corner for example). There's two obvious choices from my point of view: Use IrfanView or do it losslessly using JPEGTran. IrfanView provides the functionality under Batch Conversion | Use advanced options. The lossless way: If you download jpegtran from http://sylvana.net/jpegcrop/jpegtran/ and create the following batch file (open notepad, paste the code below and save as "crop.bat" (do write the quotes to get notepad to understand that you really mean to save the file with an extension that isn't .txt)), running the batch file will crop all the JPEG images in the current dir and put them in the subdir "cropped": **** crop.bat **** mkdir cropped FOR %%A IN (*.jpg) DO jpegtran -crop 320x200+16+48 %%A cropped\%%A ****************** The position of the crop area has to be a multiple of the iMCU size, which is practically always 8 or 16, depending on the image.
Technical Details
Message-ID:
<Xns94C9ADF4A6A4Dtokeeskildsen@130.133.1.4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!82.150.72.24!not-for-mailReferences:
<xnWdc.7055$YX5.1173@newssvr31.news.prodigy.com> <95ng70d5i4vb1hk77270njps91mh8g67bo@4ax.com> <w%_dc.181$nt3.5@newssvr15.news.prodigy.com> <c5bjs8$2i6qo7$2@ID-151056.news.uni-berlin.de> <MPG.1ae3a08d86f7911798a379@news.individual.net> <c5e97l$lcuc$1@ID-151056.news.uni-berlin.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 112049,33490ce3a30fc696 X-Google-Attributes: gid112049,public X-Google-Thread: 10a33e,970d263e446d6ac2 X-Google-Attributes: gid10a33e,public X-Google-Thread: 109d17,33490ce3a30fc696 X-Google-Attributes: gid109d17,public X-Google-ArrivalTime: 2004-04-12 08:05:53 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!82.150.72.24!not-for-mail From: Toke Eskildsen <darkwing@daimi.au.dk> Newsgroups: alt.sys.pc-clone.dell,alt.comp.freeware,aus.photo Subject: Re: Batch image processing [Was: Cropping Photos] Followup-To: alt.comp.freeware Date: 12 Apr 2004 15:05:52 GMT Organization: Tokenizer Lines: 32 Message-ID: <Xns94C9ADF4A6A4Dtokeeskildsen@130.133.1.4> References: <xnWdc.7055$YX5.1173@newssvr31.news.prodigy.com> <95ng70d5i4vb1hk77270njps91mh8g67bo@4ax.com> <w%_dc.181$nt3.5@newssvr15.news.prodigy.com> <c5bjs8$2i6qo7$2@ID-151056.news.uni-berlin.de> <MPG.1ae3a08d86f7911798a379@news.individual.net> <c5e97l$lcuc$1@ID-151056.news.uni-berlin.de> NNTP-Posting-Host: 82.150.72.24 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de 1081782352 750127 I 82.150.72.24 ([172336]) User-Agent: Xnews/5.04.25 X-Face: ?e?Mj)qP0nl)'Vl$Rg[>zi#lW0pxAfP+F2J&/O7.(TN)&p)z]z(~'!!?pf6&iE2,PdAx!7^WtZP)w)OUC5Msc12<MD"H``5@!PW3'FQrBOh(0jlD~'eypg0t%=a/7~$Vp)m$Kdipjhb:1*Rvn24!-")Gb=cxDE~e)c6ocL<:DE%)3mQa