Netpbm (formerly Pbmplus) is an open-source package of graphics programs and a programming library. It is used mainly in the Unix world, where one can find it included in all major open-source operating system distributions, but also works on Microsoft Windows , macOS , and other operating systems.
95-468: Several graphics formats are used and defined by the Netpbm project: are image file formats designed to be easily exchanged between platforms. They are also sometimes referred to collectively as the portable anymap format ( PNM ), not to be confused with the related portable arbitrary map format (PAM). The "magic number" (Px) at the beginning of a file determines the type, not the file extension, although it
190-422: A GIF or PNG format and result in a smaller file size than a lossy JPEG format. For example, a 640 × 480 pixel image with 24-bit color would occupy almost a megabyte of space: With vector images, the file size increases only with the addition of more vectors. There are two types of image file compression algorithms: lossless and lossy . Lossless compression algorithms reduce file size while preserving
285-782: A N y M ap"). These image formats contain various images, layers and objects, out of which the final image is to be composed As opposed to the raster image formats above (where the data describes the characteristics of each individual pixel), vector image formats contain a geometric description which can be rendered smoothly at any desired display size. At some point, all vector graphics must be rasterized in order to be displayed on digital monitors. Vector images may also be displayed with analog CRT technology such as that used in some electronic test equipment , medical monitors , radar displays, laser shows and early video games . Plotters are printers that use vector data rather than pixel data to draw graphics. CGM ( Computer Graphics Metafile )
380-519: A depth of 8 bits per channel (24 bits per palette entry). Additionally, an optional list of 8-bit alpha values for the palette entries may be included; if not included, or if shorter than the palette, the remaining palette entries are assumed to be opaque. The palette must not have more entries than the image bit depth allows for, but it may have fewer (for example, if an image with 8-bit pixels only uses 90 colors then it does not need palette entries for all 256 colors). The palette must contain entries for all
475-443: A dozen without any license offered (thus also non-free). As mentioned in the analysis, it obviously doesn't cover changes since. Image file format An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG , PNG , and GIF . Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be compressed or uncompressed. If
570-436: A perfect copy of the original uncompressed image. Lossless compression generally, but not always, results in larger files than lossy compression. Lossless compression should be used to avoid accumulating stages of re-compression when editing images. Lossy compression algorithms preserve a representation of the original uncompressed image that may appear to be a perfect copy, but is not a perfect copy. Often lossy compression
665-458: A program encountering an ancillary chunk that it does not understand can safely ignore it. This chunk-based storage layer structure, similar in concept to a container format or to Amiga ' s IFF , is designed to allow the PNG format to be extended while maintaining compatibility with older versions—it provides forward compatibility , and this same file structure (with different signature and chunks)
760-419: A significantly smaller file size. Before DEFLATE is applied, the data is transformed via a prediction method: a single filter method is used for the entire image, while for each image line, a filter type is chosen to transform the data to make it more efficiently compressible. The filter type used for a scanline is prepended to the scanline to enable inline decompression. There is only one filter method in
855-495: A single image in an extensible structure of chunks , encoding the basic pixels and other information such as textual comments and integrity checks documented in RFC 2083. PNG files have the ".png" file extension and the "image/png" MIME media type. PNG was published as an informational RFC 2083 in March 1997 and as an ISO/IEC 15948 standard in 2004. The motivation for creating
950-420: A single transparent color. Compared to JPEG, PNG excels when the image has large, uniformly colored areas. Even for photographs – where JPEG is often the choice for final distribution since its lossy compression typically yields smaller file sizes – PNG is still well-suited to storing images during the editing process because of its lossless compression. PNG provides a patent-free replacement for GIF (though GIF
1045-432: A small subset of them. PNG offers a variety of transparency options. With true-color and grayscale images either a single pixel value can be declared as transparent or an alpha channel can be added (enabling any percentage of partial transparency to be used). For paletted images, alpha values can be added to palette entries. The number of such values stored may be less than the total number of palette entries, in which case
SECTION 10
#17330859392751140-422: A temporary somepic.ppm file around: The Netpbm programs are frequently used as intermediates to convert between obscure formats. For instance, there may be no tool to convert an X11 window dump ( XWD format) directly to a Macintosh PICT file, but one can do this by running xwdtopnm , then ppmtopict . (Tools which say that they output PNM output either PBM, PGM, or PPM. Tools importing PNM will read any of
1235-412: A two-stage compression process: PNG uses DEFLATE , a non-patented lossless data compression algorithm involving a combination of LZ77 and Huffman coding . Permissively licensed DEFLATE implementations, such as zlib , are widely available. Compared to formats with lossy compression such as JPEG, choosing a compression setting higher than average delays processing, but often does not result in
1330-464: Is 73,848 bytes. Filesize reduction factor 100 or so when converting to png is typical if the image is a line drawing; if the image is a photo, it is best converted to jpeg, which yields a greater filesize reduction. The PPM format is generally an intermediate format used for image work before converting to a more efficient format, for example the PNG format, without any loss of information in the intermediate step. The image shown above using only 0 or
1425-474: Is a file format for 2D vector graphics , raster graphics, and text , and is defined by ISO / IEC 8632 . All graphical elements can be specified in a textual source file that can be compiled into a binary file or one of two text representations. CGM provides a means of graphics data interchange for computer representation of 2D graphical information independent from any particular application, system, platform, or device. It has been adopted to some extent in
1520-430: Is a format that is natively supported by Gecko - and Presto -based web browsers and is also commonly used for thumbnails on Sony's PlayStation Portable system (using the normal PNG file extension). In 2017, Chromium based browsers adopted APNG support. In January 2020, Microsoft Edge became Chromium based, thus inheriting support for APNG. With this all major browsers now support APNG. The original PNG specification
1615-484: Is a separate table contained in the PLTE chunk. Sample data for a single pixel consists of a tuple of between one and four numbers. Whether the pixel data represents palette indices or explicit sample values, the numbers are referred to as channels and every number in the image is encoded with an identical format. The permitted formats encode each number as an unsigned integer value using a fixed number of bits, referred to in
1710-464: Is able to achieve smaller file sizes than lossless compression. Most lossy compression algorithms allow for variable compression that trades image quality for file size. Including proprietary types, there are hundreds of image file types. The PNG, JPEG, and GIF formats are most often used to display images on the Internet. Some of these graphic formats are listed and briefly described below, separated into
1805-403: Is an intermediate format. Most applications open metafiles and then save them in their own native format. Page description language refers to formats used to describe the layout of a printed page containing text, objects and images. Examples are PostScript , PDF and PCL . JPEG (Joint Photographic Experts Group) is a lossy compression method; JPEG-compressed images are usually stored in
1900-470: Is backwards compatible with PNG and supported by most browsers. JPEG 2000 is a compression standard enabling both lossless and lossy storage. The compression methods used are different from the ones in standard JFIF/JPEG; they improve quality and compression ratios, but also require more computational power to process. JPEG 2000 also adds features that are missing in JPEG. It is not nearly as common as JPEG, but it
1995-518: Is based on an algorithm by Alan W. Paeth . Compare to the version of DPCM used in lossless JPEG , and to the discrete wavelet transform using 1 × 2, 2 × 1, or (for the Paeth predictor) 2 × 2 windows and Haar wavelets . Compression is further improved by choosing filter types adaptively on a line-by-line basis. This improvement, and a heuristic method of implementing it commonly used by PNG-writing software, were created by Lee Daniel Crocker , who tested
SECTION 20
#17330859392752090-556: Is best practice to use the correct extension if possible. The PBM format was invented by Jef Poskanzer in the 1980s as a format that allowed monochrome bitmaps to be transmitted within an email message as plain ASCII text, allowing it to survive any changes in text formatting. Poskanzer developed the first library of tools to handle the PBM format, Pbmplus, released in 1988. It mainly contained tools to convert between PBM and other graphics formats. By
2185-480: Is designed to be usable for both delivery and authoring use cases. The TIFF ( Tag Image File Format ) format is a flexible format usually using either the TIFF or TIF filename extension. The tag structure was designed to be easily extendible, and many vendors have introduced proprietary special-purpose tags – with the result that no one reader handles every flavor of TIFF file. TIFFs can be lossy or lossless, depending on
2280-540: Is itself now patent-free) and can also replace many common uses of TIFF. Indexed-color, grayscale, and truecolor images are supported, plus an optional alpha channel. The Adam7 interlacing allows an early preview, even when only a small percentage of the image data has been transmitted — useful in online viewing applications like web browsers . PNG can store gamma and chromaticity data, as well as ICC profiles , for accurate color matching on heterogeneous platforms. Animated formats derived from PNG are MNG and APNG , which
2375-419: Is more sophisticated than GIF's 1-dimensional, 4-pass scheme, and allows a clearer low-resolution image to be visible earlier in the transfer, particularly if interpolation algorithms such as bicubic interpolation are used. However, the 7-pass scheme tends to reduce the data's compressibility more than simpler schemes. The core PNG format does not support animation. MNG is an extension to PNG that does; it
2470-589: Is necessary to read the file. If a decoder encounters a critical chunk it does not recognize, it must abort reading the file or supply the user with an appropriate warning. The case of the second letter indicates whether the chunk is "public" (either in the specification or the registry of special-purpose public chunks) or "private" (not standardized). Uppercase is public and lowercase is private. This ensures that public and private chunk names can never conflict with each other (although two private chunk names could conflict). The third letter must be uppercase to conform to
2565-431: Is no metadata in the file to indicate which color space is being used. A simple example of the PBM format is as follows. (Not shown are the newline character(s) at the end of each line.): The string P1 identifies the file format. The number sign introduces a comment. The next two numbers give the width and the height. Then follows the matrix with the pixel values (in the monochrome case here, only zeros and ones). It
2660-569: Is not even limited to graphics, its definition allows it to be used for arbitrary three-dimensional matrices of unsigned integers. Some programs of the Netpbm package, for example pamsummcol , function as crude matrix arithmetic processors and use the PAM format this way. Netpbm consists of hundreds of different tools, each offered with a public copyright license of its own. An analysis by Debian developer Steve McIntyre from 2001 suggests mostly free software licenses, one non-commercial license (non-free) and
2755-473: Is not required that pixels are nicely lined up, the format ignores whitespaces and linefeeds in the data section, although it's recommended that no line is longer than 76 characters. The following displays the same image: Here is the resulting image: Here it is again magnified 20 times: A value of 0 signifies a white pixel, and a 1 signifies a black pixel. This differs from the other formats, where higher values signify brighter pixels. The P4 binary format of
2850-585: Is not widely supported.) The GIF ( Graphics Interchange Format ) is in normal use limited to an 8-bit palette, or 256 colors (while 24-bit color depth is technically possible). GIF is most suitable for storing graphics with few colors, such as simple diagrams, shapes, logos, and cartoon style images, as it uses LZW lossless compression, which is more effective when large areas have a single color, and less effective for photographic or dithered images. Due to GIF's simplicity and age, it achieved almost universal software support. Due to its animation capabilities, it
2945-408: Is similar to the line above, since the differences from prediction will generally be clustered around 0, rather than spread over all possible image values. This is particularly important in relating separate rows, since DEFLATE has no understanding that an image is a 2D entity, and instead just sees the image data as a stream of bytes. There are five filter types for filter method 0; each type predicts
Netpbm - Misplaced Pages Continue
3040-487: Is still widely used to provide image animation effects, despite its low compression ratio compared to modern video formats. The PNG ( Portable Network Graphics ) file format was created as a free, open-source alternative to GIF. The PNG file format supports 8-bit (256 colors) paletted images (with optional transparency for all palette colors) and 24-bit truecolor (16 million colors) or 48-bit truecolor with and without alpha channel – while GIF supports only 8-bit palettes with
3135-502: Is supported by XnView and FFmpeg . As specified the TUPLTYPE is optional; however, FFmpeg requires it. The header for the PAM file format begins with P7, and (unlike in the other formats) ends in an explicit close: "ENDHDR" followed by a whitespace. Line ends in a PAM header are significant; for PNM, line ends are whitespace. There is no plain (human-readable, ASCII -based) version of PAM. PAM files are always binary, and attempts to use
3230-461: Is the format for HDR images originating from Radiance and also supported by Adobe Photoshop. JPEG-HDR is a file format from Dolby Labs similar to RGBE encoding, standardized as JPEG XT Part 2. JPEG XT Part 7 includes support for encoding floating point HDR images in the base 8-bit JPEG file using enhancement layers encoded with four profiles (A-D); Profile A is based on the RGBE format and Profile B on
3325-584: Is their simple structure and wide acceptance in Windows programs. Netpbm format is a family including the portable pixmap file format (PPM), the portable graymap file format (PGM) and the portable bitmap file format (PBM). These are either pure ASCII files or raw binary files with an ASCII header that provide very basic functionality and serve as a lowest common denominator for converting pixmap, graymap, or bitmap files between different platforms. Several applications refer to them collectively as PNM (" P ortable
3420-409: Is used currently in professional movie editing and distribution (some digital cinemas, for example, use JPEG 2000 for individual movie frames). WebP is an open image format released in 2010 that uses both lossless and lossy compression. It was designed by Google to reduce image file size to speed up web page loading: its principal purpose is to supersede JPEG as the primary format for photographs on
3515-443: Is used in the associated MNG , JNG , and APNG formats. A chunk consists of four parts: length (4 bytes, big-endian ), chunk type/name (4 bytes ), chunk data (length bytes) and CRC (cyclic redundancy code/checksum; 4 bytes ). The CRC is a network-byte-order CRC-32 computed over the chunk type and chunk data, but not the length. Chunk types are given a four-letter case sensitive ASCII type/name; compare FourCC . The case of
3610-509: The JFIF (JPEG File Interchange Format) or the Exif (Exchangeable image file format) file format. The JPEG filename extension is JPG or JPEG . Nearly every digital camera can save images in the JPEG format, which supports eight-bit grayscale images and 24-bit color images (eight bits each for red, green, and blue). JPEG applies lossy compression to images, which can result in a significant reduction of
3705-617: The Blink rendering engine; support was re-added in Opera 46 (inherited from Chromium 59). Microsoft Edge has supported APNG since version 79.0, when it switched to a Chromium-based engine. The PNG Group decided in April 2007 not to embrace APNG. Several alternatives were under discussion, including ANG, aNIM/mPNG, "PNG in GIF" and its subset "RGBA in GIF". However, currently only APNG has widespread support. With
3800-603: The CMYK defined by a particular set of printing press inks. OCR (Optical Character Recognition) software packages commonly generate some form of TIFF image (often monochromatic ) for scanned text pages. The BMP file format (Windows bitmap) is a raster-based device-independent file type designed in the early days of computer graphics. It handles graphic files within the Microsoft Windows OS. Typically, BMP files are uncompressed, and therefore large and lossless; their advantage
3895-531: The Usenet newsgroup "comp.graphics" in which he devised a plan for a free alternative to GIF. Other users in that thread put forth many propositions that would later be part of the final file format. Oliver Fromme, author of the popular JPEG viewer QPEG , proposed the PING name, eventually becoming PNG, a recursive acronym meaning PING is not GIF , and also the .png extension . Other suggestions later implemented included
Netpbm - Misplaced Pages Continue
3990-637: The World Wide Web Consortium to address the need (and attempts of several corporations) for a versatile, scriptable and all-purpose vector format for the web and otherwise. The SVG format does not have a compression scheme of its own, but due to the textual nature of XML , an SVG graphic can be compressed using a program such as gzip . Because of its scripting potential, SVG is a key component in web applications : interactive web pages that look and act like applications. These are formats containing both pixel and vector data, possible other data, e.g.
4085-533: The deflate compression algorithm and 24-bit color support, the lack of the latter in GIF also motivating the team to create their file format. The group would become known as the PNG Development Group, and as the discussion rapidly expanded, it later used a mailing list associated with a CompuServe forum. The full specification of PNG was released under the approval of W3C on 1 October 1996, and later as RFC 2083 on 15 January 1997. The specification
4180-402: The vergence-accommodation conflict . Image files are composed of digital data in one of these formats so that the data can be displayed on a digital (computer) display or printed out using a printer. A common method for displaying digital image information has historically been rasterization . The size of raster image files is positively correlated with the number of pixels in the image and
4275-409: The ASCII format can accommodate greater bit depths, it increases file size and thus slows read and write operations. Accordingly, many programmers extended the format to allow higher bit depths. Using higher bit depths encounters the problem of having to decide on the endianness of the file. The various implementations did not agree on which byte order to use, and some connected the 16-bit endianness to
4370-653: The Mozilla Foundation. It is based on PNG, supports animation and is simpler than MNG. APNG offers fallback to single-image display for PNG decoders that do not support APNG. Today, the APNG format is supported by all major web browsers. APNG is supported in Firefox 3.0 and up, Pale Moon (all versions), and Safari 8.0 and up. Chromium 59.0 added APNG support, followed by Google Chrome. Opera supported APNG in versions 10–12.1, but support lapsed in version 15 when it switched to
4465-546: The PNG format was the realization, on 28 December 1994, that the Lempel–Ziv–Welch (LZW) data compression algorithm used in the Graphics Interchange Format (GIF) format was patented by Unisys . The patent required that all software supporting GIF pay royalties, leading to a flurry of criticism from Usenet users. One of them was Thomas Boutell, who on 4 January 1995 posted a precursory discussion thread on
4560-421: The PNG specification as the bit depth . Notice that this is not the same as color depth , which is commonly used to refer to the total number of bits in each pixel, not each channel. The permitted bit depths are summarized in the table along with the total number of bits used for each pixel. The number of channels depends on whether the image is grayscale or color and whether it has an alpha channel . PNG allows
4655-414: The PNG specification. It is reserved for future expansion. Decoders should treat a chunk with a lower case third letter the same as any other unrecognized chunk. The case of the fourth letter indicates whether the chunk is safe to copy by editors that do not recognize it. If lowercase, the chunk may be safely copied regardless of the extent of modifications to the file. If uppercase, it may only be copied if
4750-495: The RGBA format. PFM is supported by the programs Photoshop , GIMP , and ImageMagick . It is supported by the de facto reference implementation netpbm. The Netpbm package contains over 350 programs, most of which have "pbm", "pgm", "ppm", "pam", or "pnm" in their names. For example, one might use pamscale to shrink an image by 10%, pamcomp to overlay one image on top of another, pbmtext to create an image of text, or reduce
4845-597: The XDepth format from Trellis Management. The High Efficiency Image File Format (HEIF) is an image container format that was standardized by MPEG on the basis of the ISO base media file format . While HEIF can be used with any image compression format, the HEIF standard specifies the storage of HEVC intra-coded images and HEVC-coded image sequences taking advantage of inter-picture prediction. AV1 Image File Format (AVIF) standardized by
SECTION 50
#17330859392754940-413: The areas of technical illustration and professional design , but has largely been superseded by formats such as SVG and DXF . The Gerber format (aka Extended Gerber, RS-274X) is a 2D bi-level image description format developed by Ucamco . It is the de facto standard format for printed circuit board or PCB software. SVG ( Scalable Vector Graphics ) is an open standard created and developed by
5035-462: The basic tuple types (BLACKANDWHITE, GRAYSCALE, and RGB) have a variant with an opacity channel . The tuple type is created by appending "_ALPHA" as a suffix to the base tuple type. For example, an image with a tuple type of GRAYSCALE is equivalent to PGM (portable graymap). GRAYSCALE_ALPHA with transparency is not directly possible in PGM. The specification permits MAXVAL 1 for GRAYSCALE, but it would have
5130-415: The basic use case of WebP (i.e., a file containing a single image encoded as a VP8 key frame). The WebP container provides additional support for: Most typical raster formats cannot store HDR data (32 bit floating point values per pixel component), which is why some relatively old or complex formats are still predominant here, and worth mentioning separately. Newer alternatives are showing up, though. RGBE
5225-504: The binary formats, PBM uses 1 bit per pixel, PGM uses 8 or 16 bits per pixel, and PPM uses 24 or 48 bits per pixel: 8/16 for red, 8/16 for green, 8/16 for blue. Application support for the 16 bit variants is still rare. PGM and PPM documentation defines that gray and color values use the BT.709 color space and gamma transfer function. However, depending on the application, the used color space may be sRGB , linear or some other color space . There
5320-437: The color depth (bits per pixel). Images can be compressed in various ways, however. A compression algorithm stores either an exact representation or an approximation of the original image in a smaller number of bytes that can be expanded back to its uncompressed form with a corresponding decompression algorithm. Images with the same number of pixels and color depth can have very different compressed file size. Considering exactly
5415-486: The current PNG specification (denoted method 0), and thus in practice the only choice is which filter type to apply to each line. For this method, the filter predicts the value of each pixel based on the values of previous neighboring pixels, and subtracts the predicted color of the pixel from the actual value, as in DPCM . An image line filtered in this way is often more compressible than the raw image line would be, especially if it
5510-412: The data is compressed, it may be done so using lossy compression or lossless compression . For graphic design applications, vector formats are often used. Some image file formats support transparency . Raster formats are for 2D images . A 3D image can be represented within a 2D format, as in a stereogram or autostereogram , but this 3D image will not be a true light field , and thereby may cause
5605-635: The development of the Third Edition of the PNG Specification, now maintained by the PNG working group, APNG will finally be incorporated into the specification as an extension. 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 00 00 00 01 00 00 00 01 08 02 00 00 00 90 77 53 DE 00 00 00 0C 49 44 41 54 08 D7 63 F8 CF C0 00 00 03 01 01 00 18 DD 8D B0 00 00 00 00 49 45 4E 44 AE 42 60 82 .PNG.... ....IHDR ..............wS . ....IDAT..c.... ......... ....IEN D.B`. Displayed in
5700-402: The different letters in the name (bit 5 of the numeric value of the character) is a bit field that provides the decoder with some information on the nature of chunks it does not recognize. The case of the first letter indicates whether the chunk is critical or not. If the first letter is uppercase, the chunk is critical; if not, the chunk is ancillary. Critical chunks contain information that
5795-487: The end of 1988, Poskanzer had developed the PGM and PPM formats along with their associated tools and added them to Pbmplus. The final release of Pbmplus was December 10, 1991. In 1993, the Netpbm library was developed to replace the unmaintained Pbmplus. It was simply a repackaging of Pbmplus with additions and fixes submitted by people all over the world. Each file starts with a two-byte magic number (in ASCII) that identifies
SECTION 60
#17330859392755890-403: The file size. Applications can determine the degree of compression to apply, and the amount of compression affects the visual quality of the result. When not too great, the compression does not noticeably affect or detract from the image's quality, but JPEG files suffer generational degradation when repeatedly edited and saved. (JPEG also provides lossless image storage, but the lossless version
5985-410: The following combinations of channels, called the color type . The color type is specified as an 8-bit value however only the low three bits are used and, even then, only the five combinations listed above are permitted. So long as the color type is valid it can be considered as a bit field as summarized in the adjacent table: With indexed color images, the palette always stores trichromatic colors at
6080-435: The forerunner of Netpbm, called Pbmplus in 1988. By the end of 1988, Poskanzer had developed the PGM (greyscale) and PPM (color) formats and released them with Pbmplus. The last release of Pbmplus was on December 10, 1991. Poskanzer never released any further updates, and in 1993, Netpbm was developed to replace it. At first, it was nothing more than a renamed release of Pbmplus, but updates continued to occur until 1995 when
6175-487: The highest end systems). Alpha storage can be "associated" (" premultiplied ") or "unassociated", but PNG standardized on "unassociated" ("non-premultiplied") alpha, which means that imagery is not alpha encoded ; the emissions represented in RGB are not the emissions at the pixel level. This means that the over operation will multiply the RGB emissions by the alpha, and cannot represent emission and occlusion properly. PNG uses
6270-418: The inclusion of ICC color profiles . The lowercase first letter in these chunks indicates that they are not needed for the PNG specification. The lowercase last letter in some chunks indicates that they are safe to copy, even if the application concerned does not understand them. Pixels in PNG images are numbers that may be either indices of sample data in the palette or the sample data itself. The palette
6365-558: The initials PNG stood for the recursive acronym "PNG's not GIF". PNG supports palette-based images (with palettes of 24-bit RGB or 32-bit RGBA colors), grayscale images (with or without an alpha channel for transparency), and full-color non-palette-based RGB or RGBA images. The PNG working group designed the format for transferring images on the Internet , not for professional-quality print graphics; therefore, non-RGB color spaces such as CMYK are not supported. A PNG file contains
6460-464: The interactive features of PDF. Portable Network Graphics [REDACTED] Portable Network Graphics ( PNG , officially pronounced / p ɪ ŋ / PING , colloquially pronounced / ˌ p iː ɛ n ˈ dʒ iː / PEE -en- JEE ) is a raster-graphics file format that supports lossless data compression . PNG was developed as an improved, non-patented replacement for Graphics Interchange Format (GIF)—unofficially,
6555-480: The later, more widespread Portable Network Graphics (PNG) format, the "net" in the name is not actually in reference to the image itself being optimized for transfer over a network.) Portable Arbitrary Map ( PAM ) is an extension of the older binary P4...P6 graphics formats , introduced with netpbm version 9.7 (August 2000). PAM generalises all features of PBM, PGM, and PPM, and provides for extensions. PAM defines two new attributes; depth and tuple type: PAM
6650-593: The maximal value for the r ed- g reen- b lue channels can be also encoded as: White space including line ends and comment lines is syntactically equivalent to a single space within the PNM headers. For the plain formats P1...P3 this also affects the pixmap lines; in fact lines should be limited to 70 characters: The original definition of the PGM and the PPM binary formats (the P5 and P6 formats) did not allow bit depths greater than 8 bits. While
6745-486: The maximum value (numbers of grey between black and white) after the X and Y dimensions and before the actual pixel data. Black is 0 and max value is white. (Not shown are the newline character(s) at the end of each line.) This is an example of a color RGB image stored in PPM format. (Not shown are the newline character(s) at the end of each line.) The P6 binary format of the same image represents each color component of each pixel with one byte (thus three bytes per pixel) in
6840-513: The methods on many images during the creation of the format; the choice of filter is a component of file size optimization, as discussed below. If interlacing is used, each stage of the interlacing is filtered separately, meaning that the image can be progressively rendered as each stage is received; however, interlacing generally makes compression less effective. PNG offers an optional 2-dimensional, 7-pass interlacing scheme—the Adam7 algorithm . This
6935-696: The modifications have not touched any critical chunks. A decoder must be able to interpret critical chunks to read and render a PNG file. As stated in the World Wide Web Consortium , bit depth is defined as "the number of bits per sample or per palette index (not per pixel)". The PLTE chunk is essential for color type 3 (indexed color). It is optional for color types two and six (truecolor and truecolor with alpha) and it must not appear for color types 0 and 4 (grayscale and grayscale with alpha). Other image attributes that can be stored in PNG files include gamma values, background color, and textual metadata information. PNG also supports color management through
7030-399: The number of colors in an image with pnmquant . The programs are designed to be minimal building blocks that can be used in various combinations to do other things. The Netpbm package can, for example, use two successive conversion programs to turn a color picture in the GIF format into a .bmp file: This is more commonly done as a pipeline , to save execution time and to avoid leaving
7125-426: The order red, green, then blue. The file is smaller, but the color information is more difficult to read by humans. The header remains in ASCII and the arguments are still separated by a whitespace. The binary image information comes after the header (which ends with a whitespace). In the binary format, last headerline must be like "255\n", with data immediately following it; any comment added after 255 will be taken as
7220-469: The package again became abandoned. In 1999, the Netpbm package was picked up by its present maintainer, Bryan Henderson. In 2000, PAM was added to the file formats of the Netpbm library allowing an alpha channel. The name Netpbm came from the program developers collaborating over the Internet , which was notable at the time; the NetBSD operating system and NetHack game got their names similarly. (Unlike with
7315-474: The pixel packing order. The current documentation of PGM and PPM says that the most significant byte is first and the Netpbm implementation also uses the big-endian byte order. The PFM (Portable Floatmap) is the unofficial four byte IEEE 754 single precision floating point extension. After the header the file proceeds with floating point numbers for each pixel, specified in left-to-right, bottom-to-top order. Some programs suggest PF4 as an additional extension for
7410-434: The pixel values present in the image. The standard allows indexed color PNGs to have 1, 2, 4 or 8 bits per pixel; grayscale images with no alpha channel may have 1, 2, 4, 8 or 16 bits per pixel. Everything else uses a bit depth per channel of either 8 or 16. The combinations this allows are given in the table above. The standard requires that decoders can read all supported color formats, but many image editors can only produce
7505-421: The remaining entries are considered fully opaque. The scanning of pixel values for binary transparency is supposed to be performed before any color reduction to avoid pixels becoming unintentionally transparent. This is most likely to pose an issue for systems that can decode 16-bits-per-channel images (as is required for compliance with the specification) but only output at 8 bits per channel (the norm for all but
7600-602: The same compression, number of pixels, and color depth for two images, different graphical complexity of the original images may also result in very different file sizes after compression due to the nature of compression algorithms. With some compression formats, images that are less complex may result in smaller compressed file sizes. This characteristic sometimes results in a smaller file size for some lossless formats than lossy formats. For example, graphically simple images (i.e. images with large continuous regions like line art or animation sequences) may be losslessly compressed into
7695-926: The same effect as BLACKANDWHITE. An example in the BMP article shows an RGBA image with 4×2=8 blue, green, red, and white pixels; half transparent (0x7F) in the first lower row, opaque (0xFF) in the second upper row; hex. FF00007F 00FF007F 0000FF7F FFFFFF7F FF0000FF 00FF00FF 0000FFFF FFFFFFFF in BGRA order. For PAM, this bitmap has to be given in RGBA order, swapping the 1st and 3rd byte in each pixel. BMP rows are typically arranged bottom-up, for PAM and PNM rows are given top-down (i.e. for this example 0000FFFF 00FF00FF FF0000FF FFFFFFFF 0000FF7F 00FF007F FF00007F FFFFFF7F ). The PAM header for this example could be: PAM's tuple-type mechanism allows for many extensions. In theory, PAM can be extended to represent color models such as CMYK. The format
7790-506: The same image represents each pixel with a single bit. A row is width pixels wide packed to the length of 8 pixels or a byte. The first pixel in a row is the most significant bit. The extra bits used to make the length equal to a byte are ignored. The following formula can be used to calculate the number of required bytes ⌈ width / 8⌉ * height . If we use the example above a ⌈6 / 8⌉ * 10 would be 10 bytes. The PGM and PPM formats (both ASCII and binary versions) have an additional parameter for
7885-410: The start of image data, and the image will be skewed to the right (at least when opened by the image-manipulation program GIMP (December 2022)). The PPM format is not compressed, and thus requires more space and bandwidth than a compressed format would. For example, the above 192×128 PNG ( Portable Network Graphics ) image has a file size of 166 bytes. When converted to a 192×128 PPM image, the file size
7980-419: The switch -plain with Netpbm programs that produce PAM output results in an error message. For the black-and-white version of PAM (depth 1, tuple type BLACKANDWHITE), corresponding to PBM, PAM uses one byte per pixel, instead of PBM's use of one bit per pixel (packing eight pixels in one byte). Also, the value 1 in such a PAM image stands for white ("light on"), as opposed to black in PBM ("ink on"). All of
8075-543: The technique chosen for storing the pixel data. Some offer relatively good lossless compression for bi-level (black&white) images . Some digital cameras can save images in TIFF format, using the LZW compression algorithm for lossless storage. TIFF image format is not widely supported by web browsers, but it remains widely accepted as a photograph file standard in the printing business. TIFF can handle device-specific color spaces, such as
8170-487: The three formats.) As a more complex example, Netpbm tools can convert 48×48 XBM to Ikon and eventually X-Face . The PBM (black and white) format was invented by Jef Poskanzer in the mid-1980s. At the time, there was no standard, reliable way to send binary files in email, and attempting to send anything other than 7-bit ASCII in email often resulted in data corruption . PBM was designed to allow images to be sent via email without being corrupted. Poskanzer released
8265-520: The two main families of graphics: raster and vector. Raster images are further divided into formats primarily aimed at (web) delivery (i.e. supporting relatively strong compression) versus formats primarily aimed at authoring or interchange (uncompressed or only relatively weak compression). In addition to straight image formats, Metafile formats are portable formats which can include both raster and vector information. Examples are application-independent formats such as WMF and EMF . The metafile format
8360-498: The type of file it is (PBM, PGM, and PPM) and its encoding ( ASCII /"plain" or binary/"raw"). The magic number is a capital P followed by a single-digit number. A value of P7 refers to the PAM file format that is covered as well by the netpbm library. The ASCII ("plain") formats allow for human readability and easy transfer to other platforms; the binary ("raw") formats are easier to parse by programs and more efficient in file size. In
8455-485: The value of each byte (of the image data before filtering) based on the corresponding byte of the pixel to the left ( A ), the pixel above ( B ), and the pixel above and to the left ( C ) or some combination thereof, and encodes the difference between the predicted value and the actual value. Filters are applied to byte values, not pixels; pixel values may be one or two bytes, or several values per byte, but never cross byte boundaries. The filter types are: The Paeth filter
8550-599: The video consortium Alliance for open media (AOMedia) creator of the video format Av1 , to take advantage of modern compression algorithms and a completely royalty-free image format. It uses the image format with AVIF coding and recommends using the HEIF container, see AV1 in HEIF . JPEG XL is a royalty-free raster-graphics file format that supports both lossy and lossless compression. It supports reversible recompression of existing JPEG files, as well as high-precision HDR (up to 32-bit floating point values per pixel component). It
8645-416: The web. WebP is based on VP8 's intra-frame coding and uses a container based on RIFF . In 2011, Google added an "Extended File Format" allowing WebP support for animation , ICC profile , XMP and Exif metadata , and tiling. The support for animation allowed for converting older animated GIFs to animated WebP. The WebP container (i.e., RIFF container for WebP) allows feature support over and above
8740-457: Was authored by an ad hoc group of computer graphics experts and enthusiasts. Discussions and decisions about the format were conducted by email. The original authors listed on RFC 2083 are: A PNG file starts with an eight- byte signature (refer to hex editor image on the right): After the header, comes a series of chunks , each of which conveys certain information about the image. Chunks declare themselves as critical or ancillary , and
8835-459: Was designed by members of the PNG Group. MNG shares PNG's basic structure and chunks, but it is significantly more complex and has a different file signature, which automatically renders it incompatible with standard PNG decoders. This means that most web browsers and applications either never supported MNG or dropped support for it. The complexity of MNG led to the proposal of APNG by developers at
8930-652: Was initially decided that PNG should be a single-image format. In 2001, the developers of PNG published the Multiple-image Network Graphics (MNG) format, with support for animation. MNG achieved moderate application support, but not enough among mainstream web browsers and no usage among web site designers or publishers. In 2008, certain Mozilla developers published the Animated Portable Network Graphics (APNG) format with similar goals. APNG
9025-487: Was revised on 31 December 1998 as version 1.1, which addressed technical problems for gamma and color correction . Version 1.2, released on 11 August 1999, added the iTXt chunk as the specification's only change, and a reformatted version of 1.2 was released as a second edition of the W3C standard on 10 November 2003, and as an International Standard ( ISO/IEC 15948:2004 ) on 3 March 2004. Although GIF allows for animation , it
#274725