code: def resize_and_convert(img, size, quality=100):
      img = img.resize(size)
      buffer = BytesIO()
      img.save(buffer, format="jpeg", quality=quality)
      val = buffer.getvalue()
  
      return val
  
file_path: gluon-cv/scripts/gan/stylegan/prepare_data.py
imports: import argparse
  from io import BytesIO
  import multiprocessing
  from functools import partial
  from PIL import Image
  import lmdb
  from tqdm import tqdm
  from mxnet.gluon.data.vision.datasets import ImageFolderDataset
label_desc: Use image node_id 1 for calling a global function with example usage: resize_and_convert(img, size, quality) and returns: val