Advertisement
s2c-code-share

Automation Script Example: Converting Raster Image with Outline Vectorization Method

Feb 15th, 2022
1,447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. preset = s2c.Preset()
  2. preset.method = s2c.Preset.Method.Outline
  3. preset.outline.definition = 15
  4. preset.outline.bias_orthogonal = True
  5. preset.outline.bias = s2c.Preset.Outline.Bias.Angular
  6. preset.outline.type = s2c.Preset.Outline.Types.Bezier
  7.  
  8. imgs = s2c.list("path/to/input_directory", "jpg")
  9. for i in imgs:
  10.     r = i.open()
  11.     r.threshold()
  12.     v = r.vectorize(preset)
  13.     v.save(r.path)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement