Git Product home page Git Product logo

pixelpunks's Introduction

punk

pixelpunks

像素朋克,用代码生成像素头像,发挥创意,让头像飞起来

创意

我听说,在区块链上,一张24*24的像素头像可以卖到 9050 万美元,真是匪夷所思了

详情请见:

其中,最令我震惊的是:

Q:朋克图像咋产生的?

A:我们码了些代码来生成了这些角儿,然后一次性跑通了代码,创造了网站上你看到的这10000个。

啥情况,头像还可以代码随机生成?我不信,我也用代码试试!

实现

经过研究,发现并不能猴子在键盘上跳舞随机生成,而是先预设一些素材,包括:人物模型,装饰,然后通过代码随机组合而成。

这些素材虽然寥寥几笔,但也足够传神,称之为像素艺术也不算过誉。

既然如此, 那就用代码实现一下吧,详情见代码。

执行

先安装依赖库 pypng

pip install pypng

执行

python punk.py

查看当前目录,已经生成了一个 punk.png 头像。

自定义素材

请参考:

  • templete.py 中的 man
  • stickers.py 中的 cigarette

制作自己的素材,然后在 punk.py 中配置参数,生成自己的像素头像。

然后,把像素头像放到以太坊,也许下一个百万美元头像就是你的:)

pixelpunks's People

Contributors

tonglei100 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pixelpunks's Issues

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.