Pgm File Header Format For Essay

File Formats: Portable Bitmap Utilities (PBM/PGM/PPM/PNM)

The Portable Bitmap Utilities consists of Portable Greymap Utilities (PGM), Portable Pixmap Utilities (PPM), and Portable Anymap Utilities (PNM). Their source is the UNIX environment.

File constants associated with this file format are:

ConstantRead SupportWrite SupportDescription
PbmBinary1 BPP1 BPPPortable Bitmap - Binary File.
PbmAscii1 BPP1 BPPPortable Bitmap - ASCII File.
PgmBinary8, 16 BPP (Grayscale)8 BPP (Grayscale)Portable Greymap - Binary File.
PgmAscii8, 16 BPP (Grayscale)8 BPP (Grayscale)Portable Greymap - ASCII File.
PpmBinary24 BPP24 BPPPortable Pixelmap - Binary File.
PpmAscii24 BPP24 BPPPortable Pixelmap - ASCII File.

Required DLL: Leadtools.Codecs.Pbm.Dll. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application .

Related Formats: BMP - Windows Bitmap Formats.

Platforms: .NET 2/3, .NET 4, Silverlight

LEADTOOLS Imaging, Medical, and Document

Introduction

Getting Started

LEADTOOLS Software License Agreement

Files to be Included with your Application

Files to be Included with your Java Application

Imaging Features

Basic Concepts

Bitmaps in Memory and in Files

RasterImageList Appearance

Introduction: Animation

Introduction: Bits Per Pixel and Related Ideas

Introduction: Color Resolution and Dithering

Introduction: Database Interaction

Introduction: Data Transfer

Introduction: DIBs, DDBs, and the Clipboard

Introduction: Image Display

Introduction: Image Manipulation and Analysis

Introduction: Palette Handling

Using DIBs, DDBs, and the Clipboard

Grayscale Images

Handling CMYK Files as Separate Images

Memory Storage Types for Images

RasterImage Serialization

Saving Window-Leveled Images

Speeding Up 1-Bit Documents

Super Compressed Images

Using Color Values in LEADTOOLS

Compression Quality Factors

Considering Development Systems

Compression Using LEAD and JPEG Formats

Differences Between GDI and WPF

Image Formats

Summary of All Supported Image File Formats

File Formats

Document File Formats: HyperText Markup Language (HTML)

Document File Formats: LEADTOOLS Temporary Document Format (LTD)

Document File Formats: Microsoft Rich Text Format (RTF)

Document File Formats: Microsoft Word Document (DOCX/DOC)

Document File Formats: Microsoft XML Paper Specification (XPS)

Document File Formats: Portable Document Format (PDF)

Document File Formats: Text

Document File Formats: Windows Enhanced Meta File (EMF)

File Formats: ABC (ABC)

File Formats: ABIC Format (ABIC, ICA)

File Formats: Adobe Digital Negative Format (DNG)

File Formats: AFP/PTOCA/IM1

File Formats: ANZ Formats

File Formats: Autodesk DWF XPS Format (DWFX)

File Formats: ArcInfo Interchange File Format (E00)

File Formats: BMP Formats

File Formats: CALS Raster Format

File Formats: Canon RAW Format (CRW)

File Formats: Cineon Format (CIN)

File Formats: Compressed Windows Metafile Format (WMZ)

File Formats: Computer Graphics Metafile (CGM)

File Formats: DGN (DGN)

File Formats: Corel Presentation Exchange Format (CMX)

File Formats: DICOM Format (DIC)

File Formats: Digital Camera Formats (DCF, NEF, ARW, NRW, ORF, RAF, RAW, RW2, SR2, SRF)

File Formats: Dr Halo (CUT)

File Formats: DRaWing (DRW)

File Formats: Drawing Interchange Format (DXF)

File Formats: DWF Format (DWF)

File Formats: DWG Format (DWG)

File Formats: Electronic Publication (ePub)

File Formats: Encapsulated PostScript (EPS)

File Formats: Enhanced Compressed Wavelet Format (ECW)

File Formats: ESRI Shape Format (SHP)

File Formats: Microsoft Excel Spreadsheet (XLSX/XLS)

File Formats: Exif Formats (TIFF and JPG)

File Formats: FITS (FIT)

File Formats: Flic Animation (FLC and FLI)

File Formats: GEM Image Format (IMG)

File Formats: Gerber Format (GBR)

File Formats: GIF

File Formats: HyperText Markup Language (HTML)

File Formats: Icons and Cursors (ICO and CUR)

File Formats: Image Object Content Architecture Format (IOCA/MODCA)

File Formats: Interchange File Format (IFF)

File Formats: Intergraph (ITG)

File Formats: Intergraph Raster Format (INGR)

File Formats: JBIG Format (JBG)

File Formats: JBIG2 Format (JB2)

File Formats: JPEG and LEAD Compressed (JPG, J2K, JPM, JPX, JP2, JLS, CMP, CMW)

File Formats: JPEG XR / Microsoft HD Photo File Format (HDP)

File Formats: Kodak Digital Camera Format (KDC)

