Free webp to jpg
PWG-Raster

PWG Raster Format

image/pwg-raster Released 2011 · by IEEE-ISTO Printer Working Group (PWG)

The image/pwg-raster MIME type represents the PWG Raster format, a standardized raster graphics format developed by the IEEE-ISTO Printer Working Group (PWG). Built as a heavily constrained, highly specific subset of the CUPS Raster version 2 format, it was designed specifically for driverless network printing over the Internet Printing Protocol (IPP). It forms the foundational imaging backbone for universal mobile and desktop printing technologies like IPP Everywhere, Wi-Fi Direct Print, and Apple AirPrint, allowing client devices to send pre-rasterized, ready-to-print bitmaps directly to low-power printers without requiring manufacturer-specific software drivers.

Printing & Imaging Production Ready

Technical Specifications

MIME Type
image/pwg-raster
Extensions
.pwg.ras
Container
CUPS Raster v2 Container
Compression
PackBits (Run-Length Encoding)
Algorithms
PackBits (Apple RLE variant)
Color Depth
1-bit (Monochrome/K), 8-bit (Grayscale), 24-bit (sRGB / Adobe RGB), 32-bit (CMYK)
Metadata
None
Capabilities
Transparency
Animation
Progressive Loading
Alpha Channel
HDR Support
Official Specification
Aliases: application/vnd.cups-raster

Magic Bytes & HTTP Headers

File Signature (Magic Bytes)
52 61 53 32
ASCII: RaS2
HTTP Headers
Content-Type: image/pwg-raster
HTML Accept Attribute
accept="image/pwg-raster, .pwg"

Browser Support Matrix

Browser Status Min Version
Chrome Chrome
Not Supported
Firefox Firefox
Not Supported
Safari Safari
Not Supported
Edge Edge
Not Supported
Internet Explorer Internet Explorer
Not Supported Legacy

Advantages & Limitations

Advantages
  • The undisputed global standard for modern, driverless printing environments, eliminating the nightmare of installing manufacturer-specific print drivers
  • Extremely lightweight to decode on embedded hardware, requiring minimal RAM buffers on the printer side
  • Strict color space and resolution rules guarantee that the printed output will successfully process without syntax errors
Limitations
  • Generates massive file sizes and network payloads compared to vector-based formats like PDF or PostScript, as every page is fully rasterized at 300+ DPI before transmission
  • No support for native rendering in web browsers, image viewers, or graphic design software without specialized CUPS developer tools
  • Cannot store complex metadata, vector text, or layers

Developer Code Snippets

import magic
# Note: Due to its specialized use in IPP print spools, libmagic may just identify it generically as a CUPS raster file
print(magic.from_file('print_job.pwg', mime=True)) # May output 'application/vnd.cups-raster'
const fs = require('fs');
// Manually detecting the 'RaS2' magic string used by PWG Raster
const buffer = Buffer.alloc(4);
const fd = fs.openSync('print_job.pwg', 'r');
fs.readSync(fd, buffer, 0, 4, 0);
fs.closeSync(fd);
const isPWGRaster = buffer.toString('ascii') === 'RaS2';
console.log(isPWGRaster);
import "net/http"
// http.DetectContentType will not recognize this format. You must sniff the byte prefix directly.
// isPWG := bytes.HasPrefix(buf, []byte("RaS2"))
// Standard web environments rarely encounter this format. It is primarily passed via HTTP POST requests to an IPP printer URI (e.g., /ipp/print).

File Detection Steps

How to programmatically detect a image/pwg-raster file by reading its raw bytes:

  1. 1 Check the first 4 bytes for the synchronization word 'RaS2' (52 61 53 32).
  2. 2 Read the subsequent page header (1796 bytes long), which contains IPP-specific attributes such as MediaClass, MediaColor, and Resolution required by the print engine.

Software Support

C
CUPS (Common UNIX Printing System)
G
Ghostscript
A
Apple AirPrint Spooler

Conversion Tools

Share & Embed

Markdown Badge
PWG-Raster Format Badge
[![PWG-Raster Format](https://freewebptojpg.com/mime/image/pwg-raster/badge.svg)](https://freewebptojpg.com/mime/image/pwg-raster)
Interactive iframe Widget
<iframe src="https://freewebptojpg.com/mime/image/pwg-raster/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="PWG-Raster Specs"></iframe>

JSON API

All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.

GET https://freewebptojpg.com/mime/image/pwg-raster.json Open JSON
Free to use
No auth required
CORS enabled
Use from any domain
Cached 24h
Cache-Control headers set

Frequently Asked Questions

What is the difference between PWG Raster and PDF for printing?

PDF is a complex document format containing vector graphics, fonts, and text that requires a powerful processor and a RIP (Raster Image Processor) on the printer to decode and rasterize. PWG Raster is a pre-rendered, highly compressed bitmap format. Mobile devices (which have powerful CPUs) convert documents to PWG Raster so that cheap, low-memory printers can simply stream the pixels directly to the printhead without complex processing.

What is the relationship between PWG Raster and CUPS Raster?

PWG Raster is structurally identical to CUPS Raster version 2. However, it imposes strict limitations on the color spaces, bit depths, and resolutions allowed, ensuring that any PWG Raster file can be universally understood by any IPP Everywhere-certified printer, eliminating the proprietary variations found in standard CUPS pipelines.

What are the magic bytes for a PWG Raster file?

Because it is based on CUPS Raster v2, a PWG Raster file begins with the ASCII string 'RaS2', which corresponds to the hexadecimal bytes 52 61 53 32.

Related Formats

Share this format