Description of the bug
Cached data from a one PDF file can cause incorrect colors and shapes when generating a PixMap of a page of a different PDF file.
The issue does not appear when only one PDF file is opened, and explicitly clearing the cache with pymupdf.TOOLS.store_shrink(100) also avoids the problem.
How to reproduce the bug
BOZ1.pdf
BUL1.pdf
Just opening one file and generating a PixMap works correctly:
import pymupdf
bul = pymupdf.open("BUL1.pdf")
bul.load_page(0).get_pixmap().save("correct1.png")
bul.close()
Creating a PixMap of the other PDF first, breaks the PixMap of the second PDF (wrong colors and shapes)
import pymupdf
boz = pymupdf.open("BOZ1.pdf")
boz.load_page(0).get_pixmap()
boz.close()
bul = pymupdf.open("BUL1.pdf")
bul.load_page(0).get_pixmap().save("wrong.png")
bul.close()
Clearing the cache in between serves as a workaround:
import pymupdf
boz = pymupdf.open("BOZ1.pdf")
boz.load_page(0).get_pixmap()
boz.close()
pymupdf.TOOLS.store_shrink(100)
bul = pymupdf.open("BUL1.pdf")
bul.load_page(0).get_pixmap().save("correct2.png")
bul.close()
Fragment of the incorrect PixMap:

Corresponding fragment of the original PDF / correct PixMap:

PyMuPDF version
1.25.4
Operating system
Linux
Python version
3.11
Description of the bug
Cached data from a one PDF file can cause incorrect colors and shapes when generating a PixMap of a page of a different PDF file.
The issue does not appear when only one PDF file is opened, and explicitly clearing the cache with
pymupdf.TOOLS.store_shrink(100)also avoids the problem.How to reproduce the bug
BOZ1.pdf
BUL1.pdf
Just opening one file and generating a PixMap works correctly:
Creating a PixMap of the other PDF first, breaks the PixMap of the second PDF (wrong colors and shapes)
Clearing the cache in between serves as a workaround:
Fragment of the incorrect PixMap:
Corresponding fragment of the original PDF / correct PixMap:
PyMuPDF version
1.25.4
Operating system
Linux
Python version
3.11