Contents

NSBitmapImageRep

An object that renders an image from bitmap data.

Declaration

class NSBitmapImageRep

Overview

Supported bitmap data formats include GIF, JPEG, TIFF, PNG, and various permutations of raw bitmap data.

Alpha Premultiplication and Bitmap Formats

When creating a bitmap using a premultiplied format, if a coverage (alpha) plane exists, the bitmap’s color components are premultiplied with it. In this case, if you modify the contents of the bitmap, you are therefore responsible for premultiplying the data. Note that premultiplying generally has negligible effect on output quality. For floating-point image data, premultiplying color components is a lossless operation, but for fixed-point image data, premultiplication can introduce small rounding errors. In either case, more rounding errors may appear when compositing many premultiplied images; however, such errors are generally not readily visible.

For this reason, you should not use an NSBitmapImageRep object if you want to manipulate image data. To work with data that is not premultiplied, use the Core Graphics framework instead. (Specifically, create images using the init(width:height:bitsPerComponent:bitsPerPixel:bytesPerRow:space:bitmapInfo:provider:decode:shouldInterpolate:intent:) function and CGImageAlphaInfo.last parameter.) Alternatively, include the NSAlphaNonpremultipliedBitmapFormat flag when creating the bitmap.

Topics

Creating Bitmap Representations of Images

Getting Information About Images

Getting the Bitmap Data

Producing Other Representations of Images

Managing Compression Types

Loading Images Incrementally

Managing Pixel Values

Getting Core Graphics Images

Managing Color Spaces

Constants

Initializers

See Also

Bitmap Formats