Portable Graymap

Portable Graymap
Name Portable GrayMap
Abkürzung PGM
Dateiendung .pgm
Hersteller Sun Microsystems
Farbraum Graustufen
Farbtiefe 8 Bit - 256 Graustufen (binär)
im ASCII Mode sind auch mehr Graustufen möglich
Kompression keine
Byteorder ---

PGM (engl. Portable GrayMap) ist ein proprietäres Dateiformat zur Speicherung von Bilddaten.

Das PGM-Format wurde in den achtziger Jahren von Sun Microsystems entwickelt. Es kommt in zwei Varianten vor, ASCII und Binär.

Inhaltsverzeichnis

Aufbau einer PGM-Datei

ASCII-Format

  • als Whitespace sind Leerzeichen, Tab, CR und LF erlaubt
  • Kommentare beginnen mit # und gehen bis zum Ende der Zeile
  • die Zeilen sollten nicht länger als 70 Zeichen sein
  • alle Zahlen werden in ASCII in Dezimalschreibweise angegeben
Identifikation: 'P2'
Bildbreite
Bildhöhe
maximaler Grauwert
Bilddaten (Breite*Höhe)
Der Dezimalwert gibt den Graustufenwert an, der zwischen 0 und dem angegebenen Maximalwert liegen darf.

Beispiel:

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

Binär-Format

  • Identifikation ist 'P5'
  • die Pixeldaten werden in binärer Form gespeichert
  • innerhalb der Pixeldaten sind keine anderen Zeichen erlaubt
  • Vorteil: die Dateien sind kleiner und schneller zu lesen und zu schreiben
Identifikation: 'P5'
Mindestens ein Zeichen Whitespace (\n, \r, \t, space)
Bildbreite (ASCII Dezimal)
Mindestens ein Zeichen Whitespace (\n, \r, \t, space)
Bildhöhe (ASCII Dezimal)
Mindestens ein Zeichen Whitespace (\n, \r, \t, space)
maximaler Grauwert [kleiner als 65536] (ASCII Dezimal)
Genau ein Zeichen Whitespace (\n, \r, \t, space)
Bilddaten in binärer Form (Zeilenweise, von links nach rechts und oben nach unten)

Pro Pixel jeweils ein Wert zwischen 0 und dem angegebenen Maximalwert. Bei einem Maximalwert unter 256 geschieht dies mit einem Byte, darüber mit zweien (Höherwertiges Byte zuerst)

Beispiel:

Im nachfolgenden Beispiel sind Identifikation, Höhe, Breite und Maximalwert fett hervorgehoben, die Bilddaten kursiv.

00000000  50 35 20 20 20 0a 0a 0a  20 20 20 0a 20 20 0a 09  |P5   ...   .  ..|
00000010  09 0a 20 0a 39 0a 20 0a  09 09 0a 20 0a 34 20 0a  |.. .9. .... .4 .|
00000020  20 0a 32 35 35 20 7a 21  21 21 7a 21 21 7a 21 7a  | .255 z!!!z!!z!z|
00000030  21 21 7a 21 7a 21 7a 21  7a 21 21 7a 21 7a 21 7a  |!!z!z!z!z!!z!z!z|
00000040  21 7a 7a 21 21 7a 21 21  7a 7a                    |!zz!!z!!zz|

Siehe auch

Weblinks


Wikimedia Foundation.

Игры ⚽ Нужно сделать НИР?

Schlagen Sie auch in anderen Wörterbüchern nach:

  • Portable graymap — Portable pixmap Portable pixmap Extension de fichier .ppm, .pgm, .pbm, .pnm Type MIME image/x portable pixmap, graymap, bitmap, anymap all unofficial Développé par Jef Poskanzer Type de format Format de fichier graphique …   Wikipédia en Français

  • Portable graymap (формат файлов) — …   Википедия

  • Portable anymap — Portable pixmap Portable pixmap Extension de fichier .ppm, .pgm, .pbm, .pnm Type MIME image/x portable pixmap, graymap, bitmap, anymap all unofficial Développé par Jef Poskanzer Type de format Format de fichier graphique …   Wikipédia en Français

  • Portable bitmap — Portable pixmap Portable pixmap Extension de fichier .ppm, .pgm, .pbm, .pnm Type MIME image/x portable pixmap, graymap, bitmap, anymap all unofficial Développé par Jef Poskanzer Type de format Format de fichier graphique …   Wikipédia en Français

  • Portable pixmap — Extension .ppm, .pgm, .pbm, .pnm Type MIME image/x portable pixmap, graymap, bitmap, anymap all unofficial Développé par Jef Poskanzer Type de format Format de fichier graphique Origine de XPM …   Wikipédia en Français

  • Portable anymap — Portable pixmap Расширение .ppm, .pgm, .pbm, .pnm MIME image/x portable pixmap, graymap, bitmap, anymap все неофициальные Разработан Джеф Посканзер Тип формата Графические форматы У этого термина сущ …   Википедия

  • Portable Pixmap — Vorlage:Infobox Dateiformat/Wartung/Standard fehltVorlage:Infobox Dateiformat/Wartung/Website fehlt Portable Pixmap Dateiendung …   Deutsch Wikipedia

  • Portable Bitmap — Vorlage:Infobox Dateiformat/Wartung/Standard fehltVorlage:Infobox Dateiformat/Wartung/Website fehlt Portable Bitmap Dateiendung …   Deutsch Wikipedia

  • Netpbm format — Portable pixmap Filename extension .ppm, .pgm, .pbm, .pnm Internet media type image/x portable pixmap, graymap, bitmap, anymap all unofficial Developed by Jef Poskanzer Type of format Image file formats …   Wikipedia

  • .pbm — Portable pixmap Portable pixmap Extension de fichier .ppm, .pgm, .pbm, .pnm Type MIME image/x portable pixmap, graymap, bitmap, anymap all unofficial Développé par Jef Poskanzer Type de format Format de fichier graphique …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”