You have an error when you try :
ReplaceColor RGB(204,204,204), RGB(255, 255, 255)
Yes,this is the response:
GflAx.GflAx.1 error '80004005'
/example/image.asp, line 87
.. the picture is loaded ..
sir.ReplaceColor RGB(204,204,204), RGB(255, 255, 255) <- line 87 in ASP
sir.Crop areaX1, areaY1, areaX2, areaY2 <- line 88
Line 88 and others go fine when line 87 is not in use.
I tried to find a workaround using double For..Next statement scanning the picture and sir.getColorAt(slx,sly) / condition / sir.drawPoint slx, sly. What I found out is that sir.getColorAt(slx,sly) can not be used without converting to LONG (CLNG), so plain usege returns Variable_uses_an_Automation_type_not_supported_in_VBScript.
The values I get back from CLNG(sir.getColorAt(slx,sly)) are e.g. 7012533,16711935,18943,45823,65535,586496,1100544,3252736,16727040,10262016,14077696,16776960 but using them in above For..Next statements does not replace every value, just some. As if there were error in converting to LONG (the manual transform from RGB (r,g,b) to the given nnnnnnnnn is not the same).
SO even this try, that takes too much CPU time using scripting language, does not work 100% for me.
I hope that I helped a bit to the solution of another mistery of your masterpiece! Or that might be just my stupidness?