And I want to batch process them so the white becomes one colour, and the black another.
There’s a good batch tool, BIMP, which I have used. There’s a good colorify plugin, which I have used to get
by batch colorify of white, which works great.
But the only way to batch colour black that I found is inverting the original image and colorifying white again to get this:
But I need to be able to batch colorify black, or batch merge only the non-black portions of these two coloured images somehow, and I’m not sure how to do that.
That’s not bad. Could do with more fuzziness, maybe? Something to clean up the midrange tones between black and white. I’ve never used imagemagick, I assume it handles batch processing. Also needs to preserve the transparency of the background.
It does batch processing in that it’s designed to be used in a windows .bat batch file or a linux/UNIX .sh shell script, among other things; following the Unix philosophy of “each command should do one thing and do it well”
In this case, convert fails, because it’s a veritable powerhouse of image manipulation.
Regarding midrange, I don’t see any midrange in your source imagine posted above; it looks completely bi-tonal to my eye.
I’ll check on the transparency bit; I’m sure that’s just a bit of command parameters I’m missing
Yes, it looks completely bitonal, but that’s due to antialiasing. In the colored output you provided, you can see a lot of greys between the two colours that haven’t been converted.
If I had svg source, this wouldn’t be an issue, but I only have PNG files to work from.
Well, the antialiasing is already present in the source, I don’t think you are adding or removing any with the conversion. It’s just how a non-pixellated source image is made to look smoother when converted to a bitmap/pixel format.
Sadge. If you can find a solution, great. Maybe something like I was originally trying to do, where you do it in two passes, or maybe the fuzziness setting has to come down for those two. If not, I’ll gladly take what you have done so far.
Step 1: create version of each portrait with only black or white pixels (remove AA)
Step 2: Set “background” color (replace white with the background of the bi-tonal palette)
Step 3: Set “foreground” color (replace black with the foreground of the bi-tonal palette)
I’m not entirely sure that removing the antialiasing effect is the right way to go here. I mean, it’s there in the first place so the image doesn’t look jagged. Ideally the colour conversion would make black the darker colour, white the lighter colour, and the in-between greys into whatever looks like a decent match for in-between the two colours.
Or, I suppose, there’s probably a way to add antialiasing after the colour conversion. The only problem there is that you’d be doing so from a considerably more lossy image than the one you started with (whatever was used to generate the original antialiased image).
I guess you get to be the judge I did both (once I figured out why my grey and pink were not coming out correctly (spoiler: I populated the same color code for foreground as background… the process was working as-instructed))