DLL version

RIOT as IrfanView plug-in

You can acces the RIOT plug-in from IrfanView by selecting File->Save for web. Also, there is an option to set file size to use compress to size function in RIOT for JPEG images.

RIOT as XnView addon

The RIOT addon for XnView is accesible after installing by selecting Filter->RIOT if an image is viewed or Tools->Plugin->RIOT in the XnView file browser.

RIOT as GIMP plug-in

The RIOT for GIMP plug-in is available in the GIMP repository. After you install the GIMP plug-in you can access it by selecting File->Save for web using RIOT.


RIOT is available also as a DLL for developers. Programmers can freely use this DLL as a plugin for their applications. The licence states among other things:

You may use RIOT.DLL in your applications as a plugin and deploy it, provided that such copies contain all the original Product’s contents and proprietary notices

RIOT plugin can be used to provide a image saving method for your applications especially when this feature would be a nice extra and you preffer to use a third party component for that rather than program it from scratch.

Possible uses of the RIOT plugin:

  • an image viewer that wants to add the “Save for web” feature or compress to size
  • a graphic editing program or a photo editor that wants to add the “Save for web” feature or compress to size
  • a computer program that is not mainly intended to process images but lets user export the results as images
  • a web application might need “Compress to size” to limit the filesize of uploaded images. An interface to use the DLL in a web application is needed for this.

Developer reference

Riot.dll Export Functions

bool RIOT_LoadFromDIB ( HANDLE hDIB, HWND hwndParent=NULL, const char *fileName=””, const char *iniFile=””, int flags=0, const char *buf=””)

Show the optimizer and load a bitmap from a DIB handle. Returns true on success or false on failure

bool RIOT_LoadFromDIB_U(HANDLE hDIB, HWND hwndParent=NULL, const wchar_t *fileName = LPWSTR(“”), const char *iniFile=””, int flags=0)

Unicode version of LoadFromDIB with buf parameter missing (not used anyway)

bool RIOT_LoadFromFile(const char *filename, int flags=0)

Show the optimizer and load a picture from a file on disk. flags parameter is unused Return true on success or false on failure

bool RIOT_LoadFromFile_U(const wchar_t *filename, int flags=0)

Unicode version of LoadFromFile with some parameters missing

void RIOT_Show()

Show the optimizer with no file loaded

int GetPlugInInfo(char *versionString, char *fileFormats)

Sets plugin information Always returns 0

bool RIOT_SaveToFile(HANDLE hDIB, HWND hwndParent,const char *fileName,const char *origFilename=””, unsigned long byteSize=0,char *errorText=””,int flags=0, char *buf=””)

Saves the file with the specified parameters.

hDIB – handle to a Windows DIB image in memory
hwndParent – Not Used. Must be NULL.
fileName – full path to the file to be saved (only JPEG is supported)
origFilename – Fill this with the original file name if the DIB is not different than the image from the file
byteSize – filesize of the compressed JPEG image in bytes
errorText – On error errorText is filled with the error message
flags – save flags. See bellow
buf – not used. Leave blank.THe function returns true on success or false on error.If you specify byteSize you can specify any of the save flags, but the quality will not be used.
If you don’t specify byteSize flags are used.
If there are no flags or byteSize is 0 an error is thrown.Flags for RIOT_SaveToFile:0x0001 – keep EXIF
0x0002 – keep IPTC
0x0004 – keep XMP
0x0008 – keep Comments
0x1000 – keep ICC profile0x0800 – save greyscale
0x2000 – save progressive
0x10000 – disable chroma subsamplingAlso you can set a quality flag from 1 to 100Ex: flags=JPEG_SUBSAMPLING_444 | JPEG_PROGRESSIVE | 90
results in a file with no subsampling, progressive with a quality of 90
If you don’t specify quality 75 is used.
You must specify JPEG_PROGRESSIVE if you want progressive.
If you don’t specify JPEG_SUBSAMPLING_444 a default chroma of 4:2:0 is used.

bool RIOT_SaveToFile_U (HANDLE hDIB, HWND hwndParent, const wchar_t *fileName, const wchar_t *origFilename=LPWSTR(“”), unsigned long byteSize=0, char *errorText=””, int flags=0)

Unicode version of SaveToFile

Functions not present in RIOT Lite:


Show the optimizer and load a bitmap from a HBITMAP handle Returns true on success or false on failure


