Giter Site home page Giter Site logo

img-captcha's Introduction

img-captcha 图片验证码

主要是采用canvas在图片源上的随机位置进行不规则图形的抠图,然后拖动抠出的图形进行位置匹配验证。

当然,在前端进行随机随机位置的选择存在不安全性,更保险的方式还是在服务端讲抠好的图片传到前端来进行验证。

支持传入多张图片,随机选择某一张图片进行验证

运行起来大概是这样的^_^(可能加载的有点慢)

查看example代码

example.gif

优化后的抠图算法,效果如下,相比而言,没有了黑边,体验更好点。

example2.gif

img-captcha's People

Contributors

shenzhim avatar kxbin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.