File Formats: Kodak Formats (PCD and FPX)

File Formats: Kodak Professional Digital Camera Format (DCR)

File Formats: Kodak Professional Digital Camera System Format (DCS)

File Formats: LEAD 1-Bit Format (CMP)

File Formats: LEADTOOLS PDF with Mixed Raster Content (PDF)

File Formats: Macintosh Pict Format (PCT)

File Formats: MapInfo Interchange File Format (MIF)

File Formats: Microsoft FAX Format (AWD)

File Formats: Microsoft Windows Clipboard (CLP)

File Formats: Miscellaneous 1-Bit Formats (MAC. MSP)

File Formats: Mixed Raster Content (LEADTOOLS MRC)

File Formats: Mixed Raster Content (MRC)

File Formats: MNG Format (MNG)

File Formats: Mobipocket Format (MOBI)

File Formats: MS Access Report Snapshots Format (SNP)

File Formats: MS Windows Thumbnail Cache Format (TDB)

File Formats: Microsoft Word Document (DOCX/DOC)

File Formats: NAPLPS Format (NAP)

File Formats: PCX Formats (PCX and DCX)

File Formats: PhotoShop 3.0 Format (PSD)

File Formats: Portable Bitmap Utilities (PBM/PGM/PPM/PNM)

File Formats: Portable Document Format (PDF)

File Formats: Portable Network Graphics Format (PNG)

File Formats: PostScript Document Format (PS)

File Formats: Microsoft PowerPoint Presentation (PPTX/PPT)

File Formats: Personal Storage Tables, Messages and Emails (PST/MSG/EML)

File Formats: Printer Command Language Format (PCL)/(PCL-XL)

File Formats: PTOCA Format (MDOCA PTOCA)

File Formats: Raw

File Formats: Rich Text Format (RTF)

File Formats: Scalable Vector Graphics Format (SVG)

File Formats: Scitex Continuous Tone Format (SCT)

File Formats: Silicon Graphics Image Format (SGI)

File Formats: SMP Format (SMP)

File Formats: Structured Fax File Format (SFF)

File Formats: SUN Raster Format (RAS)

File Formats: SUN TAAC Bitmap Format (VFF)

File Formats: Text file format (TXT)

File Formats: TIFF (Tagged Image File Format)

File Formats: TIFF CCITT and Other FAX Formats (Raw, LaserView, CAL, TIFX, WFX)

File Formats: Truevision TARGA Format (TGA)

File Formats: Windows Animated Cursor (ANI)

File Formats: Windows Metafile Formats (WMF and EMF)

File Formats: Wireless Bitmap Format (WBMP)

File Formats: WordPerfect Graphics Format (WPG)

File Formats: X Window Dump (XWD)

File Formats: Image Cash Letter (X9)

File Formats: XBitMap (XBM)

File Formats: XML Paper Specification Format (XPS)

File Formats: XPicMap Format (XPM)

Miscellaneous 1-Bit Formats (MAC, IMG, and MSP)

WPF File Formats

Summary of All WPF Supported Image File Formats

File Formats: ABC Format (ABC)

File Formats: CALS Raster Format (CAL)

File Formats: DICOM Format (DIC)

File Formats: Flic Animation Format (FLC)

File Formats: GEM Image Format (IMG)

File Formats: GIF Format (GIF)

File Formats: HD Photo Format (HDP)

File Formats: Image Object Content Architecture (IOCA/MODCA) (ICA)

File Formats: Interchange File formats (IFF)

File Formats: Intergraph Format (ITG)

File Formats: JBIG2 Format (JB2)

File Formats: JPEG 2000 Compressed (JP2)

File Formats: JPEG Compressed (JPG)

File Formats: LEAD 1-Bit Format (CMP)

File Formats: LEAD Mixed Raster Content (LEAD MRC)

File Formats: MacPaint Format (MAC)

File Formats: Microsoft Paint (MSP)

File Formats: Microsoft Windows Clipboard (CLP)

File Formats: Mixed Raster Content (MRC)

File Formats: Multiple Network Graphics Format (MNG)

File Formats: PCX Format (PCX)

File Formats: PhotoShop 3.0 Format (PSD)

File Formats: Portable Bitmap Utilities Format (PBM)

File Formats: Portable Network Graphics Format (PNG)

File Formats: Silicon Graphics Image Format (SGI)

File Formats: SUN Raster Format (RAS)

File Formats: Tagged Image File Format (TIFF)

File Formats: Tagged Image File Format / CCITT (TIFF)

File Formats: Truevision TARGA Format (TGA)

File Formats: Windows Animated Cursor (ANI)

File Formats: Windows Enhanced Meta File (EMF)

File Formats: Windows Icons (ICO)

File Formats: Windows Metafile Formats (EMF)

File Formats: Windows Metafile Formats (WMF)

File Formats: WordPerfect Format (WPG)

File Formats: X WindowDump (XWD)

File Formats: Image Cash Letter (X9)

File Formats: XBitMap Format (XBM)

File Formats: Xionics Format (SMP)

File Formats: Microsoft Open XML Paper Specification Format (XPS)

