Write image to the file specified. This is a wrapper for the OpenCV function imwrite for numpy arrays (like the images that get returned by most PlantCV functions), and can handle matplotlib Figures (like the one returned by pcv.visualize.pseudocolor) and altair charts (like the histograms returned in pcv.analyze.grayscale, pcv.analyze.color, pcv.visualize.histogram, and pcv.analyze.yii).
- img- image object
- filename- desired name of image file, supported extensions are PNG, JPG, and TIFF
- Often used to debug new image processing workflows
- Used to write out final results images
- Example use:
from plantcv import plantcv as pcv pcv.print_image(img, "home/user/images/test-image.png")
Source Code: Here