title: How to reduce image data size without changing its resolution?
body: <p>I have tried couple of ways to reduce image size, but all failed. All similar to this:</p>
  
  <pre><code>    //Mat frame...
      vector&lt;uchar&gt; buff;
      vector&lt;int&gt; params;
      params.push_back(cv::IMWRITE_JPEG_QUALITY);
      params.push_back(50); //Tried any value here, didn't change much
  
      cv::imencode(".jpg", frame, buff, params);
      Mat a = cv::imdecode(buff,1);
      // a size is bigger than frame's
  </code></pre>
  
  <p>How can one reduce an image (Mat object) size without changing its resolution?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I'm taking frames from camera and making video of them. Saving the frames as is makes a 1 minute video to weight about 100mb, which is totally unacceptable. How can I reduce the size (number of bytes) of each frame?</p>