ImageMagick convert jpg images to gif being slow?
Posted: 2017-05-09T22:25:03-07:00
I am using Magick++(IM 7.0.3, platform:CentOS Linux release 7.0) to convert images to gif. I read images from files, the problem is that when I convert 9 png files(each 50kb) to gif, it taks only 50ms. but when it turns to 9 jpg files (each 20kb), it takes 1900ms. What is the reason behind? How can I make it faster with jpg files?
Code: Select all
for(int i = 2; i < argc-1; i++)
{
// I pass the file path from command line
cout << argv[i] << endl;
Image img(argv[i]);
img.animationDelay(delay);
img.magick("GIF");
frames.push_back(img);
}
long mergestart = getCurrentTime();
Magick::Blob tmpBlob;
Magick::writeImages(frames.begin(), frames.end(), &tmpBlob);