I'm trying to create random shapes and found this beautiful post: https://stackoverflow.com/a/50751932/10267489
It worked fine, and print perfectly using matplotlib. I tried to port it to pillow as follows:
data = np.zeros((size, size, 3), dtype=np.uint8)
x_ = np.round(x).astype(int)
y_ = np.round(y).astype(int)
data[x_,y_] = (250,250,250)
im = Image.fromarray(data)
plt.figure(figsize = (20,20))
plt.imshow(im)
plt.show()
However, it doesn't create the smooth line I get in matplotlib. So the question is if there any way to do that in a better way. A solution I found was to plot it and then use the figure to save it in a buffer and then open in pillow, but was wondering if there is a faster and better approach.
Thank you!!