You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Exported PDF figures cannot be modified by Adobe Illustrator correctly. #27893
Use imshow to generate a figure, and then save it as a pdf file. If you open the generated pdf figure in Adobe Illustrator, the figure in Adobe Illustrator becomes different. Colors are wrongly assigned.
I can reproduce this with Illustrator 2023. But given that every other viewer handles this properly, including Acrobat and Photoshop, my tendency is to blame Illustrator.
Can someone with a valid illustrator license report this as a bug to them? The pdf spec is complicated enough that it is possible that they have a bug, but it is also possible that we are emitting technically incorrect files and the other viewers are all buggy-in-a-useful-way or there is some undefined behavior gets lucky most of the time.
My guess is that something is going wrong with images use color palates which we recently fixed some bug with. Does this work with older versions of mpl?
I can reproduce this with Illustrator 2023. But given that every other viewer handles this properly, including Acrobat and Photoshop, my tendency is to blame Illustrator.
But the thing is, it's because of the upgrade of matplotlib that changes the outcome in Illustrator? And I'm not sure can acrobat and Photoshop modify PDF as the way used in Illustrator?
However the question remains if we are emitting a valid by the spec PDF or not. We have in the past exposed bugs in other renders (notably clipping details in librvg).
I think the options are:
we used to emit valid pdfs and after that change we no longer do but every renderer but illustrator is forgiving in the same way so it still looks OK
we are emitting valid pdf both before and after that PR but illustrator's intake code has a bug and is failing on the new pdfs
I think either is equally likely so I think what needs to happen here is:
we need to generate the simplest possible pdf that fails not and did not in older versions of Matplotlib
either decompress them (or generate them without compression) and diff them
look up the spec on what changed to see if we are violating it or not
I have run into this bug. Attaching 2 pdfs generated with the same code, from v 3.7.2 (which I confirm the issue in Illustrator 2024) and from 3.3.4 where there is no issue
Activity
jklymak commentedon Mar 9, 2024
Please show your full code. Also do other viewers work?
JerrySoybean commentedon Mar 13, 2024
That's all the code I use. Only Adobe Illustrator doesn't work correctly.
timhoffm commentedon Mar 13, 2024
The shown code is certainly not complete. It only imports matplotlib and creates a numpy array. It does not call any matplotlib functions.
JerrySoybean commentedon Mar 19, 2024
Sorry, I’ve updated the code. Thanks for this reminding.
jklymak commentedon Mar 19, 2024
I can reproduce this with Illustrator 2023. But given that every other viewer handles this properly, including Acrobat and Photoshop, my tendency is to blame Illustrator.
tacaswell commentedon Mar 22, 2024
Can someone with a valid illustrator license report this as a bug to them? The pdf spec is complicated enough that it is possible that they have a bug, but it is also possible that we are emitting technically incorrect files and the other viewers are all buggy-in-a-useful-way or there is some undefined behavior gets lucky most of the time.
My guess is that something is going wrong with images use color palates which we recently fixed some bug with. Does this work with older versions of mpl?
jklymak commentedon Mar 22, 2024
Fair enough - this bisects to PR #25704. Before 8d42212 the colors look fine in Illustrator
I'm having a little conceptual trouble understanding why that would have caused the problem though....
JerrySoybean commentedon Apr 1, 2024
But the thing is, it's because of the upgrade of matplotlib that changes the outcome in Illustrator? And I'm not sure can acrobat and Photoshop modify PDF as the way used in Illustrator?
tacaswell commentedon Apr 1, 2024
However the question remains if we are emitting a valid by the spec PDF or not. We have in the past exposed bugs in other renders (notably clipping details in librvg).
I think the options are:
I think either is equally likely so I think what needs to happen here is:
QuLogic commentedon Apr 1, 2024
Hmm, are you sure this is the correct commit? If I run the original code, I get the same PDF output (other than the creator metadata).
jklymak commentedon Apr 1, 2024
Not 100% sure. Bisecting a problem like this is a lot of manual opening and closing of files so I may have messed up
mxposed commentedon Jul 1, 2025
I have run into this bug. Attaching 2 pdfs generated with the same code, from v 3.7.2 (which I confirm the issue in Illustrator 2024) and from 3.3.4 where there is no issue
test_3.7.2.pdf
test_3.3.4.pdf