Ticket #13306: mythburn-RGBA-JPEG.patch
| File mythburn-RGBA-JPEG.patch, 4.3 KB (added by , 8 years ago) |
|---|
-
(a) mythburh.py.orig vs. (b) mythburn.py
a b 3616 3616 bgimage.paste(overlayimage, (0,0), overlayimage) 3617 3617 3618 3618 #Save this menu image and its mask 3619 bgimage.save(os.path.join(getTempPath(),"background-%s.jpg" % page),"JPEG", quality=99) 3619 rgb_bgimage=bgimage.convert('RGB') # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python 3620 rgb_bgimage.save(os.path.join(getTempPath(),"background-%s.jpg" % page),"JPEG", quality=99) 3621 del rgb_bgimage 3620 3622 bgimagemask.save(os.path.join(getTempPath(),"backgroundmask-%s.png" % page),"PNG",quality=99,optimize=0,dpi=screendpi) 3621 3623 3622 3624 #now that the base background has been made and all the previews generated … … 3654 3656 del picture 3655 3657 previewitem+=1 3656 3658 #bgimage.save(os.path.join(getTempPath(),"background-%s-f%06d.png" % (page, framenum)),"PNG",quality=100,optimize=0,dpi=screendpi) 3657 bgimage.save(os.path.join(getTempPath(),"background-%s-f%06d.jpg" % (page, framenum)),"JPEG",quality=99) 3659 rgb_bgimage=bgimage.convert('RGB') # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python 3660 rgb_bgimage.save(os.path.join(getTempPath(),"background-%s-f%06d.jpg" % (page, framenum)),"JPEG",quality=99) 3661 del rgb_bgimage 3658 3662 framenum+=1 3659 3663 3660 3664 spumuxdom.documentElement.firstChild.firstChild.setAttribute("select",os.path.join(getTempPath(),"backgroundmask-%s.png" % page)) … … 3821 3825 #Save this menu image and its mask 3822 3826 bgimage=Image.open(backgroundfilename,"r").resize(screensize) 3823 3827 bgimage.paste(overlayimage, (0,0), overlayimage) 3824 bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.jpg" % page),"JPEG", quality=99) 3828 rgb_bgimage=bgimage.convert('RGB') # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python 3829 rgb_bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.jpg" % page),"JPEG", quality=99) 3830 del rgb_bgimage 3825 3831 3826 3832 bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=90,optimize=0) 3827 3833 … … 3850 3856 bgimage.paste(picture, (previewx[previewchapter], previewy[previewchapter])) 3851 3857 del picture 3852 3858 previewchapter+=1 3853 bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s-f%06d.jpg" % (page, framenum)),"JPEG",quality=99) 3859 rgb_bgimage=bgimage.convert('RGB') # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python 3860 rgb_bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s-f%06d.jpg" % (page, framenum)),"JPEG",quality=99) 3861 del rgb_bgimage 3854 3862 framenum+=1 3855 3863 3856 3864 spumuxdom.documentElement.firstChild.firstChild.setAttribute("select",os.path.join(getTempPath(),"chaptermenumask-%s.png" % page)) … … 3971 3979 #Save this details image 3972 3980 bgimage=Image.open(backgroundfilename,"r").resize(screensize) 3973 3981 bgimage.paste(overlayimage, (0,0), overlayimage) 3974 bgimage.save(os.path.join(getTempPath(),"details-%s.jpg" % itemnum),"JPEG", quality=99) 3982 rgb_bgimage=bgimage.convert('RGB') # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python 3983 rgb_bgimage.save(os.path.join(getTempPath(),"details-%s.jpg" % itemnum),"JPEG", quality=99) 3984 del rgb_bgimage 3975 3985 3976 3986 if haspreview == True: 3977 3987 numframes=secondsToFrames(menulength) … … 3994 4004 else: 3995 4005 bgimage.paste(picture, (previewx, previewy)) 3996 4006 del picture 3997 bgimage.save(os.path.join(getTempPath(),"details-%s-f%06d.jpg" % (itemnum, framenum)),"JPEG",quality=99) 4007 rgb_bgimage=bgimage.convert('RGB') # https://stackoverflow.com/questions/43258461/convert-png-to-jpeg-using-pillow-in-python 4008 rgb_bgimage.save(os.path.join(getTempPath(),"details-%s-f%06d.jpg" % (itemnum, framenum)),"JPEG",quality=99) 4009 del rgb_bgimage 3998 4010 framenum+=1 3999 4011 4000 4012
