<p>What I found is IIQ is a proprietary raw format that PhaseOne built/uses. I was unable to find any python tools that could convert into jpeg. I did find a discussion on using <a href="https://exiftool.org/forum/index.php?PHPSESSID=543c3a150fff81e97e1d8c24c761ad06&amp;topic=3071.15" rel="nofollow noreferrer">exiftool</a> with IIQ if anyone finds that helpful. I evntually found that I needed to download a free trial version of <a href="https://www.captureone.com/en/account/download-trial?intent=trial-pro" rel="nofollow noreferrer">Capture One</a> in order to convert.</p>

CC BY-SA 4.0
2022-07-19T17:16:50.747Z
2022-07-19T17:16:50.747Z
Binx
<p>PhaseONE now provides <a href="https://developer.phaseone.com/sdk/" rel="nofollow noreferrer">an SDK to decode IIQ files</a> into TIFF files <em>only</em>. Once it is in TIFF format however it can be converted to JPEG. I have used this SDK to write a simply binary which performs a conversion from IIQ files to TIFF, after which bulk conversion from TIFF to JPEG is straightforward since both are now standard file formats.</p>
<p>Note that each IIQ file is a TIFF file where a <em>preview</em> image (640x480) is stored where imagery data normally lives. The actual image data from the sensor is stored as a binary string in the Exif <code>MakerNote</code> tag.</p>

CC BY-SA 4.0
2023-09-01T04:26:25.367Z
2023-09-01T04:26:25.367Z
freespace
<p>It's not python, but there is a person <a href="https://www.libraw.org/node/2665" rel="nofollow noreferrer">on the libraw forum</a> who shares C++ code to convert IIQ to tif. I haven't actually tested out their code, but from what I understand of your needs it should work. You can probably alter the code so that the output is jpg; alternatively you can re-convert afterwards to jpg.</p>
<p>Full attribution: this code was written and placed on libraw forums through <a href="https://drive.google.com/file/d/1PnbVb2J8jXkoGiOWqEa_n8A5X4-5zGTJ/view" rel="nofollow noreferrer">this Google Drive link</a> by t.sawka on 29 June, 2021.  I'm including here in case the link breaks.</p>
<pre><code>// IIQ2JPG.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include &lt;iostream&gt;
#include &lt;filesystem&gt;
#include &lt;optional&gt;
#include &lt;libraw/libraw.h&gt;
#include &lt;boost/algorithm/string.hpp&gt;

using namespace std;

using std::filesystem::path;
using std::optional;
using boost::algorithm::to_lower;

bool convert(const path&amp; in, const path&amp; out, optional&lt;path&gt; out_thumb = nullopt);


int main()
{
    path in_dir = R&quot;(...)&quot;;
    path out_dir = R&quot;(...)&quot;;

    using di = std::filesystem::directory_iterator;
    for (di it = di{ in_dir }; it != di{}; it++)
    {
        if (!it-&gt;is_regular_file())
        {
            continue;
        }
    
        auto p = it-&gt;path();
        if (!p.has_extension())
        {
            continue;
        }

        auto ext = p.extension().string();
        to_lower(ext);
        if (ext.find(&quot;iiq&quot;) == std::string::npos)
        {
            continue;
        }

        auto name = p.filename().replace_extension();
        auto op = out_dir / (name.string() + &quot;.tif&quot;);
        auto otp = out_dir / (name.string() + &quot;_thumb.pnm&quot;);

        cout &lt;&lt; &quot;in: &quot; &lt;&lt; p &lt;&lt; &quot;\n&quot;;
        cout &lt;&lt; &quot;out: &quot; &lt;&lt; op &lt;&lt; &quot;\n&quot;;
    }
    


    return 0;
}

bool convert(const path&amp; in, const path&amp; out, optional&lt;path&gt; out_thumb)
{
    LibRaw proc;
    if (proc.open_file(in.c_str()) != LIBRAW_SUCCESS)
    {
        cerr &lt;&lt; &quot;open_file\n&quot;;
        return false;
    }

    if (out_thumb)
    {
        if (proc.unpack_thumb() != LIBRAW_SUCCESS)
        {
            cerr &lt;&lt; &quot;unpack_thumb\n&quot;;
            return false;
        }

        if (proc.dcraw_thumb_writer(out_thumb-&gt;string().c_str()) != LIBRAW_SUCCESS)
        {
            cerr &lt;&lt; &quot;dcraw_thumb_writer\n&quot;;
            return false;
        }
    }

    if (proc.unpack() != LIBRAW_SUCCESS)
    {
        cerr &lt;&lt; &quot;unpack\n&quot;;
        return false;
    }

    if (proc.dcraw_process() != LIBRAW_SUCCESS)
    {
        cerr &lt;&lt; &quot;dcraw_process\n&quot;;
        return false;
    }


    proc.output_params_ptr()-&gt;output_tiff = 1;
    if (proc.dcraw_ppm_tiff_writer(out.string().c_str()) != LIBRAW_SUCCESS)
    {
        cerr &lt;&lt; &quot;dcraw_ppm_tiff_writer\n&quot;;
        return false;
    }

    proc.recycle();
}
</code></pre>

