--- mythburh.py.orig	2019-01-25 10:04:22.000000000 -0800
+++ mythburn.py	2019-02-16 10:04:49.623830101 -0800
@@ -3616,7 +3616,9 @@
         bgimage.paste(overlayimage, (0,0), overlayimage)
 
         #Save this menu image and its mask
-        bgimage.save(os.path.join(getTempPath(),"background-%s.jpg" % page),"JPEG", quality=99)
+        rgb_bgimage=bgimage.convert('RGB')  # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python
+        rgb_bgimage.save(os.path.join(getTempPath(),"background-%s.jpg" % page),"JPEG", quality=99)
+        del rgb_bgimage
         bgimagemask.save(os.path.join(getTempPath(),"backgroundmask-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi)
 
         #now that the base background has been made and all the previews generated
@@ -3654,7 +3656,9 @@
                             del picture
                     previewitem+=1
                 #bgimage.save(os.path.join(getTempPath(),"background-%s-f%06d.png" % (page, framenum)),"PNG",quality=100,optimize=0,dpi=screendpi)
-                bgimage.save(os.path.join(getTempPath(),"background-%s-f%06d.jpg" % (page, framenum)),"JPEG",quality=99)
+                rgb_bgimage=bgimage.convert('RGB')  # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python
+                rgb_bgimage.save(os.path.join(getTempPath(),"background-%s-f%06d.jpg" % (page, framenum)),"JPEG",quality=99)
+                del rgb_bgimage
                 framenum+=1
 
         spumuxdom.documentElement.firstChild.firstChild.setAttribute("select",os.path.join(getTempPath(),"backgroundmask-%s.png" % page))
@@ -3821,7 +3825,9 @@
         #Save this menu image and its mask
         bgimage=Image.open(backgroundfilename,"r").resize(screensize)
         bgimage.paste(overlayimage, (0,0), overlayimage)
-        bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.jpg" % page),"JPEG", quality=99)
+        rgb_bgimage=bgimage.convert('RGB')  # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python
+        rgb_bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.jpg" % page),"JPEG", quality=99)
+        del rgb_bgimage
 
         bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=90,optimize=0)
 
@@ -3850,7 +3856,9 @@
                                 bgimage.paste(picture, (previewx[previewchapter], previewy[previewchapter]))
                             del picture
                     previewchapter+=1
-                bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s-f%06d.jpg" % (page, framenum)),"JPEG",quality=99)
+                rgb_bgimage=bgimage.convert('RGB')  # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python
+                rgb_bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s-f%06d.jpg" % (page, framenum)),"JPEG",quality=99)
+                del rgb_bgimage
                 framenum+=1
 
         spumuxdom.documentElement.firstChild.firstChild.setAttribute("select",os.path.join(getTempPath(),"chaptermenumask-%s.png" % page))
@@ -3971,7 +3979,9 @@
         #Save this details image
         bgimage=Image.open(backgroundfilename,"r").resize(screensize)
         bgimage.paste(overlayimage, (0,0), overlayimage)
-        bgimage.save(os.path.join(getTempPath(),"details-%s.jpg" % itemnum),"JPEG", quality=99)
+        rgb_bgimage=bgimage.convert('RGB')  # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python
+        rgb_bgimage.save(os.path.join(getTempPath(),"details-%s.jpg" % itemnum),"JPEG", quality=99)
+        del rgb_bgimage
 
         if haspreview == True:
             numframes=secondsToFrames(menulength)
@@ -3994,7 +4004,9 @@
                         else:
                             bgimage.paste(picture, (previewx, previewy))
                         del picture
-                bgimage.save(os.path.join(getTempPath(),"details-%s-f%06d.jpg" % (itemnum, framenum)),"JPEG",quality=99)
+                rgb_bgimage=bgimage.convert('RGB')  # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python
+                rgb_bgimage.save(os.path.join(getTempPath(),"details-%s-f%06d.jpg" % (itemnum, framenum)),"JPEG",quality=99)
+                del rgb_bgimage
                 framenum+=1
 
 
