python - PIL Tkinter Canvas EPS to PNG conversion output file contains issues -


so have created following save function turtle graphics program allow user save canvas .png file own file name:

def savefirst():     cnv = getscreen().getcanvas()      ps = cnv.postscript(colormode = 'color')     hen = filedialog.asksaveasfilename()     print(hen)     im = image.open(io.bytesio(ps.encode('utf-8')))     im = im.resize((2560, 1600), image.antialias)     quality_val = 95     sharp = imageenhance.sharpness(im)     sharp.enhance(2.0).save(hen + '.png', 'png') 

however, if user set background different color, in output file (.png) the background color does not appear. also, the output image gets rough around curves. below mean, according screenshot of canvas comparing saved output:

screen shot of canvas itself: canvas

saved output: saved output

how fix these issues, preferably somehow using python imaging library? if not possible, is there other way me save canvas jpeg comes out flawless (just screenshot, i.e. colors , no distortions)? appreciated!


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -