Solidity is the official language for ethereum. I wander that can this language process images or would it support library like OpenCV?

  • Why the Fullwidth Question Mark?
    – kalsowerus
    Oct 19, 2017 at 12:32

2 Answers 2


there is no such thing(OpenCV) in Ethereum. Besides solidity is designed to be runned in an isolated VM so you can't access any file from outside the VM, so you can't even try to setup a library for image processing.

  • i agree with you but the question was about a library like opencv, which enable real time processing,Gesture recognition,... requiring access to external devices, streams...( what i abstracted as file).
    – Badr Bellaj
    Oct 19, 2017 at 10:12
  • Thank you very much ,it seems I should abandon processing image in smart contract. Are there any methods for this field?
    – kid zrp
    Oct 23, 2017 at 2:16
  • AFIK there isn't, i think you can make the processing off-chain and use a blockchain for storing streams prints(hash) or files (ipfs, swarm,..). please don't forget to accept one of the precedent answers .
    – Badr Bellaj
    Oct 23, 2017 at 9:06


There is currently no built-in Solidity support for images at all, and there is currently no library to do so. And as it stands now, if you wrote the library yourself, it would cost too much gas.

There are currently no plans to add image processing to the Solidity language.

It is in general a good idea to do as much work as possible off-chain, and only use on-chain Solidity code for verification and sending, receiving and storing currency.

  • Thank you very mucn @Jesse Busman, gas is sure a big limition for calculation in Ethereum,but if I put it off-chain ,I should ensure that the node is reliable, or the results maybe wrong . so if I can add it in smart contracts, I won't worry about it.
    – kid zrp
    Oct 23, 2017 at 2:26

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.