Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone

Description
Hi,
Due to issuepython-pillow/Pillow#2609 , I cannot save anymore my Matplotlib graphs to JPG format (with the alpha layers merged together) since Conda upgraded Pillow to version 4.2. This used to work before:
self._fig.savefig(file_name, dpi=dpi, bbox_inches='tight', bbox_extra_artists=bbox_extra_artists, pad_inches=.4)File "/path/to/Conda-linux-x64/lib/python2.7/site-packages/matplotlib/figure.py", line 1565, in savefigself.canvas.print_figure(*args, **kwargs)File "/path/to/Conda-linux-x64/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 2232, in print_figure**kwargs)File "/path/to/Conda-linux-x64/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 583, in print_jpgreturn image.save(filename_or_obj, format='jpeg', **options)File "/path/to/Conda-linux-x64/lib/python2.7/site-packages/PIL/Image.py", line 1893, in savesave_handler(self, fp, filename)File "/path/to/Conda-linux-x64/lib/python2.7/site-packages/PIL/JpegImagePlugin.py", line 604, in _saveraise IOError("cannot write mode %s as JPEG" % im.mode)IOError: cannot write mode RGBA as JPEG
Downgrading to Pillow 4.1 (conda install pillow=4.1
)makes this code work.
Is it possible to force the merge of the alpha channel before or when writing? Adding, transparent=False
tosavefig
did not help.
I guess that featurepython-pillow/Pillow#2663 will fix this problem.
Thanks.
Metadata
Metadata
Assignees
Labels
No labels