Introduction

The PostScript programming language is designed to describe the layout of graphics and text on the printed page. This website provides online utilities that show examples in actual practice.

8.06.2009

IMAGE :: Drawing Bitmap Images

postscript postscript_image

PostScript :: IMAGE - Drawing Bitmap Images

Operator: width height bpp data image

This operator draws a grayscale image in the unit square from (0,0) to (1, 1). The source information is a raster image width pixels wide by height pixels high. Each pixel is represented by bpp bits. The data operand can be a number of things, but is usually a procedure that returns a string of bytes with the grayscale data each time it is called. The procedure will be called repeatedly until all pixels have been processed. The image is processed from left-to-right, top-to-bottom.

Example:

Drawing Bitmap Images

    %!
    100 400 translate
    10 10 scale
    26 34 scale
    26 34 8 [26 0 0 -34 0 34]
    {<
    ffffffffffffffffffffffffffffffffffffffffffffffffffff
    ff000000000000000000000000000000000000ffffffffffffff
    ff00efefefefefefefefefefefefefefefef0000ffffffffffff
    ff00efefefefefefefefefefefefefefefef00ce00ffffffffff
    ff00efefefefefefefefefefefefefefefef00cece00ffffffff
    ff00efefefefefefefefefefefefefefefef00cecece00ffffff
    ff00efefefefefefefefefefefefefefefef00cececece00ffff
    ff00efefefefefefefefefefefefefefefef00000000000000ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efef000000ef000000ef000000ef0000ef0000efefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efef000000ef00000000ef00000000ef000000efefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efef0000ef00000000000000ef000000ef0000efefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff00efefefefefefefefefefefefefefefefefefefefefef00ff
    ff000000000000000000000000000000000000000000000000ff
    ffffffffffffffffffffffffffffffffffffffffffffffffffff
    >}
    image
    showpage
    

postscript postscript_image