1

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 ) ?

0

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. – Raghav Sood Oct 30 '18 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 Oct 30 '18 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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