'How to convert string bytes to a PNG file?
I am trying to convert a SVG to a PNG. I'm using a service called cloudmersive. You can use it to convert one image format such as SVG to a PNG.
The problem is that I don't have any clue how to use what the API returns, which is a string bytes like this:
'b\'\\x89PNG\\r\\n\\x1a\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x00d\\x00\\x00\\x00d\\x08\\x03\\x00\\x00\\x00G<ef\\x00\\x00\\x00\\x04gAMA\\x00\\x00\\xb1\\x8f\\x0b\\xfca\\x05\\x00\\x00\\x00 cHRM\\x00\\x00z&\\x00\\x00\\x80\\x84\\x00\\x00\\xfa\\x00\\x00\\x00\\x80\\xe8\\x00\\x00u0\\x00\\x00\\xea`\\x00\\x00:\\x98\\x00\\x00\\x17p\\x9c\\xbaQ<\\x00\\x00\\x01\\xf5PLTE\\xff\\xff\\xff\\xff\\xf9\\xf7\\xff\\xeb\\xe3\\xff\\xdd\\xcf\\xff\\xcf\\xbc\\xff\\xc8\\xb2\\xff\\xc4\\xac\\xff\\xc0\\xa6\\xff\\xc5\\xae\\xff\\xca\\xb4\\xff\\xdd\\xd0\\xff\\xed\\xe6\\......\\xaeB`\\x82\''
I don't know how to write this to a PNG file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
