Method Image.PNM.encode_P4()
- Method
encode
Method encode_binary
Method encode_ascii
Method encode_P1
Method encode_P2
Method encode_P3
Method encode_P4
Method encode_P5
Method encode_P6
stringencode(objectimage)
stringencode_binary(objectimage)
stringencode_ascii(objectimage)
stringencode_P1(objectimage)
stringencode_P2(objectimage)
stringencode_P3(objectimage)
stringencode_P4(objectimage)
stringencode_P5(objectimage)
stringencode_P6(objectimage)- Description
-
Make a complete PNM file from an image.
encode_binary() and encode_ascii() uses the most optimized encoding for this image (bitmap, grey or truecolor) - P4, P5 or P6 respective P1, P2 or P3.
encode_P1/encode_P4 assumes the image is black and white. Use Image.Image->threshold() or something like Image.Colortable( ({({0,0,0}),({255,255,255})}) )
->floyd_steinberg()
->map(my_image) to get a black and white image.encode_P2/encode_P5 assumes the image is greyscale. Use Image.Image->grey() to get a greyscale image.
- Returns
-
the encoded image as a string
- Note
-
encode() is equal to encode_binary(), but may change in a future release.
- See also