Method Image.PNM.encode_binary()
- Method encode_binary
encode(string
object
image
)
encode_binary(string
object
image
)
encode_ascii(string
object
image
)
encode_P1(string
object
image
)
encode_P2(string
object
image
)
encode_P3(string
object
image
)
encode_P4(string
object
image
)
encode_P5(string
object
image
)
encode_P6(string
object
image
)- 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