Skip to content

takes a batch of transparent PNG images, finds the dominant color and adds the inverse of that color as a background. saves images as JPGs

Notifications You must be signed in to change notification settings

jp00p/add-contrasting-bg-color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

add-contrasting-bg-color

takes a batch of transparent PNG images, upscales them to 512x512 using nearest neighbor, and adds a random background color

I use this script for preparing images for training in stable diffusion

instructions

  • put your images in input_images
  • run the script by typing python main.py in your terminal, or however you prefer
  • enjoy the new images in output_images
Example input Example output
example input example output

About

takes a batch of transparent PNG images, finds the dominant color and adds the inverse of that color as a background. saves images as JPGs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages