We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linegen.distort_line
I'm not sure this linegen.distort_line is supposed to be public/maintained, but every once in a while (about 1% of cases I reckon) it generates:
Here's grossly what I'm doing:
from PIL import ImageFilter import random from my_package import my_line_drawing_func line_text = '180. γπαραλλαγή λέξεων — From Dindorf we read Hello world.' image = my_line_drawing_func(line_text) # This is a PIL image for i in range(300): # Setting my custom distortion parameters distort = random.gauss(2.8, 0.5) distort = max(min(distort, 4), 1.5) sigma = random.choices([9,10, 11], weights=[0.1, 0.8, 0.1])[0] eps = random.choices([random.uniform(0.01, 0.1), 0.03], weights=[0.2, 0.8])[0] distorted =distort_line(image, distort=distort, sigma=10, eps=eps) if not 0.85 * image.size[1] < distorted.size[1] < 1.7 * image.size[1]: # To avoid weird truncation and whiteboards print('Weird behaviour') distorted.show() continue
It's a bit hard to reproduce as there are many steps using random in distort_line itself and as you see, I found I lazy workaround.
distort_line
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm not sure this
linegen.distort_line
is supposed to be public/maintained, but every once in a while (about 1% of cases I reckon) it generates:Here's grossly what I'm doing:
It's a bit hard to reproduce as there are many steps using random in
distort_line
itself and as you see, I found I lazy workaround.The text was updated successfully, but these errors were encountered: