I don't need to worry about mixing, because I placed the red dot on the place where there are no colors around. And I need to have transparent dot.
That is not true if you resize first. The red pixel is surrounded by white pixels with transparency. If you resize, the red will mix with the white and the transparency of the white will mix with the opacity of the red pixel.
I do not use Windows, so you will need to wait for user snibgo to respond about any errors in your script commands. However, you can use mogrify to the processing on any given folder without having to script a loop.
Create a new directory (new). Assume all your original images (before resizing) are in a directory (old). Then cd to old. Then do
Code: Select all
mogrify -path path2/new -format png -fill rgba(0,0,0,0) -draw "color 0,0 point" *.png
This command will create new images in directory new with the same name as the ones in directory old, but they will have had the red pixel replaced with black transparency. I would suggest you use white transparency, e.g rgba(255,255,255,0) if all your images have white around the pixel at 0,0.
You can even add the resizing to the command after the -draw command, if you want.