Question: I want to convert .raw file to .jpg or .png using some plain python code or any module that is supported in python 2.7 in windows environment.

I tried `rawpy`, PIL modules.
But I am getting some attribute error(frombytes not found); because it is supported in Python3. Let me know if i am wrong..

In `rawpy` the RAW format is not supported.

I need some module or some code that will change .raw to either png or jpeg.

Answer: 
use PIL library

```
from PIL import Image

im = Image.open("img.raw")
rgb_im = im.convert('RGB')
rgb_im.save('img.jpg')

```
You can use the convert utility which comes with image magic. 

```
convert -size 640x360 -depth 8 bgr:input.raw out.jpeg 

```

-size -> WxH 
bgr is the format of data. it can be rgb also.