Is there any software that converts JPEG or PNG to RAW?

I have been looking around and I've only found applications that do the reverse.

  • 1
    why do you want to convert jpg to raw? It's pointless. Converting png to raw might also produces unexpected results, because png files are already demosaicized (if taken from camera), unlike filter camera sensors
    – phuclv
    Feb 22, 2017 at 8:30
  • 3
    @phuclv Because some programs only accept raw files as input (like Unity reading heightmaps).
    – Rodrigo
    Aug 24, 2018 at 21:26

3 Answers 3


I just find out here how to do that with Gimp !

Works almoust perfectly ! :P


Used method:

  1. Export the file on Gimp: Ctrl Shift E
  2. On the export window, choose Raw Image Data on Select File Type

    1. Click on Export button
  3. On the raw image export window, Choose Planar for the RGB Save Type
    1. Click on Export button
  4. Open the folder where the file was saved and rename his extension from .data to .raw
  5. On Unity3d, chose Bit 8 for Depth on the Import Heightmap window

Unfortunately, the generated image by Gimp isn't that good... So, I'm still would appreciate some help.

  • If you add the procedure to the answer I will up vote. Please remember to quote but also to place the answer locally for future reference.
    – Torrien
    Jan 22, 2016 at 5:08

Ubuntu by default has Imagemagick installed and provides the convert command line tool to convert to various image formats. You can simply do:

convert xyx.jpg xyz.RAW
  • 2
    I've just tried this, but got convert-im6.q16: no encode delegate for this image format 'RAW' @ warning/constitute.c/WriteImage/1180.
    – Rodrigo
    Aug 24, 2018 at 21:32

Answer above may work for old versions of ImageMagick, but this worked for me:

convert lena512.bmp gray:lena512.raw

and vice versa

convert -size 512x512 -depth 8 gray:lena512.raw lena512.png

For many images this works (I haven't found solution for mogrify):

parallel -j 4 convert {} gray:{}.raw ::: slice-*.png

-j is number of processes, {} gets replaced by the filename matching the mask specified after ::: so output files are named as slice-0000.png.raw

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .