The challenge right now is can I separate out foregrounds and backgrounds. In a non-flattened PDF? Easy. In a flattened PDF, or a JPG, or PNG, that's the challenge. I'm considering things like distance from border, clusters of colors. I'd like to say I'm getting somewhere three revisions in, but really I can't say I'm getting anything but "okay" results. I'm sure there's a library that does this all automatically for me. #python #programming #coding
After five revisions I'd say I'm at somewhere between 72 to 87 percent depending on the image. Maybe I'm approaching it wrong - maybe I should be separating out *everything*- foreground, background, also every little whatever, section etc.
I'm now ten revisions in and I think it's as good as it's going to get. However I need to cut some of this code out and fix the ugly hacks.
Going from 2,300 lines of code down to who knows, but a lot of this is junk, methods rewritten twelve times commented out 11 times, bits from libraries I am not going to use, so that's really not an accomplishment. Anyone who judges programming progress or competence as "number of lines written" is a fool. And you know who I am talking about.
My first thought was hey I can split this into three different files, that way the "main" (entry point) is like 75 lines, but really that's not actually helping the problem of bloat, I have to fully redo this.
I actually have no idea if it's good practice to make a main just a wrapper around other stuff?