Images can be stored in different type of formats like PNG, JPEG or SVG files. In the NFT space almost all projects uses PNG Files to encrypt the NFT images on the blockchain. A PNG file is perfect to brag with your profile picture on internet platforms, like Discord & Twitter. However a big disadvantage of the PNG file is that the image gets blurry if you enlarge the picture to use it as a physical painting in your home. Compressing more data on your PNG file to increase the number of pixels is not a solution for blockchain technology. Using SVG files have two major advantages above other formats like JPEG and PNG:
Heavier files increases gas fees on the Ethereum blockchain making transactions more expensive for users. Another solution to decrease gas fees is to program NFTs off chain using a URI link (onchain) pointing to the image hosted on a regular server. An URI link has less data then Images making transactions even cheaper for traders. Nowadays almost all NFT projects uses URI links to store the NFT collections onchain. Whatever the choice of the programmer is, an SVG file is a great option for the artist to improve the quality of the artwork. In this blog we explain more on this SVG topic and NFTs programmed on the blockchain.
SVG means Scalable Vector Graphics. The SVG format uses ‘vector’ data to make the image visible. A vector element consist of magnitude and direction. This method makes sure the size of objects in the image are relative to the total size of the image. The lines used in the image are recalculated each time you enlarge the image. This way the image is always of good quality. So unlike JPEG and PNG files it doesn’t rely on the number of pixels used to define the quality of the image. After you download you SVG image from the blockchain you can easily print it! Another great advantage is that a SVG file is much smaller compare to the JPEG or PNG File.
We included an SVG example of our Bet Placer’s Club collection below showing a Vector based versus a Pixel Based graphic. Even when enlarged, the image remains ultra sharp!
If the images are coded onchain the gas fees are highly depended on the data compression of the image. Heavier files will increase the gas fees on the Ethereum blockchain as it takes more communication between nodes to validate the transaction. Therefore using SVG files has great advantages compared to PNG files to decrease gas fees for further trades on the marketplace. A nice to know is that one of the first SVG based collections programmed onchain is Avastars, you can check it out on the marketplace: Avastar.
Over time more NFT projects started using URI links to store the images and its metadata on the blockchain. The metadata of the image is used to define the specific traits of the NFT. For more information on this topics we recommend reading our blog: ‘NFT Generative Art Collection’.
In this blog we explained what SVG files are and how it is used in NFT blockchain technology. As an art collector you can use this information to take well considered decisions. For now trade safe and see you on the next episode!