Convert to Image with advanced options

GroupDocs.Conversion provides ImageConvertOptions to give you control over conversion result when convert to image.  Along with common convert options from base class ImageConvertOptions has the following additional options:

  • setFormat - desired result document type. Available options are: Tiff, Tif, Jpg, Jpeg, Png, Gig, Bmp, Ico, Psd, Wmf, Emf, Dcm, Webp, Dng, Svg, Jp2, Odg, J2c, J2k, Jpx, Jpf, Jpm, Eps, Cgm, Cdr, Cmx, Dib, Jpc, Jls, DjVu
  • setWidth - desired image width after conversion
  • setHeight - desired image height after conversion
  • setHorizontalResolution - desired image horizontal resolution after conversion
  • setVerticalResolution - desired image vertical resolution after conversion
  • setGrayscale - if true converted image will be grayscaled
  • setRotateAngle - image rotation angle
  • setFlipMode - image flip mode. Available options are: None, FlipX, FlipY, FlipXY
  • setBrightness - adjusts image brightness
  • setContrast - adjusts image contrast
  • setGamma - adjust image gamma
  • setJpegOptions - JPEG specific convert options
  • setTiffOptions - TIFF specific convert options
  • setPsdOptions - PSD specific convert options
  • setWebpOptions - WebP specific convert options
  • setUsePdf - in some cases, for better rendering and elements positioning the source document should be converted to PDF first. If this property is set to true, the input firstly is converted to PDF and after that to desired format.

Following code snippet shows how to convert to image with advanced options

String outputFileTemplate = "ConvertToImageWithAdvancedOptions-converted-page-%s.png"; 

try {
    FileOutputStream getPageStream = new FileOutputStream(String.format(outputFileTemplate, 1));

    Converter converter = new Converter("sample.pdf");
    ImageConvertOptions options = new ImageConvertOptions();

    converter.convert(getPageStream, options);
} catch (IOException e) {


JpegOptions is subset of ImageConvertOptions which allow enhanced control over conversions to JPEG format. 

The following options are available:

  • setQuality - desired image quality.
  • setColorMode - JPEG color mode. Available options are: Rgb, YCbCr, Cmyk, Ycck, Grayscale
  • setCompression - JPEG compression methods. Available options are: Baseline, Progressive, Lossless, JpegLs


TiffOptions is subset of  ImageConvertOptions which allow enhanced control over conversions to TIFF format. 

The following options are available:

  • setCompression - TIFF compression method. Available options are: None, Lzw, Ccitt3, Ccitt4, Rle


PsdOptions is subset of  ImageConvertOptions which allow enhanced control over conversions to PSD format. 

The following options are available:

  • setChannelBitsCount - bits count per channel
  • setChannelsCount - color channels count
  • setColorMode - PSD color mode. Available options are: Bitmap, Grayscale, Indexed, Rgb, Cmyk, Multichannel, Duotone, Lab
  • setCompression - PSD compression method. Available options are: Raw, Rle, ZipWithoutPrediction, ZipWithPrediction
  • setVersion - desired PSD version


WebpOptions is subset of  ImageConvertOptions which allow enhanced control over conversions to WebP format. 

The following options are available:

  • setLossless - the compression of the converted image will be lossless.
  • setQuality - set the quality of converted image