diff --git a/Tools/iff2html/image.c b/Tools/iff2html/image.c
index 337f0ee..ef27fef 100644
--- a/Tools/iff2html/image.c
+++ b/Tools/iff2html/image.c
@@ -66,6 +66,14 @@ int WritePNG(const char * OutName, const IFFChunk * ChunkData, const IFFSprite *
Image.Width = Sprite->Width;
Image.Height = Sprite->Height;
Image.Data = Sprite->BGRA32Data;
+
+ /* Swap from BGR to RGB; this cannot be done with libpng when you use opng_reduce_image
+ ** due to the state that it leaves png_ptr in */
+ for(i=0; i