AFAIK, Stream is usually when you're dealing with bytes; whether opening binary files, or reading/writing network bytes stream, or reading/writing bytes to file etc.
Especially for writing bytes, just like in the example.
The answer is simply: writeFile sure can write those and it shouldn't break it.
I do essentially the same here, the only difference is where the image comes from: https://github.com/brentp/nim-plotly/blob/master/src/plotly/image_retrieve.nim#L119
And I just ran your first code and it works fine on my end.
Thank you reply!
I used the nim language 1.0. 0. As you pointed out, I will update to 1.0. 2. Thank you!