Page 1 of 1

Trying to help Jestr - Need program to clip JPGs

Posted: 25.03.2005, 23:54
by NeilF
Looking to help Jestr with something... Is anyone aware of a straight forward program simply to clip JPGs? It would have to be dos or command line ideally, and could also do wildcards.

eg: jpgclip *.jpg 500 300 (clip all jpg files in directory to 500x300)


Anyone aware of such a program?


I've done a google but strangely can't find one!

Posted: 26.03.2005, 00:36
by TERRIER

Re: Trying to help Jestr - Need program to clip JPGs

Posted: 26.03.2005, 00:43
by Harry
ImageMagick can do this, and I am pretty sure that NetPBM can do it as well.

Harald

Posted: 27.03.2005, 14:04
by NeilF
TERRIER wrote:Is this any good ?

http://kfoo.net/products/imgman/#


Thanks, but it has no clip function :(

Posted: 27.03.2005, 14:50
by selden
I suggest you install either NetPBM or ImageMagick or both.

Here are some sample NetPBM commands:

Code: Select all

# cut out an appropriate region of a jpeg image
# convert from JPEG to PPM format as required by NetPBM
jpegtopnm big.jpg >tmp1.ppm
# cut out region
pnmcut -top 5 -height 128 -left 4 -width 256 tmp1.ppm >tmp2.ppm
# convert to PNG
pnmtopng tmp2.ppm >small.png

Posted: 27.03.2005, 19:02
by NeilF
selden wrote:I suggest you install either NetPBM or ImageMagick or both.

Here are some sample NetPBM commands:

Code: Select all

# cut out an appropriate region of a jpeg image
# convert from JPEG to PPM format as required by NetPBM
jpegtopnm big.jpg >tmp1.ppm
# cut out region
pnmcut -top 5 -height 128 -left 4 -width 256 tmp1.ppm >tmp2.ppm
# convert to PNG
pnmtopng tmp2.ppm >small.png



These two things look like monsters to use? ie: You're not just running a single executable program, but having to do a installation and loads more?

There's nothing that can just be fired off easily from dos for example?

Posted: 27.03.2005, 19:23
by DaveMc
I haven't tried it but I think the excellent freeware image viewer Irfanview may be able to do this. It has Batch Conversion/Rename capability that includes image cropping and resizing in the advanced options.

Dave

Posted: 28.03.2005, 20:42
by NeilF
DaveMc wrote:I haven't tried it but I think the excellent freeware image viewer Irfanview may be able to do this. It has Batch Conversion/Rename capability that includes image cropping and resizing in the advanced options.

Dave


Someone else mentioned this program to me... Yes, it does it! Excellent!!

Posted: 29.03.2005, 11:28
by hjw
For LOSSLESS jpeg-cropping I use 'jpegtran'. It can do some
(limited) transformations WITHOUT lossy decoding/encoding.

EDIT: you may need the 'croppatch' to jpegtan to do cropping.

hjw

Posted: 29.03.2005, 14:50
by NeilF
hjw wrote:For LOSSLESS jpeg-cropping I use 'jpegtran'. It can do some
(limited) transformations WITHOUT lossy decoding/encoding.

EDIT: you may need the 'croppatch' to jpegtan to do cropping.

hjw


At last!!! A simple command line one! Nice!