writing files with Magick++

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
stephanecharette
Posts: 4
Joined: 2016-07-28T09:19:24-07:00
Authentication code: 1151

writing files with Magick++

Post by stephanecharette »

When writing files with Magick::Image::write(), how are options set? For example, if I have the following:

Code: Select all

Magick::Image img;
// do something here to populate img
img.write( "test.jpg" );
Is there a way to specify the quality of the JPG file? Or if it should be progressive? Or a comment to store in the JPG?

What if the write was to "test.png": Is there a way to specify the compression level? Adam7 interlacing? Timestamp? Comment?

I'm assuming that write() gets the file format to use from the filename, because I don't see a parameter in write() to indicate the file format to use. But obviously I'm missing part of the API because I'm certain there must be a way to specify parameters to use when saving images.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: writing files with Magick++

Post by snibgo »

snibgo's IM pages: im.snibgo.com
Post Reply