Page 1 of 1
PGB format
Posted: Fri Sep 24, 2004 1:38 pm
by pizza
I have the following question. First of all what is PGB? Is it a greyscale image?
As far as I understand pixels there are coded with intensivity of black (or white?) 0-255.
How can I retrieve those numbers from the image file, i.e. how can I obtain a txt file with mere numbers (codes of the pixels)? Can I do this with XnView?
I would greately appreciate your reply!

Posted: Fri Sep 24, 2004 1:44 pm
by pizza
Sorry! not PGB, but PGM format!
Posted: Fri Sep 24, 2004 10:01 pm
by Lostclown
You are right that PGM is a grayscale format.
A description of the PGM format can be found
here.
Don't think XnView can show you the hex codes for the pixels.
A hex editor would probably be better for that purpose.
Hexplorer is a freeware hex editor that I can recommend. It can be found
here.
Lostclown
Re: PGB format
Posted: Sat Sep 25, 2004 10:45 am
by xnview
pizza wrote:I have the following question. First of all what is PGB? Is it a greyscale image?
As far as I understand pixels there are coded with intensivity of black (or white?) 0-255.
How can I retrieve those numbers from the image file, i.e. how can I obtain a txt file with mere numbers (codes of the pixels)? Can I do this with XnView?
I would greately appreciate your reply!
You an use "View as hexa", or "Display color information".
Pierre.
Posted: Sun Sep 26, 2004 5:44 pm
by pizza
Many thanks for you reply! Please tell me, the file below is a standard plain PGM? I need to recognize this "plain text". So, what are necessary attributes of this file? Is # feep.pgm a commentary? And what is P2?
Very waiting on your reply.
P2
# feep.pgm
24 7
15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0
0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0
0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Posted: Sun Sep 26, 2004 7:01 pm
by xnview
pizza wrote:Many thanks for you reply! Please tell me, the file below is a standard plain PGM? I need to recognize this "plain text". So, what are necessary attributes of this file? Is # feep.pgm a commentary? And what is P2?
Very waiting on your reply.
P2
# feep.pgm
24 7
15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0
0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0
0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Yes # feep is a comment, and P2 the format of picture, here a greyscale ascii file!
Pierre.
Re: PGB format
Posted: Tue Sep 28, 2004 10:07 pm
by Lostclown
xnview wrote:
You an use "View as hexa", .....
Pierre.
Yet another feature of XnView I was not aware of

Actually I didn't even think of looking for it in XnView.
Great.
Lostclown