Trying to help Jestr - Need program to clip JPGs

Tips for creating and manipulating planet textures for Celestia.
Topic author
NeilF
Posts: 35
Joined: 20.03.2005
With us: 19 years 3 months

Trying to help Jestr - Need program to clip JPGs

Post #1by NeilF » 25.03.2005, 23:54

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!

TERRIER
Posts: 717
Joined: 29.04.2003
With us: 21 years 2 months
Location: West Yorkshire, England

Post #2by TERRIER » 26.03.2005, 00:36

1.6.0:AMDAth1.2GHz 1GbDDR266:Ge6200 256mbDDR250:WinXP-SP3:1280x1024x32FS:v196.21@AA4x:AF16x:IS=HQ:T.Buff=ON Earth16Kdds@15KkmArctic2000AD:FOV1:SPEC L5dds:NORM L5dxt5:CLOUD L5dds:
NIGHT L5dds:MOON L4dds:GALXY ON:MAG 15.2-SAP:TIME 1000x:RP=OGL2:10.3FPS

Harry
Posts: 559
Joined: 05.09.2003
With us: 20 years 9 months
Location: Germany

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

Post #3by Harry » 26.03.2005, 00:43

ImageMagick can do this, and I am pretty sure that NetPBM can do it as well.

Harald

Topic author
NeilF
Posts: 35
Joined: 20.03.2005
With us: 19 years 3 months

Post #4by NeilF » 27.03.2005, 14:04

TERRIER wrote:Is this any good ?

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


Thanks, but it has no clip function :(

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 21 years 9 months
Location: NY, USA

Post #5by selden » 27.03.2005, 14:50

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
Selden

Topic author
NeilF
Posts: 35
Joined: 20.03.2005
With us: 19 years 3 months

Post #6by NeilF » 27.03.2005, 19:02

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?

DaveMc
Posts: 79
Joined: 09.08.2003
With us: 20 years 10 months
Location: Woodinville, WA, USA

Post #7by DaveMc » 27.03.2005, 19:23

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

Topic author
NeilF
Posts: 35
Joined: 20.03.2005
With us: 19 years 3 months

Post #8by NeilF » 28.03.2005, 20:42

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!!

hjw
Posts: 66
Joined: 02.02.2004
With us: 20 years 5 months
Location: Schwabach/Germany

Post #9by hjw » 29.03.2005, 11:28

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

Topic author
NeilF
Posts: 35
Joined: 20.03.2005
With us: 19 years 3 months

Post #10by NeilF » 29.03.2005, 14:50

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!


Return to “Textures”