An interesting piece of code using coldfusion, that allows you to change the color in a .gif image:
<cfscript> imagepath = "relative/path/to/image.gif"; templatepath = "absolutepath oimage emplate.gif"; desiredcolor = Replace(form.newcolor, "##", "", "one"); originalcolor = "E0F0FF"</cfscript><cfif Not FileExists(imagepath)> <cffile action="readbinary" file="#templatepath#" variable="binimg" /> <cfscript> binencode = BinaryEncode(binimg, "Hex"); newimage = Replace(binencode, originalcolor, dividercolor, "one"); bindecode = BinaryDecode(newimage, "Hex"); </cfscript></cfif><cffile action="write" file="#imagepath#" output="#bindecode#" addnewline="No" />

No Comments, Comment or Ping
Reply to “Changing GIF image color palette”