How to save figure using .pyscript?

37 Views Asked by At

The below code shows what i have tried.It works fine in the jupyter notebook but shows blank when i try in pyscript.

<py-config>
        "packages" = ["pandas","Jinja2","openpyxl","opencv-python"]
        [files]
        "n2.png" = "n2.png"
</py-config>
<script type="py">
      import cv2
      from pyscript import display
      img = cv2.imread("n2.png")
      h, w, channels = img.shape
      image1 = img[:60, :1000]
      cv2.imwrite('image1.jpg',image1)
</script>
0

There are 0 best solutions below