简体   繁体   English

创建唯一图像(GUID到图像)

[英]Create Unique Image (GUID to Image)

I'd like to do something like SO does with profile pictures of new users. 我想做一些类似于新用户的个人资料图片的事情。 It seems to create a unique image based on a value. 它似乎基于一个值创建一个独特的图像。

How can I repeatedly create the same unique image from a GUID? 如何从GUID重复创建相同的唯一图像?

I'm open to doing this on the server, but would prefer a client side solution to create it on the fly. 我愿意在服务器上执行此操作,但更喜欢客户端解决方案来动态创建它。

Something like these: 像这样的东西:

在此输入图像描述在此输入图像描述在此输入图像描述

Edit: How can I repeatedly create the same unique "nice looking" image from a GUID? 编辑:如何从GUID重复创建相同的独特“漂亮”图像?

What you are looking for is called an Identicon . 您正在寻找的是一个Identicon

I think this post might either give you want you want or give you some sample code to look at in order to generate your own images. 我认为这篇文章可能会让你想要你想要或者给你一些示例代码来查看以生成你自己的图像。

http://www.puls200.de/?p=316 http://www.puls200.de/?p=316

GUID is byte array - so it is already a raw data for an image if you treat the same data as bitmap. GUID是字节数组 - 因此,如果将相同的数据视为位图,则它已经是图像的原始数据。

If your question is "how to create nice image" it is different story. 如果你的问题是“如何创造美好的形象”,那就是不同的故事。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM