[cairo] Size of PDF with lots of images

Simon Sapin simon.sapin at exyr.org
Thu Jan 16 12:15:28 PST 2014


On 16/01/2014 19:57, Adrian Johnson wrote:
>> If your images were in a format that the PDF backend supports [2] (which
>> includes JPEG but not PNG), you could use cairo_surface_set_mime_data()
>> to have cairo store the original image data (almost) as-is in PDF,
>> without re-compressing. Although I expect that lossy JPEG may not look
>> nice for these specific images.
> Yes, jpeg images are the most likely reason for the increase in size.
>
> I'm not sure what you mean by "lossy JPEG may not look
> nice for these specific images". The jpeg data is stored exactly as
> provided to cairo_surface_set_mime_data() so there will be no loss of
> image quality.

Behdad’s images are PNG here, not JPEG. They are computer-generated with 
sharp edges, the kind where JPEG does not do well.

-- 
Simon Sapin


More information about the cairo mailing list