title: How to convert hex string to color image in python?
body: <p>i'm new in programming so i have some question about converting string to color image.</p>
  
  <p>i have one data , it consists of Hex String, like a fff2f3.....
  i want to convert this file to png like this.</p>
  
  <p><a href="https://i.stack.imgur.com/Uh2U9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Uh2U9.png" alt="enter image description here"></a></p>
  
  <p>i can convert the hex data to png image through  <a href="http://tomeko.net/online_tools/hex_to_file.php?lang=en" rel="noreferrer">this site</a>
  but i don't know how to convert the hex data to png image using python code 
  but i tried to use <code>Image.frombytes('RGB',(1600,1059),hex_str)</code> but 
  i don't know image size , so i cannot use this method.</p>
  
  <p>so My question is how can i convert this hex <a href="https://github.com/SoulDuck/tmp_repository/blob/master/binary_file" rel="noreferrer">data</a> to image using python code</p>
  
  <p></p>
  
  <p>please give me some advise , thank you :)</p>