24 comments on “DLL version
  1. admin says:

    @Simon: yes, webP support is planned

  2. Simon says:

    Great work. Will you add the WebP-format?


  3. Ximo says:

    Thank you for your quick answer!

    EXACTLY! I works when I put Riot ini files in the same directory as “i_view32.exe”. I had tried in the “plugins” folder (where “Riot.dll” is, in fact “pngout.exe” works well from there) and even in “c:\Windows”, but the INIs are only found if they are in IrfanView root directory.

    By the way, **BOTH** Ini files (“Riot.ini” and “Riot-external-tools.ini”) must be present, even when the second one is empty. If not, the problem persists.

    I’m glad to see that although development is slow pace you’re still here and working on it.


  4. admin says:

    @ximo: This problem is related to the way IrfanView handles the UTF8 charset. It does not have native UTF support.
    Try to put Riot.ini in the same folder where the IV executable is located (this should work if the path does not contain special chars)

  5. Ximo says:

    Thank you Lucian for this nice application. It has been my optimizer choice for some time (with pngout plugin) and I’m loving it.

    I’ve been using the standalone version till now but my image viewer is IrfanView so I tried the DLL plugin version.

    But the plugin FAILS when exiting and trying to write the INI file. It says it cannot find the path. It works correctly, it’s just it cannot save the settings.

    I think it is related to having extended ASCII characters in the path name, since I’m using a Spanish version of Windows. “Local configuration” is “Configuración local” in Spanish but the error window states it’s trying to write to “…\Configuracón local\…”

    Riot 0.4.6 Dll Version
    IrfanView 4.32
    Windows XP Service Pack 3 (Spanish)

    For now back to the standalone version. I hope you address this problem for the future and continue development of this nice software.

  6. Steve Greenwood says:


    You a very gifted and talented programmer! And..quite the diplomat, as shown by your replies to the infrequent negative posts (most of which are ignorant!) .
    Thank you for sharing RIOT, it truly is quite amazing!
    You have a fan here; I’m spreading the word..

    Thanks Again

  7. Mike says:

    Amazing application. Thank you.

    Just one note:
    The external png optimizer PNGout running inside XnView (Riot DLL) currently points to
    c:\Program Files (x86)\XnView\plugins\pngout.exe

    However the PNGout downloaded from the XnView webpage is considered as an addon and is listed inside XnView in Info->Plugins Information as an addon.
    Therefore the correct path should be
    c:\Program Files (x86)\XnView\AddOn\pngout.exe
    to make it work out of the box.

    Keep up the great work!

  8. admin says:

    @giannidb: It should be \.gimp-2.8\plug-ins

  9. giannidb says:

    which folder plug-in be installed RIOT for Gimp 2.8?

  10. admin says:

    You cannot force developers to support an operating system. Like it or not, RIOT runs under Linux with Wine. So you have a choice to use it, even if it is not a native build. If you all (I see you write in the name of a group) work with Linux you should already know that Wine comes from Wine Is Not an Emulator. So it is good to know you don’t like emulators, even if you can’t tell if program is an emulator or not. 🙂

  11. Andy says:

    RIOT runs under Linux using Wine.

    It’s a joke.
    We working with Linux and don’t like Emulations.

    The same situation -> Webdesigner don’t make code for the MS-IE and telling -> This website work only with the Linux Konqueror. Please install Linux. This it’ small thinking.

  12. Chris says:

    Why is dll.zip a *.exe I expected a *.dll
    at http://luci.criosweb.ro/riot/dll-version/

  13. admin says:

    @hi-chan: Not in my knowledge

  14. hi-chan says:

    is there a Konvertor plugin available ?

  15. admin says:

    You can use the installer and manually choose the Addons folder. If you don’t want to use the installer, you can download the zip archive from here

  16. i-am says:

    File does not contain dll files. Only exe file.
    The setup does not start for XnView portable edition.
    Software trying to get out to the internet.

    This is bad.

    How to extract dll from exe?

  17. admin says:

    @chen: If you are an end-user no. If you are a developer, use the DLL version to create a program based on it.

  18. chen says:

    Hey, is there a way to use your optimizer without displaying the dialog?

    i’d like to automate a process of multiple files without the interaction of a user (backend process)

  19. admin says:

    This is a closed source project. Anyway, it is heavily dependent on the Windows API.
    The FreeImage library used by RIOT, on which I contributed also, is working though on Linux, and has a very flexible license.
    RIOT runs under Linux using Wine.

  20. Sam says:

    Could I possibly get a hold of the source for a Linux port of the dll? This way there may be a Linux version of the library for GIMP?

  21. admin says:

    @Manuel: You can take a look here.

    For more detauls you will have to post this question to a Visual Basic .NET Forum.
    This is a matter of calling a function inside a standard DLL from your programming language.

    You don’t need regsvr32 as RIOT is not an ActiveX library.

  22. Manuel says:

    Hello, I’m trying to develop a program in visual basic.net with riot.dll and when I try to reference it from the visual studio project gives me an error. I tried to register it with regsvr32 and regasm and still gives me an error. I wonder what steps I have to follow in order to reference the riot.dll in a visual studio project.
    Thanks in advance.

  23. admin says:

    @Anna McCullough: When used as plugin the image is sent as DIB that is not containing any other informations than RGBA pixels. Unfortunatelly IrfanView does not use 32 bit data, only 24 – and the transparency is not sent.
    The metadata is imported though when you open a file by using Riot->Open

    In the version 0.3.0 even when the image is a DIB (in the plugin version), if a file exists, metadata, transparency and ICC profile from original file can be imported if the program is set to do it.

  24. Anna McCullough says:

    Question on the metadata section – for me, that area is always grayed out and I cannot uncheck anything (meaning that this little plugin always strips out everything) – this happens both in the Lite and Extended versions. I’m running Irfanview 4.21… any ideas? Should I be using the standalone version?


Leave a Reply

Your email address will not be published. Required fields are marked *