I would to implement a method to store pixel (RGB/RGBA) in a Smart contract (on ethereum-classic blockchain) from python and with the cheapest method ( when storing and updating pixel data)

I try to find some smart contract example used to store/update picture data ... but can't find a reliable tutorial.

Someone have already done this job ?

PS: What will be the final cost to store a 4K picture (8 847 360 pixels in RGB ) ?

2 Answers 2


Each pixel is represented with 1 byte. You will need 8847360 bytes. Each word is 32bytes, you need 276480 words. Storing each word will cost 20000 which adds to 5529600000 gas. Assuming you save this by pieces (the block limit is only ~8000000 gas) you will need 691 blocks and 22 ether (in Ethereum). In Ethereum classic is about 110 ETC.

  • RGB pixels are 3 bytes, not 1. RGBA will be 4. Commented Oct 30, 2018 at 14:52
  • 1
    This is absolutely irrelevant, if this is impractical assuming a grayscale image, then is impractical assuming a structure with three layers
    – Jaime
    Commented Oct 30, 2018 at 14:57

Dunno why this popped up as active on here today. But just for a laugh, at todays prices of $1,289 ETH and a standard gas price of 54 gwei, (and 4 bytes for RGBA) you'd need 1194.3936 ETH

or $1,539,573.35

Hope the picture is worth saving for eternity!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.