<div dir="ltr">A few quick experiments suggest that Racket/Cairo can/does embed a png representation within the pdf, but saves a bitmap with jpeg representation by expanding out to a more naive format. E.g.<div><ul><li>Racket -> png: 2738 bytes<br></li><li>Racket -> pdf: 2995 bytes<br></li><li>png -> ImageMagick -> jpeg: 2024 bytes<br></li><li>jpeg -> Racket -> pdf: 8854 bytes!! ;-(</li></ul></div><div>* * *</div><div><br></div><div>A bit of Googling gives some confirmation (and hope):</div><div><br></div><div>From 2007 (<a href="http://lists.freedesktop.org/archives/cairo/2007-January/009096.html">http://lists.freedesktop.org/archives/cairo/2007-January/009096.html</a>):</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">So, there's this bug against eog (GNOME image viewer) [1] about images printed to PDF are huge. The reason of course is that cairo embeds images as PNG. We need to find a solution to this.</blockquote><div><br></div>The October 2014 release  of Cairo 1.14.0 describes the following feature:<div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Support JBIG2 mime data in PDF. This allows embedding of more compressed JPEG formats within PDF, rather than including the full uncompressed image. See: <a href="http://cairographics.org/news/cairo-1.14.0/">http://cairographics.org/news/cairo-1.14.0/</a></blockquote><div><br></div><div>* * *</div><div><br></div><div>I can't find anything in the online docs about the Cairo API that explicitly reference JPEG or JBIG2.</div></div><div><br></div><div>Is anyone running Cairo 1.14.0 (or later), and does it "just work" in this scenario?</div><div><br></div><div><br></div><div>Dan</div><div class="gmail_extra"><div class="gmail_signature"><div dir="ltr"></div></div>
</div></div>