- " txt = Image.new('RGBA', im.size, (255,255,255,0))\n",
- "# txt = Image.new('RGBA', im.size, (0, 0, 0, 0)) # use this line rather than line above for animated png\n",
+ " if gif:\n",
+ " txt = Image.new('RGBA', im.size, (255,255,255,0))\n",
+ " else:\n",
+ " txt = Image.new('RGBA', im.size, (0, 0, 0, 0)) # use this line rather than line above for animated png\n",