This is a Next.js project bootstrapped with create-next-app
.
use node 18
npm i
npm run dev
Open http://localhost:3002 with your browser to see the result.
There are a number of buttons on the page:
before trying any of these, you'll need to place any folders/files into public/unprocessed
like below:
skuReport
& find failed JPG files
will create a log file in the public/processed
folder:
This script will generate a json log with a breakdown of unique SKU folders, SKu folder with sub-folders, and folders that are oddly named, like the following:
I Highly recommend using VS Code so you can format the generated json log files, otherwise they are impossible to read..
bulk remove BG
button requires a .env file in the project root
API_KEY=yourPhotoRoomAPIKey
Make sure your files/folders are in the public/unprocessed
folder. The script will remove backgrounds from [jpg, JPG, jpeg, JPEG, png, PNG], save the new files with _pc
appended to the file name, and DELETE the original file.
A Log file will also be generated and placed in the processed folder. In the Log file you can search for "error" to see if any files failed.. You could also simply run the find failed
script below to generate a log that JUST finds the failed items.
WARNING: only run this after running
copy failed JPG files
. Those copied files will b in thepublic/processed
folder. Then move anything OUT of theunprocessed
folder and move the newly copied files intounprocessed
, THEN you can run the script.
sometimes this works for JPG files that have failed in Photoroom. THis script will convert any JPG files to PNG files with Imagemagick.