You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have to load the .ico image, save it as a png , reload the png and finally draw the line on the png.
Feature request
That would be nice to be able to draw line on .ico files or if it's not possible to implement this workaround on the "back side"
What are your OS, Python and Pillow versions?
OS: Windows 10
Python: 3.6
Pillow: 5.1.0
fromPILimportImage, ImageDraw,ImageFont#create an ico file: this step is just for debug, I already have a `ico` fileimg=Image.new('RGB', (50, 50), (125, 167, 242))
img.save('a1.ico')
#code start hereim=Image.open('a1.ico').save('a1.png')
im=Image.open('a1.png')
d=ImageDraw.Draw(im)
d.line((0, 0) +im.size, fill=128)
d.line((0, im.size[1], im.size[0], 0), fill=128)
im.save('pil_modif.ico')
The text was updated successfully, but these errors were encountered:
Thanks for reporting this problem. For your immediate use until this is resolved, I can suggest using im.copy() instead of needing to save it and then load it again -
fromPILimportImage, ImageDraw,ImageFont#create an ico file: this step is just for debug, I already have a `ico` fileimg=Image.new('RGB', (50, 50), (125, 167, 242))
img.save('a1.ico')
#code start hereim=Image.open('a1.ico')
im=im.copy()
d=ImageDraw.Draw(im)
d.line((0, 0) +im.size, fill=128)
d.line((0, im.size[1], im.size[0], 0), fill=128)
im.save('pil_modif.ico')
What did you do?
Load an ico image, draw lines and save it.
What did you expect to happen?
I expect to get lines on the
.ico
imageWhat actually happened?
No lines
The solution
I have to load the
.ico
image, save it as a png , reload the png and finally draw the line on the png.Feature request
That would be nice to be able to draw line on
.ico
files or if it's not possible to implement this workaround on the "back side"What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: