PGB format

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
pizza

PGB format

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

:D
pizza

Post by pizza »

Sorry! not PGB, but PGM format!
Lostclown
Posts: 99
Joined: Thu Jul 22, 2004 12:21 am
Location: Iceland

Post 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
User avatar
xnview
Author of XnView
Posts: 46362
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: PGB format

Post 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.
pizza

Post 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
User avatar
xnview
Author of XnView
Posts: 46362
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post 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.
Lostclown
Posts: 99
Joined: Thu Jul 22, 2004 12:21 am
Location: Iceland

Re: PGB format

Post 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
Post Reply