2
我使用Magick ++(IM 7.0.3平臺:CentOS Linux版本7.0)將圖像轉換爲gif。我從文件創建圖像對象,問題是當我將9個png文件(每個50kb)轉換爲gif時,它只能使用50ms。但是當它變成9個JPG文件(每個20kb)時,它需要1900毫秒。背後的原因是什麼?我怎樣才能讓它更快的JPG文件?ImageMagick將jpg圖像轉換爲gif慢
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);
感謝您的幫助。我沒有這個「識別」IM命令,但使用php GD Library imagecolorstotal函數,我得到了我的jpg顏色數字0和png顏色數字256.這是否意味着png文件是palettised? –
對不起,但我有另一個問題:我試圖構造一個PNG格式的Magick :: Image obj,但未能用blob初始化圖像(blob是由cv :: imencode創建的png數據構建的);但初始化與cv :: imencode jpg blob工作正常。我是圖像處理新手,在這裏遇到困難。 –
如果您有v7或更新版本,請嘗試'magick識別...'。 –