0

I am slicing an image using Python's split_image package.

from split_image import split_image
img = "path\to\input\image"
split_image(img, 4, 2, False, False, open("\path\to\output\images", "w"))

Essentially, the above code should read the input image, split it into 8 parts and write the set of sliced images to a folder. However, I get the following error:

[Errno 13] Permission denied: "\path\to\output\images".

Is there a workaround for this problem?

Nanda
  • 361
  • 1
  • 5
  • 14
  • Well, do you have write permissions to that directory? Whta happens when you use forward slashes: `open("/path/to/output/images/", "w")`? – Ocaso Protal Nov 14 '22 at 13:20
  • Does this answer your question? [Errno 13 Permission denied Python](https://stackoverflow.com/questions/41910583/errno-13-permission-denied-python) – Adelina Nov 14 '22 at 13:20
  • I do have permission for that directory. – Nanda Nov 14 '22 at 13:31
  • Is the path correct? Your input dir starts without a leading backslash while your output has a leading backslash? – Ocaso Protal Nov 14 '22 at 14:35

0 Answers0