Convert any String to Gradient Image
Create beautiful gradient abstract images using your own string as seed. Insert your text and generate an image based on its MD5 hash value.
— Project URL : https://text2image.moro.es
text2image is a small Web Application which converts any string in an abstract gradient image having as a constructor the MD5 hash of the text input, so basically it could be also described as the MD5 visualization of a string.
The project is built on
This is an entry for the 10k Apart contest, the index file has been minified and gzipped, all the styles and scripts have been included within this file to avoid extra request and increase speed, the whole data transfered by the client is as low as 5.7KB.
How does it work
text2image takes the input string and generates the MD5 hash value of this string. A MD5 hash consists of 32 hexadecimal characters string, this string gets splitted in 6 chunks, the first 4 will be the ones used to create the radial gradients, the 5th will be the background color and the last one will set the opacity of the background color.
e.g. we are going to use the string 'Hello world'
- We create the md5 of the string
- Hash value is :
- Hash value chunks are then :
- We use for the radial gradients chunks 1 to 4 as a base HTML hexadecimal color :
- 5th block is the background color:
- 6th block is the alpha opacity (hex):
62. This value converted in decimal is 98 (over 255) or 38 (over 100).
- Finally we have the background which is
Now that we have all the colors we can create the image:
Output Image for 'Hello world' :
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.