Bug 53413

Summary: add an API to configure settings for the generated PNG
Product: cairo Reporter: Christoph Anton Mitterer <calestyo>
Component: png functionsAssignee: Carl Worth <cworth>
Status: RESOLVED WONTFIX QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: enhancement    
Priority: medium    
Version: 1.12.2   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Christoph Anton Mitterer 2012-08-12 15:43:44 UTC
Hi.

It was discussed[0] that it's quite a pity for many applications that cairo doesn't allow setting any options for the generated PNG.

Please add an API, which allows that, including e.g.:
- compression level
- progressive PNP or not
- comments
- gamma, background, color
- etc. pp. (see what libpng or GIMP offers)


Cheers,
Chris.

[0] https://lists.oetiker.ch/pipermail/rrd-users/2012-August/018803.html
Comment 1 Uli Schlachter 2012-08-12 15:51:07 UTC
If you want more control over the generated PNG, use libpng directly. The reason can be found in the documentation:

  The PNG functions allow reading PNG images into image surfaces, and writing any surface to a PNG file.

  It is a toy API. It only offers very simple support for reading and writing PNG files, which is sufficient for testing and demonstration purposes. Applications which need more control over the generated PNG file should access the pixel data directly, using cairo_image_surface_get_data() or a backend-specific access function, and process it with another library, e.g. gdk-pixbuf or libpng.

Cairo doesn't try to be a general purpose image loading/saving library and thus the API you propose doesn't fit into cairo.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.