File Formats: XPicMap (XPM)

Support Compression Using LEAD and JPEG Formats

Loading and Saving Images

Types of File Comments

DICOM File Comments

Exif File Comments

Exif File Extensions

GIF File Comments

IPTC Comments

JPEG 2000 File Comments

JPEG and LEAD File Comments

PNG File Comments

TIFF File Comments

Notes on Exif Data

Non-Image Data

Working with Markers

Multipage File Formats

A Special Note about Loading 12- and 16-Bit Grayscale Images

Controlling Progressive Loads and Saves

Conversion Considerations

Creating a Compressed PDF File

Implementing Exif Features

Implementing Extended FlashPix Support

Implementing GeoKeys (GeoTIFF tags)

Implementing GIF Features

Implementing JBIG Features

Implementing PDF Features

Implementing PhotoCD and FlashPix Features

Implementing TIFF Comments and Tags

LEAD Image Optimization Supported Formats

Loading and Saving Large TIFF/BigTIFF Files

Using the OptimizedLoad Functions to Speed Up Loading Large Files

Working With Private TIFF Tags

Loading File Codecs

PNG Files and Transparency

Programming With JPEG 2000 Features

Thumbnail Browser

Image Compression

Compression Using LEAD and JPEG Formats

Compressing and Decompressing Buffers

Compression Quality Factors

Programming With Jpeg2000 Features

Image Display

LEADTOOLS RasterImage and GDI/GDI+

Image Viewer

Using Image Viewer with Windows.Forms

Image Viewer Appearance

Image Viewer Items

Image Viewer Bounds and Transform

Image Viewer Transformation

Image Viewer Layouts

Image Viewer Rendering

Image Viewer Scrolling

Image Viewer Interactive Modes

Image Viewer Other Operations

Image Viewer Single Item Mode

Image Viewer Virtualizer

Image Viewer Drag and Drop

Image Viewer Sync

Handling Palette Changes

Flags for the PaintDisplayMode Property

Displaying Fax Images

Displaying an Image

Accounting for View Perspective

Changing Image Coordinates

Using the Paint Engine Property

Converting Curves

Implementing Animations

Implementing Custom Paint

Implementing Transparency

Overlay Overview

During one my Engineering Computing classes last semester, I was writing an example C program to create a PGM image file when I accidentally produced an interesting pattern. I had been using a simple function of the pixel coordinates x and y to quickly generate a pattern and I included a modulo operator to limit the maximum pixel value to 255. What I saw was something like the following:

Here’s the complete C code I used to produce that image:

// // PGM modulo pattern maker - Ted Burke, 13-2-2012 // #include <stdio.h> int main() { int x, y, w=640, h=480; // Open output PGM file FILE* f = fopen("pattern.pgm", "w"); // Print image header to file fprintf(f, "P2\n# batchloaf.wordpress.com\n%d %d\n255\n", w, h); // Generate pixel values and write to file for (y=0 ; y<h ; ++y) { for (x=0 ; x<w ; ++x) { fprintf(f, "%03d ", (x*x + y*y) % 255); } fprintf(f, "\n"); } // Close file fclose(f); return 0; }

Also, I used the following ImageMagick command to convert the image to PNG format before uploading it here:

convert pattern.pgm pattern.png

Over the weekend, I spent a couple of hours playing around with the same idea and produced some wild patterns. This time, I wanted to produce colourful patterns so I created PPM files instead. I was really surprised by how rich the patterns produced by such simple formulae are. Here’s an example:

Here’s the code I used to produce the image above:

// // pattern.c - a PPM modulo pattern maker // Written by Ted Burke, 13-2-2012 // // To compile: gcc pattern.c -lm // #include <stdio.h> #include <math.h> int main() { int r, g, b, x, y, w=640, h=480; // Open output PPM file FILE* f = fopen("pattern.ppm", "w"); // Print image header to file fprintf(f, "P3\n# batchloaf.wordpress.com\n%d %d\n255\n", w, h); // Generate pixel values and write to file for (y=0 ; y<h ; ++y) { for (x=0 ; x<w ; ++x) { r = fmod(0.001*(pow(x-w/2,3) + pow(y-w/2,3)),255.0); g = fmod(0.001*(pow(3*w/2-x,3) + pow(3*h/2-y,3)),255.0); b = 255; fprintf(f, "%03d %03d %03d ", r, g, b); } fprintf(f, "\n"); } // Close file fclose(f); return 0; }

Finally, here are some more examples:

The next one uses a sine function rather than the modulo operator to clamp the pixel value to the allowed range (0 to 255):

r = sin(0.025*(pow(x,1.1) * pow(y,1.1))) * 255.0; g = (255.0 * x)/w; b = (255.0 * y)/h;

Like this:

LikeLoading...

Related

This entry was posted in Uncategorized and tagged C, convert, ImageMagick, modulo, modulo art, pattern, PGM, pow, PPM, sin, sine. Bookmark the permalink.

0 Replies to “Pgm File Header Format For Essay”

Lascia un Commento

L'indirizzo email non verrĂ  pubblicato. I campi obbligatori sono contrassegnati *