NetPBM jpeg->XPM

3D/2D CGI and the tools used in their creation (Maya, Photoshop, Blender, GIMP, etc.).
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
whiter
Posts: 975
Joined: Tue Apr 29, 2003 2:02 pm
Location: Melbourne, Australia
Contact:

NetPBM jpeg->XPM

Unread postby whiter » Sun May 18, 2003 2:44 am

I am trying to convert a bunch of .jpg files into .xpm format so I can use them as background.
It is quite a bunch so I want to do it in a batch using NetPBM.

But when I try this on a file, using something like this:

Code: Select all

jpegtopnm filename.jpg |  ppmtoxpm  > filename.xpm

It creates an invalid file. No program can read it.

What am I doing wrong?
Shall I describe it to you? Or do you want me to get you a box?

User avatar
dexter1
Moderator
Moderator
Posts: 2735
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Unread postby dexter1 » Sun May 18, 2003 6:08 am

'convert' from the imagemagick suite is much more flexible for this task. You can use convert in batch files, crop and scale on-the-fly, whatever...

User avatar
whiter
Posts: 975
Joined: Tue Apr 29, 2003 2:02 pm
Location: Melbourne, Australia
Contact:

Unread postby whiter » Sun May 18, 2003 6:52 am

NetPBM conversion to XPM is just broken. It's the only program that won't do it right. ImageMagick's convert indeed works well.
But when I give the '-scale 1280x1024' option, it converts my (1024x768) images to 1280x960. I understand that it's doing a uniform scale, but that's not what I want. I want it to scale it to the exact size I give in the commandline.
Shall I describe it to you? Or do you want me to get you a box?

User avatar
dexter1
Moderator
Moderator
Posts: 2735
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Unread postby dexter1 » Mon May 19, 2003 12:00 am

try -sample instead of -scale


Return to “SGI: Computer Graphics”

Who is online

Users browsing this forum: No registered users and 1 guest