LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-08-2006, 03:29 AM   #1
slomek
LQ Newbie
 
Registered: Feb 2006
Distribution: Debian Etch
Posts: 8

Rep: Reputation: 1
Converting .ppm images...


I need to resize an image in .ppm format. The issue is that I need the output file in
TEXT (not binary) format. I know that GIMP manages to do it but I need a command line tool.
I think that convert will be good, but I cant make it give text format (always gives binary). Maybe someone knows some good option...
 
Old 05-08-2006, 04:40 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
I'm not sure what you mean by "text format" for an image file - do you want to convert the image to ascii-art? Or do you just want all the bytes to be in the range of regular characters?

Anyway - if you run "apropos ppm" in terminal, you'll get the full list of converters. You may need to convert to an intermediary for some formats (eg eps).

For ascii art - you need to hunt down a cli ascii art program for your distro - http://en.wikipedia.org/wiki/ASCII_art

BTW: please edit your profile to show your distro - this will help folk give you specific assistance.
 
Old 05-08-2006, 04:48 AM   #3
slomek
LQ Newbie
 
Registered: Feb 2006
Distribution: Debian Etch
Posts: 8

Original Poster
Rep: Reputation: 1
text (actually ascii) format meant that every pixel is viewed as three numbers- values of R,G and B. When you open the .ppm file in text editor, you can see it as visible numbers not hashes.
I've just managed to convert .ppm file to ascii .ppm file with 'pnmnoraw file_in > file_out'.

PS I've just entered my distro name Thanks!
 
Old 05-08-2006, 05:02 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Ah right - you see the GIMP has a save-to setting called "text" which does ascii art. Yep - raw format is what you wanted.
Code:
$ apropos pnm | grep raw
pnmhistmap (1)       - draw a histogram for a PGM or PPM file
pnmnoraw (1)         - convert portable any map to plain (ASCII) anymap format
... apropos does the trick
 
Old 05-08-2006, 06:08 AM   #5
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
slomek,
have you check mogrify command line tool which is very powerful in terms of reasizing, changing, converting image to other image type. Its part of ImageMagick Package.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting 3d CAD images Simon_6162 Linux - Software 0 08-22-2005 01:26 PM
Batch converting images ObsessiveMathsFreak Linux - Software 6 06-10-2005 12:18 PM
converting JPEG images to MPEG-2 video using <convert>? BeetleBailey Programming 3 06-11-2004 10:07 AM
converting .tif images to an animated .gif file with a script illiniguy3043 Programming 2 06-01-2004 04:11 PM
converting .tif images to an animated .gif file (Red Hat 7.2, bash shell) illiniguy3043 Linux - General 0 06-01-2004 02:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration