Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'converting images to PGM format and importing t...' topicStudent Support Forum > General > "converting images to PGM format and importing t..."

Next Comment >Help
Author Comment/Response
Sachin Shinde
12/25/06 7:14pm

I have a few questions regarding the article "How do I convert my existing graphics files to data files that Mathematica can import?" in the Technical Support FAQ at http://support.wolfram.com/mathematica/graphics/contourdensity/imagedataimport.html
The article states that when you convert the image to Portable Greymap(PGM), you will have a text file that looks something like this.
--------------------------------------------------
P2
# Created by
210 266
255
127 127 127 126 126 125 125 128 122 123 123 122 125 129 129 127 121 120
121 123 122 123 127 131 130 127 122 117 110 97 88 89 91 102 103 99 100
101 99 99 109 109 110 101 99 107 106 111 117 124 131 129 119 117 119 118


(* lots and lots more numbers *)
--------------------------------------------------

But when I convert my JPEG files to PGM format and view them in Microsoft Word or Notepad as a text file, I get this.
--------------------------------------------------
P5
#Created by
3648 2736
255
,**-/.,-0*(('*'))//100,/--/--*)))*()()')++)*&&*+/1243233..)())(+%&&'),,'%'')',+0045432.,,*'(+)$%&! $""! " !!#%%##"!!%&$!%%%'&%$#! ##$%&)*(&#$## $%" !!#&%&! ! "#"!"""$#$#$),./01000/1447;652/,*&


(* lots and lots more symbols *)
--------------------------------------------------
I have tried many different format converters, but they still yield the same text file in PGM format. Could you tell me why the text file in the article differs from the one that I get when I actualy convert the image? Could you also tell me of the different data file formats for graphics that Mathematica can accept along with techniques used to convert the resulting data from the imported graphic with the specified data file format into data that I can apply functions(such as ListDensityPlot) to in Mathematica?

URL: ,

Thread 'converting images to PGM format and importing t...' is now CLOSED
Author Date Posted
converting images to PGM format and importing t... Sachin Shinde 12/25/06 7:14pm
Re: converting images to PGM format and importi... Peter Pein 01/08/07 2:11pm
Next Comment >Help