I'd like to load a transparent GIF, remove its transpareny information and save it as a JPG with background color set to white.
Using GflAX 2.60 - GFL 2.70 (Light) and ASP/JScript, I've tried this:
Code: Select all
var o = Server.CreateObject("GflAx.GflAx");
o.EnableLZW = true;
o.LoadBitmap(Server.MapPath("C:\\Temp\\transp.gif");
Response.Write(Boolean(o.UseTransparency) + " -- " + o.BackColor + " --" + o.MaskColor + "<br>");
o.UseTransparency = false;
o.BackColor = 16777215;
Response.Write(Boolean(o.UseTransparency) + " -- " + o.BackColor + " --" + o.MaskColor + "<br>");
o.SaveFormat = 1; // AX_JPEG
o.SaveFormatName = "jpeg";
o.SaveJPEGProgressive = true;
o.SaveJPEGQuality = 100;
o.SaveBitmap(Server.MapPath("C:\\Temp\\new.jpg"));
false -- 16777215 -- 16777215
false -- 16777215 -- 16777215
It looks like GflAx doesn't recognise the transparent GIF. The JPG file is saved with a black background. I doesn't matter if I set UseTransparency and BackColor or if I comment it out.
How exactly do I convert GIF to JPG with removal of transpareny and setting a white background?
Every hint appreciated!