test: listing_tools.py and the Koldflux product background remover, Python 3.12.3, Pillow 10.1.0, numpy 1.26.4, 2026-11-27 published: python3 listing_tools.py check cutout.png command as run: python3 -I listing_tools.py check box-cut.png --prefix cl-main exit=0 edge: main: box cutout output: size: 1920 x 1440 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 54.7% output: solid (alpha 255): 31.5% output: soft (alpha 1-254): 13.7% = 379073 pixels output: saved cl-main-on-black.png and cl-main-on-white.png: open both at 100% zoom and look at the outline published: python3 listing_tools.py check cutout.png --box 1300,495,300,30 --prefix first command as run: python3 -I listing_tools.py check scissors-cut.png --box 1300,495,300,30 --prefix cl-box exit=0 edge: main: blade box on the scissors cutout output: size: 1920 x 1440 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 79.5% output: solid (alpha 255): 6.2% output: soft (alpha 1-254): 14.4% = 397098 pixels output: box 1300,495,300,30: 0.0% of its pixels have alpha 128 or more, 100.0% have any opacity output: saved cl-box-on-black.png and cl-box-on-white.png: open both at 100% zoom and look at the outline published: python3 listing_tools.py check cutout.png command as run: python3 -I listing_tools.py check no-such-file.png exit=2 edge: missing file output: error: file not found: no-such-file.png published: python3 listing_tools.py check cutout.png command as run: python3 -I listing_tools.py check empty.png exit=2 edge: empty file output: error: file is empty: empty.png published: python3 listing_tools.py check cutout.png command as run: python3 -I listing_tools.py check notes.png exit=2 edge: text file named .png output: error: not an image Pillow can read: notes.png published: python3 listing_tools.py check cutout.png command as run: python3 -I listing_tools.py check crlf.png exit=2 edge: file with Windows line breaks named .png output: error: not an image Pillow can read: crlf.png published: python3 listing_tools.py check cutout.png command as run: python3 -I listing_tools.py check box.jpg exit=2 edge: JPG without transparency output: error: no transparency in box.jpg (a JPG has none: use the PNG the tool gives you) published: python3 listing_tools.py check cutout.png command as run: python3 -I listing_tools.py check коробка-вырез.png --prefix cl-ru exit=0 edge: non-ASCII file name output: size: 1920 x 1440 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 54.7% output: solid (alpha 255): 31.5% output: soft (alpha 1-254): 13.7% = 379073 pixels output: saved cl-ru-on-black.png and cl-ru-on-white.png: open both at 100% zoom and look at the outline published: python3 listing_tools.py check cutout.png --box 1300,495,300,30 --prefix first command as run: python3 -I listing_tools.py check box-cut.png --box 1900,1400,400,400 exit=2 edge: box outside the picture output: error: --box leaves the picture (1920 x 1440 px) output: size: 1920 x 1440 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 54.7% output: solid (alpha 255): 31.5% output: soft (alpha 1-254): 13.7% = 379073 pixels published: python3 listing_tools.py check cutout.png --box 1300,495,300,30 --prefix first command as run: python3 -I listing_tools.py check box-cut.png --box a,b exit=2 edge: box that is not four numbers output: error: --box needs four whole numbers: X,Y,W,H output: size: 1920 x 1440 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 54.7% output: solid (alpha 255): 31.5% output: soft (alpha 1-254): 13.7% = 379073 pixels published: python3 listing_tools.py lift photo.jpg lifted.jpg command as run: python3 -I listing_tools.py lift scissors.jpg cl-lift.jpg exit=0 edge: main: brighten the scissors photo, gamma 0.45 output: saved cl-lift.jpg (gamma 0.45) published: python3 listing_tools.py lift photo.jpg lifted.jpg --gamma 0.45 command as run: python3 -I listing_tools.py lift scissors.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 listing_tools.py reapply original.jpg cutout_of_lifted.png result.png command as run: python3 -I listing_tools.py reapply scissors.jpg scissors-lift-cut.png cl-fixed.png exit=0 edge: main: mask of the lifted scissors cutout on the original pixels output: saved cl-fixed.png (original pixels, mask from scissors-lift-cut.png) published: python3 listing_tools.py check result.png --box 1300,495,300,30 --prefix fixed command as run: python3 -I listing_tools.py check cl-fixed.png --box 1300,495,300,30 --prefix cl-fixed-box exit=0 edge: main: blade box on the lift-fixed scissors file output: size: 1920 x 1440 output: corner alpha (top-left, top-right, bottom-left, bottom-right): 0 0 0 0 output: transparent (alpha 0): 73.1% output: solid (alpha 255): 2.5% output: soft (alpha 1-254): 24.4% = 675974 pixels output: box 1300,495,300,30: 71.3% of its pixels have alpha 128 or more, 100.0% have any opacity output: saved cl-fixed-box-on-black.png and cl-fixed-box-on-white.png: open both at 100% zoom and look at the outline published: python3 listing_tools.py reapply original.jpg cutout_of_lifted.png result.png command as run: python3 -I listing_tools.py reapply scissors.jpg bottle-cut.png cl-bad.png exit=2 edge: sizes differ (bottle cutout on the scissors photo) output: error: sizes differ: original 1920x1440, cutout 1920x2880 published: python3 listing_tools.py listing cutout.png out.png command as run: python3 -I listing_tools.py listing box-cut.png cl-box.png exit=0 edge: main: box on white, 1000 px, no shadow output: saved cl-box.png at 1000 x 1000, product 840 x 681 px, shadow none output: corner pixels (top-left, top-right, bottom-left, bottom-right): (255, 255, 255) (255, 255, 255) (255, 255, 255) (255, 255, 255) output: border pixels exactly 255,255,255: 4000 of 4000 (100.0%); lowest channel value on the border: 255 published: python3 listing_tools.py listing cutout.png out.jpg --size 2048 command as run: python3 -I listing_tools.py listing bottle-cut.png cl-bottle.jpg --size 2048 exit=0 edge: main: JPG at 2048 px output: saved cl-bottle.jpg at 2048 x 2048, product 835 x 1720 px, shadow none output: corner pixels (top-left, top-right, bottom-left, bottom-right): (255, 255, 255) (255, 255, 255) (255, 255, 255) (255, 255, 255) output: border pixels exactly 255,255,255: 8192 of 8192 (100.0%); lowest channel value on the border: 255 published: python3 listing_tools.py listing cutout.png out-drop.png --shadow drop command as run: python3 -I listing_tools.py listing scissors-cut.png cl-drop.png --shadow drop exit=0 edge: drop shadow output: saved cl-drop.png at 1000 x 1000, product 840 x 343 px, shadow drop output: corner pixels (top-left, top-right, bottom-left, bottom-right): (255, 255, 255) (255, 255, 255) (255, 255, 255) (255, 255, 255) output: border pixels exactly 255,255,255: 4000 of 4000 (100.0%); lowest channel value on the border: 255 published: python3 listing_tools.py listing cutout.png out-floor.png --shadow floor command as run: python3 -I listing_tools.py listing bottle-cut.png cl-floor.png --shadow floor exit=0 edge: floor shadow output: saved cl-floor.png at 1000 x 1000, product 378 x 780 px, shadow floor output: corner pixels (top-left, top-right, bottom-left, bottom-right): (255, 255, 255) (255, 255, 255) (255, 255, 255) (255, 255, 255) output: border pixels exactly 255,255,255: 4000 of 4000 (100.0%); lowest channel value on the border: 255 published: python3 listing_tools.py listing cutout.png out.png command as run: python3 -I listing_tools.py listing cl-blank.png cl-out.png exit=2 edge: fully transparent picture output: error: the cutout has no visible pixels published: python3 listing_tools.py listing cutout.png out.png --size 50 command as run: python3 -I listing_tools.py listing box-cut.png cl-bad.png --size 50 exit=2 edge: size too small output: error: --size must be between 100 and 5000 pixels published: python3 listing_tools.py listing cutout.png out.png --margin 60 command as run: python3 -I listing_tools.py listing box-cut.png cl-bad.png --margin 60 exit=2 edge: margin too large output: error: --margin must be between 0 and 40 (percent of the side) published: python3 listing_tools.py listing cutout.png out.png command as run: python3 -I listing_tools.py listing box-cut.png cl-bad.gif exit=2 edge: output ends in .gif output: error: the output name must end in .png or .jpg or .jpeg: cl-bad.gif published: python3 listing_tools.py listing cutout.png out.png command as run: python3 -I listing_tools.py listing box-cut.png nodir/t.png exit=2 edge: output folder does not exist output: error: folder does not exist: nodir published: python3 listing_tools.py listing cutout.png out.png command as run: python3 -I listing_tools.py listing keep-cut.png keep-cut.png exit=2 edge: output name equal to the input (refused, the file is untouched) output: error: the output is the same file as the input (keep-cut.png): use a new name check: keep-cut.png byte-identical to the original after the refused command published: python3 listing_tools.py corners image.jpg command as run: python3 -I listing_tools.py corners box-cut.jpg exit=0 edge: main: the tool's own JPG on white output: corner pixels (top-left, top-right, bottom-left, bottom-right): (255, 255, 255) (255, 255, 255) (255, 255, 255) (255, 255, 255) output: border pixels exactly 255,255,255: 6720 of 6720 (100.0%); lowest channel value on the border: 255 published: python3 listing_tools.py corners image.jpg command as run: python3 -I listing_tools.py corners box.jpg exit=0 edge: main: untouched phone photo (not white, as expected) output: corner pixels (top-left, top-right, bottom-left, bottom-right): (197, 177, 178) (247, 238, 239) (233, 221, 221) (249, 245, 244) output: border pixels exactly 255,255,255: 0 of 6720 (0.0%); lowest channel value on the border: 156 published: python3 listing_tools.py corners image.jpg command as run: python3 -I listing_tools.py corners no-such.jpg exit=2 edge: missing file output: error: file not found: no-such.jpg published: python3 listing_tools.py corners image.jpg command as run: python3 -I listing_tools.py corners empty.png exit=2 edge: empty file output: error: file is empty: empty.png published: python3 listing_tools.py lift photo.jpg lifted.jpg command as run: python3 -I listing_tools.py lift cl-rot.jpg cl-rot-lift.jpg exit=0 edge: phone photo, 300x100 pixels with rotation tag 6 (shown 100x300): is the output upright output: saved cl-rot-lift.jpg (gamma 0.45) check: size of cl-rot-lift.jpg: (100, 300) None (size, rotation tag; upright 100x300 expected, no tag) published: python3 listing_tools.py corners image.jpg command as run: python3 -I listing_tools.py corners cl-rot.jpg exit=0 edge: rotated phone photo (reads upright, corners of the red picture) output: corner pixels (top-left, top-right, bottom-left, bottom-right): (200, 50, 51) (200, 50, 51) (200, 50, 51) (200, 50, 51) output: border pixels exactly 255,255,255: 0 of 800 (0.0%); lowest channel value on the border: 50