test: cutout_tools.py and the Koldflux person background remover, Python 3.10.18, Pillow 10.1.0, numpy 1.25.2, 2026-11-27 published: python3 cutout_tools.py check cutout.png command as run: python3 -I cutout_tools.py check shot-wall-cut.png --prefix cl-main exit=0 edge: main: cutout of the wall photo output: size: 1600 x 1066 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 45.4% output: solid (alpha 255): 38.2% output: soft (alpha 1-254): 16.4% = 280212 pixels output: saved cl-main-on-black.png and cl-main-on-white.png: open both at 100% zoom and look at hair and shoulders published: python3 cutout_tools.py check cutout.png --box 300,0,500,420 command as run: python3 -I cutout_tools.py check shot-street-cut.png --box 300,0,500,420 --prefix cl-box exit=0 edge: main: box on the street cutout output: size: 1600 x 1062 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 1 0 output: transparent (alpha 0): 61.0% output: solid (alpha 255): 21.0% output: soft (alpha 1-254): 17.9% = 304373 pixels output: box 300,0,500,420: 4.4% of its pixels have alpha 128 or more output: saved cl-box-on-black.png and cl-box-on-white.png: open both at 100% zoom and look at hair and shoulders published: python3 cutout_tools.py check cutout.png command as run: python3 -I cutout_tools.py check no-such-file.png exit=2 edge: missing file output: error: file not found: no-such-file.png published: python3 cutout_tools.py check cutout.png command as run: python3 -I cutout_tools.py check empty.png exit=2 edge: empty file output: error: file is empty: empty.png published: python3 cutout_tools.py check cutout.png command as run: python3 -I cutout_tools.py check notes.png exit=2 edge: text file named .png output: error: not an image Pillow can read: notes.png published: python3 cutout_tools.py check cutout.png command as run: python3 -I cutout_tools.py check shot-wall.jpg exit=2 edge: JPG without transparency output: error: no transparency in shot-wall.jpg (a JPG has none: use the PNG the tool gives you) published: python3 cutout_tools.py check cutout.png command as run: python3 -I cutout_tools.py check портрет-вырез.png --prefix cl-ru exit=0 edge: non-ASCII file name output: size: 1600 x 1066 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 45.4% output: solid (alpha 255): 38.2% output: soft (alpha 1-254): 16.4% = 280212 pixels output: saved cl-ru-on-black.png and cl-ru-on-white.png: open both at 100% zoom and look at hair and shoulders published: python3 cutout_tools.py check cutout.png --box 1500,900,400,400 command as run: python3 -I cutout_tools.py check shot-wall-cut.png --box 1500,900,400,400 exit=2 edge: box outside the picture output: error: --box leaves the picture (1600 x 1066 px) output: size: 1600 x 1066 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 45.4% output: solid (alpha 255): 38.2% output: soft (alpha 1-254): 16.4% = 280212 pixels published: python3 cutout_tools.py lift photo.jpg photo-lift.jpg command as run: python3 -I cutout_tools.py lift shot-street.jpg cl-lift.jpg exit=0 edge: main: brighten the street photo, gamma 0.45 output: saved cl-lift.jpg (gamma 0.45) published: python3 cutout_tools.py lift photo.jpg photo-lift.jpg --gamma 0 command as run: python3 -I cutout_tools.py lift shot-street.jpg cl-bad.jpg --gamma 0 exit=2 edge: bad gamma (0) output: error: --gamma must be above 0 and at most 1 (below 1 brightens) published: python3 cutout_tools.py reapply photo.jpg photo-lift-cut.png photo-fixed.png command as run: python3 -I cutout_tools.py reapply shot-street.jpg shot-street-lift-cut.png cl-fixed.png exit=0 edge: main: street mask on the original pixels output: saved cl-fixed.png (original pixels, mask from shot-street-lift-cut.png) published: python3 cutout_tools.py check photo-fixed.png --box 300,0,500,420 command as run: python3 -I cutout_tools.py check shot-street-fixed.png --box 300,0,500,420 --prefix cl-fx exit=0 edge: main: hair box on the fixed street file output: size: 1600 x 1062 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 1 0 0 0 output: transparent (alpha 0): 38.9% output: solid (alpha 255): 17.3% output: soft (alpha 1-254): 43.8% = 744674 pixels output: box 300,0,500,420: 74.0% of its pixels have alpha 128 or more output: saved cl-fx-on-black.png and cl-fx-on-white.png: open both at 100% zoom and look at hair and shoulders published: python3 cutout_tools.py reapply photo.jpg photo-lift-cut.png photo-fixed.png command as run: python3 -I cutout_tools.py reapply shot-street.jpg shot-wall-cut.png cl-bad.png exit=2 edge: sizes differ (wall mask on the street photo) output: error: sizes differ: original 1600x1062, cutout 1600x1066 published: python3 cutout_tools.py thumb cutout.png thumb.png command as run: python3 -I cutout_tools.py thumb shot-wall-cut.png cl-thumb.png exit=0 edge: main: 1280x720 frame output: saved cl-thumb.png at 1280x720 published: python3 cutout_tools.py thumb cutout.png thumb.png --size 3840x2160 command as run: python3 -I cutout_tools.py thumb shot-wall-cut.png cl-thumb4k.png --size 3840x2160 exit=0 edge: 3840x2160 frame output: saved cl-thumb4k.png at 3840x2160 published: python3 cutout_tools.py thumb cutout.png thumb.png --size 3840x2160 command as run: python3 -I cutout_tools.py thumb shot-wall-cut.png cl-bad.png --size big exit=2 edge: bad size output: error: --size looks like 1280x720 and --color like 1F3A93 published: python3 cutout_tools.py reapply photo.jpg photo-lift-cut.png photo-fixed.png command as run: python3 -I cutout_tools.py reapply keep.jpg keep-cut.png keep.jpg exit=2 edge: output name equal to the input photo (refused, the photo is untouched) output: error: the output is the same file as the input (keep.jpg): use a new name check: keep.jpg byte-identical to the original after the refused command published: python3 cutout_tools.py lift photo.jpg photo-lift.jpg command as run: python3 -I cutout_tools.py lift keep.jpg keep.jpg exit=2 edge: output name equal to the input photo (refused) output: error: the output is the same file as the input (keep.jpg): use a new name published: python3 cutout_tools.py reapply photo.jpg photo-lift-cut.png photo-fixed.png command as run: python3 -I cutout_tools.py reapply keep.jpg keep-cut.png cl-out.jpg exit=2 edge: output ends in .jpg (reapply needs .png) output: error: the output name must end in .png: cl-out.jpg published: python3 cutout_tools.py lift photo.jpg photo-lift.jpg command as run: python3 -I cutout_tools.py lift keep.jpg cl-out.xyz exit=2 edge: output ends in .xyz output: error: the output name must end in .jpg or .jpeg or .png: cl-out.xyz published: python3 cutout_tools.py thumb cutout.png thumb.png command as run: python3 -I cutout_tools.py thumb shot-wall-cut.png nodir/t.png exit=2 edge: output folder does not exist output: error: folder does not exist: nodir published: python3 cutout_tools.py check cutout.png command as run: python3 -I cutout_tools.py check shot-wall-cut.png --prefix nodir/x exit=2 edge: --prefix in a folder that does not exist output: error: folder does not exist: nodir published: python3 cutout_tools.py thumb cutout.png thumb.png --size 3840x2160 command as run: python3 -I cutout_tools.py thumb shot-wall-cut.png cl-bad.png --size 99999x99999 exit=2 edge: size above 8192 on a side output: error: --size is limited to 8192 pixels on each side published: python3 cutout_tools.py lift photo.jpg photo-lift.jpg command as run: python3 -I cutout_tools.py lift cl-rot.jpg cl-rot-lift.jpg exit=0 edge: phone photo, 300x100 pixels with rotation tag 6 (shown 100x300) output: saved cl-rot-lift.jpg (gamma 0.45) check: size of cl-rot-lift.jpg and its rotation tag: (100, 300) None published: python3 cutout_tools.py check cutout.png command as run: python3 -I cutout_tools.py check cl-pal.png --prefix cl-pal exit=0 edge: palette PNG with transparency (read as RGBA) output: size: 10 x 10 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 100.0% output: solid (alpha 255): 0.0% output: soft (alpha 1-254): 0.0% = 0 pixels output: saved cl-pal-on-black.png and cl-pal-on-white.png: open both at 100% zoom and look at hair and shoulders