Yes, you can upload images or any files or other data to the tangle.
As long as their size is less than 2187 trytes you can put them into one tx (=transaction). If they are bigger (=more trytes) than that, you can still send them by just putting them into multiple txs that reference each other (similar to a bundles for value txs).
So for example if you want to send data that is 3000 trytes, you have to put it into 2 txs.
You can use this tool to find out how many transactions you need for a certain picture/file.
Keep in mind that you have to do the POW for each tx which can be insanely high for big files/images.
You have to put the data into the place where you would put the signature for a spending tx: the signature message fragment
signatureMessageFragment
: String 2187-trytes signature message fragment.
In case there is a spent input, the signature of the private key is stored here. If no signature is required, it is empty (all 9's) and can be used for storing the message value when making a transfer.
https://domschiener.gitbooks.io/iota-guide/content/chapter1/transactions-and-bundles.html
Convert binary image files (png, jpg, bmp) to trinary messages and vice versa
If you want to convert a picture to a IOTA message, you have to read the file and save it into a byte-array or similar (byte[]
in Java/C#, char*
in C, bytes()
in python, Uint8Array()
in JavaScript). I will not explain how to do that here as you can look it up on Stackoverflow or just duckduckgo/google it.
function String[] btop(bytes[]){
// binary to presentation
}
converts the bytes[]
to a string representation of the tryte message or multiple strings in case message > 2187
Now you can add this message/these messages to a transaction and attach them to the Tangle.
The receiver reads the message(s) from the Tangle and then uses a function like this:
function bytes[] ptob(String[]){
// presentation to binary
}
to convert the trytes back to a byte[]
, which can be written to a file.
Practice
Using iota-storage.net, I was able to upload your picture to the Tangle. Checkout their GitHub.