晨旭的博客
你想干什么!
晨旭的博客~
如何制作自定义背景的二维码?(包括动态)
如何制作自定义背景的二维码?(包括动态)

今天在知乎上看到一篇文章《如何优雅地让人给你打钱》

文章详情:http://spacekid.me/qart-code/

用这篇文章提供的工具,我成功做出来了自定义的二维码:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/62411486785587.gif?imageView2/2/w/135/h/135|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/27001486785587.gif?imageView2/2/w/111/h/111|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/46481486785587.gif?imageView2/2/w/135/h/135|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

↑上面的图片大家可以用QQ扫一扫,能扫出来的

下面开始讲教程:

0x00:制作黑白底的二维码:

方法:

打开http://spacekid.me/halftone-qr-code-generator/

然后按照要求做就行了

0x01:制作彩色底的二维码:

首先下载软件 链接:http://pan.baidu.com/s/1dFx4zLZ 密码:hw7t

解压,打开VisualQRC.exe

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/2011486785588.png?imageView2/2/w/405/h/603|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

等它加载完,然后选择图片:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/15681486785588.png?imageView2/2/w/255/h/166|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

右下角可以选别的格式:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/54751486785589.png?imageView2/2/w/318/h/231|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

选完之后写上自己想显示的文字/网址(中文内容的话只能用qq扫才不会乱码):

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/47381486785589.png?imageView2/2/w/356/h/210|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

然后会看到下面的界面:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/33631486785589.png?imageView2/2/w/500/h/340|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

我们需要导出彩色图像,所以点上彩色选项:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/20861486785589.png?imageView2/2/w/331/h/180|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

最后点左上角的导出就可以了:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/7901486785590.png?imageView2/2/w/137/h/137|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/2801486785590.png?imageView2/2/w/333/h/400|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/76901486785590.png?imageView2/2/w/500/h/340|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

最终效果:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/12601486785590.jpeg?imageView2/2/w/135/h/135|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

0x02:制作动态的彩色二维码:

建议先准备好两个软件:photoshop和格式工厂

首先找好一个gif,然后拿ps打开:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/71281486785590.png?imageView2/2/w/800/h/576|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

然后选择“文件-导出-渲染视频”导出成MP4格式:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/31181486785591.png?imageView2/2/w/451/h/486|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

然后把这个MP4扔到格式工厂里转成avi格式,“输出选项” – “视频编码”改成 “MJPEG”

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/79121486785591.png?imageView2/2/w/650/h/392|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

然后我们就得到了一个avi文件。

坑爹的地方就在这里:如果你直接把avi扔进Visual QR Codes Generator里,生成的时候它就会报错

然后我发现这坑爹货用的是opencv

为了让软件能利用这个avi文件,我们要进行如下处理:

下载virtualdub:链接:http://pan.baidu.com/s/1nuMa1hZ 密码:6kmp

打开VirtualDub.exe,导入那个avi视频(open-open video file):

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/17961486785591.png?imageView2/2/w/402/h/361|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

然后选择Video->Filters->Add->Convert format,选择32-Bit RGB,最后点击ok:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/2731486785591.png?imageView2/2/w/532/h/390|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

然后点击file-save av AVI保存处理后的视频文件(注意改文件名):

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/57801486785591.png?imageView2/2/w/87/h/93|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

后面的步骤就和前面差不多啦,打开VisualQRC.exe,选上这个视频,写上自己的文字,选上彩色,点导出,选ok:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/89921486785592.png?imageView2/2/w/650/h/442|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

接下来我们在视频压缩对话框的压缩程序选项选上“全帧”,然后点确认,导出视频:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/85231486785592.png?imageView2/2/w/284/h/149|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

我们得到了导出的视频文件

然后打开我们的ps,选择文件-导入-视频帧到图层:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/2551486785592.png?imageView2/2/w/446/h/426|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

选上导出的avi,然后点击确认:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/43961486785592.png?imageView2/2/w/650/h/468|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

然后选择文件-储存为web所用格式,右边选上gif,点击储存保存图片即可:

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/52491486785593.png?imageView2/2/w/650/h/489|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

做出效果如下(每帧时间没调整,所以变成了这样2333):

https://source.papapoi.com/wp-content/plugins/new-ueditor/ueditor/php/upload/25551486785593.gif?imageView2/2/w/135/h/135|watermark/1/image/aHR0cDovL3NvdXJjZS5wYXBhcG9pLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxNi8wOC9sb2dvcGljLnBuZw==/dissolve/100/gravity/SouthEast/dx/10/dy/10

教程完毕!

2017.2.11更新:

好像发现了有人做好轮子了:https://github.com/sylnsfar/qrcode_win

赞赏
如非特殊说明,本站所有文章均采用知识共享 署名-非商业性使用-相同方式共享4.0国际许可协议(CC BY-NC-SA 4.0)进行许可。

相关文章

发表评论

textsms
account_circle
email

晨旭的博客~

如何制作自定义背景的二维码?(包括动态)
今天在知乎上看到一篇文章《如何优雅地让人给你打钱》文章详情:http://spacekid.me/qart-code/用这篇文章提供的工具,我成功做出来了自定义的二维码:↑上面的图片大家可以用QQ扫一扫,能…
扫描二维码继续阅读
2016-05-22