Reducing CairoMakie PDF file sizes with PNG integration

The CairoMakie heatmap is very useful and I use it on a daily basis. However, the file size can be large when output to a pdf file (usually more than a few MB for my usage). By saving the layout, axes, annotations, etc. as a pdf and saving only the heatmap panels in png format and merging them later, the file size can be made small (e.g. under 1 MB). This is a band-aid for those who are not makie or pdf experts. If there is a better way, I would like to know.

1 Like

there is a rasterize keyword that should rasterize a given plot object in CairoMakie

1 Like

This is exactly what I wanted. I was not aware that it was already available. I am glad I asked. Thank you very much.