Pixelations are an NFT collection of 32x32 pixelated images. There are 3,232 Pixelations, each 100% stored and rendered on chain.
For this collection, we took a unique approach. Rather than designing the art ourselves, we are giving the minter the ability to provide the art. This image could be anything: an IRL photo, a painting, or a JPEG pulled off the internet.
We're two brothers, exploring the limits of what's possible on ethereum. If you want to chat, find us on the Pixelation's Discord server.
Upon minting, we perform a number of image processing steps in order to viably store your image on chain, and also reduce minting gas fees as much as possible. At a high level we do the following off chain:
1. Convert the image into 32x32 pixels.
2. Extract the 32 colors that best represent the image via k-means clustering.
3. Compress the image via bit-packing since we now only need 5-bits to represent its 32 colors.
After these off chain steps, your image is 736 bytes of data that we ship to our custom ERC-721 smart contract. The naive approach at this point, would be to store those bytes in sstore. However we utilized 0xsequence's sstore2 library to store the image data as contract code, which costs significantly less gas to both read and write from. The result is that at the time of mint, our contract ships an entirely new contract that stores your image data.
When sites like OpenSea attempt to fetch your Pixelation's metadata and image, we have a rendering contract that constructs an SVG at run-time. We utilized a number of gas efficient rendering techniques borrowed from both Chainrunners and Blitmap.