Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

import cv2

imwrite("my.ppm",img)

import cv2

cv2.imwrite("my.ppm",img)

import cv2writing the ppm file is quite easy:

cv2.imwrite("my.ppm",img)


if your "image" is actually a in-memory representation of an image-file ( not plain pixels ), you have to decode it before:

img = cv2.imdecode(input,1)

writing the ppm file is quite easy:

cv2.imwrite("my.ppm",img)


i have no idea, what function_that_return_an_image() actually returns.

if your "image" is actually a in-memory representation of an image-file ( not plain pixels ), you have to decode it before:

img = cv2.imdecode(input,1)

writing the ppm file is quite easy:

cv2.imwrite("my.ppm",img)


i have no idea, what function_that_return_an_image() actually returns.

if your "image" is actually a in-memory representation of an image-file ( not plain pixels ), you have to decode it before:

img = cv2.imdecode(input,1)