Is there a way to make an icon transparent using code?

I am creating an after-image code. However, the transparent icon is going to be the same as src's icon. I was wondering if there is a way to make the icon transparent using code. This also applies to the overlays on the src.