Thanks.
Yes it's a full process on my own.
By the may i think anyone how realy master imagemagik can probably do the same with less steps and without potrace, i just use many steps because it was easyer for me to understand and debug ^^, so no mastering but some try and die and RTFM of imagemagik ^^.
To avoid black pixels masking issues i merge potrace with a 400% un-interpoled mask, If ff8 don't need this you can try out without de 400% mask merged and the result will be even better.
To my mind, sharing skills is the most important part of the life, is anyone can share is skill freely, the workd will be realy better than it is now ....
Honestly, it's been so long since I used imagemagick, that I had to look up reference notes just to get a basic idea of what was happening and my first few attempts left me shaking my head trying to figure out what I was doing wrong. I still need to go over the script I made to fine tune it as well, I would love if you went over it if you're still familiar enough with imagemagick, you might notice some things I could easily alter.
I altered it a bit since our 'goals' were clearly different I think. I simply just wanted to produce a mask image, while I believe your original script actually merged it with the background in the end. So there's a few things I'd like to change. I'll figure it out on my own if it's been a while or it's too much of a hassle, but like I said, if simply taking a peek at what I've done you can easily notice some stuff, you could save me a headache or two ;-P
@echo off
set infile=%1
set blackImage=%2
set workArea=workArea
set bwavector=%workArea%\bwavector.bmp
set eps=%workArea%\bwavector.eps
set vector4x=%workArea%\vector4x.bmp
set vector4xblack=%workArea%\vector4xblack.png
set raw4x=%workArea%\raw4x.png
set raw4xcoupe=%workArea%\raw4xcoupe.png
set raw4xmix=%workArea%\raw4xmix.png
set raw4xbackmix=%workArea%\raw4xbackmix.png
set fullblack=%workArea%\fullblack.png
set calquedecoupe=%workArea%\calquedecoupe.png
set box25p=%workArea%\box25p.png
set x4novi=%workArea%\x4novi.png
set combi=%workArea%\combi.png
set mask=mask.png
cmd.exe /c start /B /wait /low " " convert -fill black -colorize 100%% -flatten %infile% %bwavector%
cmd.exe /c start /B /wait /low " " potrace --turdsize 0 %bwavector% -o %eps%
cmd.exe /c start /B /wait /low " " convert -density 288 -background #FF00FF -channel alpha -threshold 70%% -alpha remove -flatten %eps% %vector4x%
cmd.exe /c start /B /wait /low " " convert +transparent #000000 %vector4x% %vector4xblack%
cmd.exe /c start /B /wait /low " " convert -scale 400%% -background #FF00FF -alpha remove -alpha off -fill black +opaque #FF00FF %infile% %raw4x%
cmd.exe /c start /B /wait /low " " convert +transparent #FF00FF %raw4x% %raw4xcoupe%
cmd.exe /c start /B /wait /low " " composite -gravity center %raw4xcoupe% %blackImage% %raw4xmix%
cmd.exe /c start /B /wait /low " " convert -alpha remove -alpha off +transparent black %raw4xmix% %raw4xbackmix%
cmd.exe /c start /B /wait /low " " composite -gravity center %raw4xbackmix% %vector4xblack% %fullblack%
cmd.exe /c start /B /wait /low " " convert -background #FF00FF -alpha remove -alpha off -transparent #000000 %fullblack% %calquedecoupe%
cmd.exe /c start /B /wait /low " " convert -define png:format=png32 -fuzz 01%% -fill #FE00FE -opaque #FF00FF %blackImage% %x4novi%
rem cmd.exe /c start /B /wait /low " " composite -gravity center %calquedecoupe% %x4novi% %combi%
rem cmd.exe /c start /B /wait /low " " convert -define png:format=png32 %combi% -transparent #FF00FF %mask%
cmd.exe /c start /B /wait /low " " composite -gravity center %calquedecoupe% %x4novi% -negate %mask%
The two arguments I send it are the original file I'm masking and a black image the same size of that image, due to what I did to change it, I'm guessing there are steps here I can completely skip, since I'm only after the mask, which I'll then use in my own python script. I know it's still a bit messy, it produced what I wanted and haven't worked on it since, but I'm guessing there are things I could do/steps to take out that would speed it up. I tried to make sense of what you were doing, but tbh, I'm completely lost. I have no idea how this works.
Either way, good job, it's not perfect, but it's definitely better than what I was using, and the best part is that I can apply it to all the images.
I also completely agree with you about sharing info for sure. I haven't shared much about what I've done so far simply because it's still all kind of a mess, but when I'm done I'm sure I'll also post my python code and whatever else my process was so that others can use it if it's at all helpful, hell maybe it will just help someone with something completely unrelated, or in a couple of years a new filter will come out and someone will want to rebuild the screens again and for all I know what I've done/documented might help them along, which is great. And maybe no one would even care either, which is fine. haha
I do this for me more than anything, because I enjoy it, even I fail in the end or the results aren't as good as someone else's. I'll learn stuff along the way, with this project, I'm mostly learning about using python with GIMP, which tbh, has been a really good learning experience, especially since I had never even used python before this.