コード例 #1
0
 def generate_image(self, chars):
     text_drawings = [
         image.warp(),
         image.rotate(),
         image.offset(),
     ]
     fn = image.captcha(
         drawings=[
             image.background(color='#FFFFFF'),
             image.text(fonts=self._fonts, drawings=text_drawings),
             image.curve(width=2),
             image.curve(width=2),
             image.curve(width=2),
             image.noise(number=60, color='#5C87B2', level=2),
             image.smooth(),
         ],
         width=self._width,
         height=self._height,
     )
     return fn(chars)
コード例 #2
0
 def generate_image(self, chars):
     text_drawings = [
         image.warp(),
         image.rotate(),
         image.offset(),
     ]
     fn = image.captcha(
         drawings=[
             image.background(),
             image.text(fonts=self._fonts, drawings=text_drawings),
             image.curve(),
             image.noise(),
             image.smooth(),
         ],
         width=self._width,
         height=self._height,
     )
     return fn(chars)
コード例 #3
0
ファイル: captcha.py プロジェクト: wushuyi/wsy_captcha
 def generate_image(self, chars):
     text_drawings = [
         image.warp(),
         image.rotate(),
         image.offset(),
     ]
     fn = image.captcha(
         drawings=[
             image.background(),
             image.text(fonts=self._fonts, drawings=text_drawings),
             image.curve(),
             image.noise(),
             image.smooth(),
         ],
         width=self._width,
         height=self._height,
     )
     return fn(chars)