CC BY-SA 4.0
2022-07-21T16:12:27.150Z
Thank you! I'll give this a try out.
Binx
CC BY-SA 4.0
2022-07-21T12:27:49.193Z
2022-07-21T12:27:49.193Z
anonymous2
<p>I was given some PhaseOne iXM-100 <code>.IIQ</code> photos and I need to convert them into <code>.jpg</code> format. The iXM-100 was used with a DJI drone, though I am unsure if it was the M300 or M600. Due to have thousands of them, I'd like the conversion to happen programmatically (Python). I've tried a couple different methods, but both have failed.</p>
<p>First Code Block; works, but the output image is static. Seems that when I change the <a href="https://stackoverflow.com/questions/3397157/how-to-read-a-raw-image-using-pil">image mode</a>, it changes the static color. Some modes work and some do not.</p>
<pre><code>from PIL import Image
rawData = open(&quot;D:/Downloads/P0036906.IIQ&quot;, 'rb').read()
imgSize = (640,480)
img = Image.frombytes('RGB', imgSize, rawData)
img.save(&quot;D:/Downloads/P0036906.jpg&quot;)
</code></pre>
<p>Second Code Block; errors out. Seems that the library cannot read an <code>.iiq</code> format</p>
<pre><code>import rawpy
import imageio

path = &quot;D:/Downloads/P0036906.IIQ&quot;

with rawpy.imread(path) as raw:
    rgb = raw.postprocess()
    imageio.imwrite('D:/Downloads/P0036906.jpg', rgb)

Traceback (most recent call last):
  File &quot;iqq_jpg.py&quot;, line 23, in &lt;module&gt;
    rgb = raw.postprocess()
  File &quot;rawpy\_rawpy.pyx&quot;, line 887, in rawpy._rawpy.RawPy.postprocess
  File &quot;rawpy\_rawpy.pyx&quot;, line 790, in rawpy._rawpy.RawPy.dcraw_process
  File &quot;rawpy\_rawpy.pyx&quot;, line 438, in rawpy._rawpy.RawPy.ensure_unpack
  File &quot;rawpy\_rawpy.pyx&quot;, line 432, in rawpy._rawpy.RawPy.unpack
  File &quot;rawpy\_rawpy.pyx&quot;, line 936, in rawpy._rawpy.RawPy.handle_error
rawpy._rawpy.LibRawIOError: b'Input/output error'
</code></pre>
<p>Any suggestions on how to convert IIQ to JPG?</p>
<p>Input:
<a href="https://i.sstatic.net/PdmUU.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PdmUU.jpg" alt="enter image description here" /></a></p>
<p>Output RGB:
<a href="https://i.sstatic.net/j5sts.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/j5sts.jpg" alt="enter image description here" /></a></p>
<p>Output CMYK:
<a href="https://i.sstatic.net/upYlC.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/upYlC.jpg" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-09-06T05:02:34.210Z
I can convert an IIQ image using anonymous2♦'s code, but the jpg appears to have a greenish color layer, I think because the white balance is missing. Any suggestions on how to get the image with the right colors?
exsurge-domine
CC BY-SA 4.0
2022-09-06T14:41:48.173Z
I have not attempted to use anonymouse2 code yet. I don't have a ton of experience using JS. You can download a free version of Capture One's software and convert them to JPEG. Take a look at the second answer.
Binx
<dji><camera>
PhaseOne iXM-100 IIQ to JPG
Binx
# PhaseOne iXM-100 IIQ to JPG

(Asked by: username_0 on 2022-07-18)

I was given some PhaseOne iXM-100 .IIQ photos and I need to convert them into .jpg format. The iXM-100 was used with a DJI drone, though I am unsure if it was the M300 or M600. Due to have thousands of them, I'd like the conversion to happen programmatically (Python). I've tried a couple different methods, but both have failed.
First Code Block; works, but the output image is static. Seems that when I change the image mode, it changes the static color. Some modes work and some do not.
from PIL import Image
rawData = open("D:/Downloads/P0036906.IIQ", 'rb').read()
imgSize = (640,480)
img = Image.frombytes('RGB', imgSize, rawData)
img.save("D:/Downloads/P0036906.jpg")

Second Code Block; errors out. Seems that the library cannot read an .iiq format
import rawpy
import imageio

path = "D:/Downloads/P0036906.IIQ"

with rawpy.imread(path) as raw:
    rgb = raw.postprocess()
    imageio.imwrite('D:/Downloads/P0036906.jpg', rgb)

