This is the code for my app:
Code: Select all
#include <iostream>
#include "Magick++.h"
using namespace std;
using namespace Magick;
int main(int argc, char** argv) {
if (argc < 2) {
cout << "Usage: JPGCrusher <imagename.jpg>" << endl;
return 1;
}
Image image;
image.read(argv[1]);
image.compressType (JPEGCompression);
image.quality(75);
image.write(argv[1]);
return 0;
}