extract the last panel of comics (especially these) programmatically
- install Python 3.6 or greater, probably
- also install Python 2.7 if you need tumblr-utils to work, like with
go.sh
. sorry :/
- also install Python 2.7 if you need tumblr-utils to work, like with
- install OpenCV from somewhere (this is why I didn't bother packaging this properly)
- clone this repo
- with
git clone --recurse-submodules
if you wantgo.sh
to work
- with
- run
./go.sh
on a cron to get an automatically updated feed full of sweet reaction images - run
./ohnoify.py input.png -o /tmp
to extract just one panel and send it to a temporary dir - run
./ohnoify.py input.png -o /tmp --debug
to interactively debug issues (or show off the sweet magic to your friends, up to you)
it does some pretty typical stuff to clean up the image before finding the rectangular contours. then it finds the contour closest to the bottom right, masks out the image with it, and crops the image to the size of the axis-aligned bounding box of the contour.
- don't panic
- make sure you followed all of the install instructions above
- try running it with the
--debug
flag against your image - try to fix the bug, if you can
- file an issue with the whole debug log, all package and Python and OS versions, and all images involved