| // Replace transparency in an image with a solid color using Magick++ |
| // Useful to see how a transparent image looks on a particular |
| // background color, or to create a similar looking effect without |
| // Copyright Bob Friesenhahn, 2000 |
| // Usage: detrans color file... |
| int main(int argc,char **argv) |
| cout << "Usage: " << argv[0] << " background_color file..." << endl; |
| // Initialize ImageMagick install location for Windows |
| catch ( Exception &error_ ) |
| cout << error_.what() << endl; |
| Image base( overlay.size(), color ); |
| base.composite( overlay, 0, 0, OverCompositeOp ); |
| catch( Exception &error_ ) |
| cout << error_.what() << endl; |