Traceback (most recent call last):
  File "iqq_jpg.py", line 23, in 
    rgb = raw.postprocess()
  File "rawpy\_rawpy.pyx", line 887, in rawpy._rawpy.RawPy.postprocess
  File "rawpy\_rawpy.pyx", line 790, in rawpy._rawpy.RawPy.dcraw_process
  File "rawpy\_rawpy.pyx", line 438, in rawpy._rawpy.RawPy.ensure_unpack
  File "rawpy\_rawpy.pyx", line 432, in rawpy._rawpy.RawPy.unpack
  File "rawpy\_rawpy.pyx", line 936, in rawpy._rawpy.RawPy.handle_error
rawpy._rawpy.LibRawIOError: b'Input/output error'

Any suggestions on how to convert IIQ to JPG?
Input:

Output RGB:

Output CMYK:

**Tags:** dji, camera
> **Comments:**
> **username_1**: I can convert an IIQ image using anonymous2♦'s code, but the jpg appears to have a greenish color layer, I think because the white balance is missing. Any suggestions on how to get the image with the right colors?  
> **username_0**: I have not attempted to use anonymouse2 code yet. I don't have a ton of experience using JS. You can download a free version of Capture One's software and convert them to JPEG. Take a look at the second answer.  

---

## 3 answers

### Answer by username_0 on 2022-07-19. Score: 0 | Accepted answer

What I found is IIQ is a proprietary raw format that PhaseOne built/uses. I was unable to find any python tools that could convert into jpeg. I did find a discussion on using [exiftool](https://exiftool.org/forum/index.php?PHPSESSID=543c3a150fff81e97e1d8c24c761ad06&topic=3071.15) with IIQ if anyone finds that helpful. I evntually found that I needed to download a free trial version of [Capture One](https://www.captureone.com/en/account/download-trial?intent=trial-pro) in order to convert.


---

### Answer by username_2 on 2023-09-01. Score: 3

PhaseONE now provides [an SDK to decode IIQ files](https://developer.phaseone.com/sdk/) into TIFF files *only*. Once it is in TIFF format however it can be converted to JPEG. I have used this SDK to write a simply binary which performs a conversion from IIQ files to TIFF, after which bulk conversion from TIFF to JPEG is straightforward since both are now standard file formats.

Note that each IIQ file is a TIFF file where a *preview* image (640x480) is stored where imagery data normally lives. The actual image data from the sensor is stored as a binary string in the Exif `MakerNote` tag.


---

### Answer by username_3 on 2022-07-21. Score: 1

It's not python, but there is a person on the libraw forum who shares C++ code to convert IIQ to tif. I haven't actually tested out their code, but from what I understand of your needs it should work. You can probably alter the code so that the output is jpg; alternatively you can re-convert afterwards to jpg.
Full attribution: this code was written and placed on libraw forums through this Google Drive link by t.sawka on 29 June, 2021.  I'm including here in case the link breaks.
// IIQ2JPG.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include 
#include 
#include 
#include 
#include 

using namespace std;

using std::filesystem::path;
using std::optional;
using boost::algorithm::to_lower;

bool convert(const path& in, const path& out, optional out_thumb = nullopt);


int main()
{
    path in_dir = R"(...)";
    path out_dir = R"(...)";

    using di = std::filesystem::directory_iterator;
    for (di it = di{ in_dir }; it != di{}; it++)
    {
        if (!it->is_regular_file())
        {
            continue;
        }
    
        auto p = it->path();
        if (!p.has_extension())
        {
            continue;
        }

        auto ext = p.extension().string();
        to_lower(ext);
        if (ext.find("iiq") == std::string::npos)
        {
            continue;
        }

        auto name = p.filename().replace_extension();
        auto op = out_dir / (name.string() + ".tif");
        auto otp = out_dir / (name.string() + "_thumb.pnm");

        cout << "in: " << p << "\n";
        cout << "out: " << op << "\n";
    }
    


    return 0;
}

bool convert(const path& in, const path& out, optional out_thumb)
{
    LibRaw proc;
    if (proc.open_file(in.c_str()) != LIBRAW_SUCCESS)
    {
        cerr << "open_file\n";
        return false;
    }

    if (out_thumb)
    {
        if (proc.unpack_thumb() != LIBRAW_SUCCESS)
        {
            cerr << "unpack_thumb\n";
            return false;
        }

        if (proc.dcraw_thumb_writer(out_thumb->string().c_str()) != LIBRAW_SUCCESS)
        {
            cerr << "dcraw_thumb_writer\n";
            return false;
        }
    }

    if (proc.unpack() != LIBRAW_SUCCESS)
    {
        cerr << "unpack\n";
        return false;
    }

    if (proc.dcraw_process() != LIBRAW_SUCCESS)
    {
        cerr << "dcraw_process\n";
        return false;
    }


    proc.output_params_ptr()->output_tiff = 1;
    if (proc.dcraw_ppm_tiff_writer(out.string().c_str()) != LIBRAW_SUCCESS)
    {
        cerr << "dcraw_ppm_tiff_writer\n";
        return false;
    }

    proc.recycle();
}

> **Comments:**
> **username_0**: Thank you! I'll give this a try out.  

---

