code: public static byte[] generateImageofMonomer(Monomer monomer, boolean rgroupsInformation) throws BuilderMoleculeException, CTKException, ChemistryException {
      LOG.info("Image generation process of monomer starts");
      /* First build one molecule */
      AbstractMolecule molecule;
      if (rgroupsInformation) {
        molecule = BuilderMolecule.getMoleculeForMonomer(monomer);
        LOG.info("Molecule was built");
      } else {
        molecule = BuilderMolecule.mergeRgroups(BuilderMolecule.getMoleculeForMonomer(monomer));
        LOG.info("Molecule was built and unused rgroups were merged into it");
      }
      String molFile;
      molFile = Chemistry.getInstance().getManipulator().convertMolecule(molecule, AbstractChemistryManipulator.StType.MOLFILE);
      LOG.info("Generate molfile for the built molecule");
      return Chemistry.getInstance().getManipulator().renderMol(molFile, OutputType.PNG, PICTURE_WIDTH, PICTURE_HEIGHT, (int) Long.parseLong("D3D3D3", 16));
    }
docs: generates an image of the atom/bond representation of monomer
  
  @param monomer Input Monomer
  @param rgroupsInformation information if the rgroups should be should or
  not
  @return an image of the monomer in byte[]
  @throws CTKException general ChemToolKit exception passed to HELMToolKit
  @throws BuilderMoleculeException if the molecule can't be built
  @throws ChemistryException if the Chemistry Engine can not be initialized