How to set the JPEG quality when exporting a .dwg file to a raster image?

  1. FAQ
  2. »
  3. Raster Image Questions

You can control JPEG compression quality in the OdRxRasterServices::convertRasterImage() method:

const OdUInt32 flagsChain[3] = { OdRxRasterServices::kJpegQuality, 85, 0 };
if (pRasSvcs->convertRasterImage( pRaster, OdRxRasterServices::kJPEG, pStreamBuf, flagsChain))
{
...
}

Quality is set as a percentage:

  • < 20 : poor quality
  • 20 < 40 : average quality
  • 40 < 60 : normal quality
  • 60 < 80 : good quality (default)
  • >= 80 : best quality