Skip to content

Instantly share code, notes, and snippets.

@usagi
Created February 3, 2014 16:11
Show Gist options
  • Select an option

  • Save usagi/8786832 to your computer and use it in GitHub Desktop.

Select an option

Save usagi/8786832 to your computer and use it in GitHub Desktop.
cv::Mat m(480, 640, CV_8UC3);
Magick::Image i(m.cols, m.rows, "BGR", Magick::CharPixel, reinterpret_cast<char*>(m.data));
constexpr int jpeg_quality = 60;
Magick::Blob buffer;
i.magick("JPEG");
i.quality(jpeg_quality);
i.write(&buffer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment