read_pnm_header Function

Defined in pyglet.extlibs.png

read_pnm_header(infile, supported=('P5', 'P6'))

Read a PNM header, returning (format,width,height,depth,maxval). width and height are in pixels. depth is the number of channels in the image; for PBM and PGM it is synthesized as 1, for PPM as 3; for PAM images it is read from the header. maxval is synthesized (as 1) for PBM images.

Previous topic

read_pam_header Function

Next topic

tostring Function