@SatyamGaba  I find albumentations faster and easier for such tasks

  
      
      GitHub
  
  
    

albumentations-team/albumentations 60

Fast image augmentation library and easy to use wrapper around other libraries. Documentation:  https://albumentations.ai/docs/ - albumentations-team/albumentations