Generating a 3D CAPTCHA [pic]

后端 未结 4 1362
误落风尘
误落风尘 2020-12-28 09:05

I would like to write a Python script that would generate a 3D CAPTCHA like this one: \"teabag

Which

4条回答
  •  伪装坚强ぢ
    2020-12-28 09:38

    Use Python bindings for OpenGL, http://pyopengl.sourceforge.net/.

    Create a 2D image of white color text over a black surface using PIL. Make a 3D grid from this, increase z of point where color is white, maybe set z=color value, so by blurring the image you can get real curves in the z direction.

    Create an OpenGL triangle from these points, use wireframe mode while rendering.

    Grab the OpenGL buffer into an image, for example, http://python-opengl-examples.blogspot.com/2009/04/render-to-texture.html.

提交回复
热议问题