Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news2.arglkargh.de!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.160 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.70; '*S*': 0.02; 'canvas': 0.07; '[0,': 0.09; 'pixel': 0.09; 'expands': 0.16; 'size,': 0.18; 'translation': 0.18; 'code,': 0.20; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.214.174': 0.27; 'bigger': 0.27; 'maybe': 0.27; 'skip:( 20': 0.30; 'code': 0.31; 'needed': 0.33; 'received:google.com': 0.34; 'thanks': 0.35; 'received:209.85': 0.35; 'to:addr:python-list': 0.35; 'doing': 0.36; 'but': 0.36; 'received:209': 0.37; 'some': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.39; 'between': 0.63; 'url:t': 0.65; 'url:17': 0.66; 'url:p': 0.69; 'url:f': 0.72; 'url:php': 0.83; '601': 0.84; 'received:mail-ob0-f174.google.com': 0.91; 'cause,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=4FOYkTaubf7nPpPnurNSoKdEtoKHdadmjCgjhKSvhso=; b=gV5c/f/svaKNakzn35XxfxoPp4UqVyQ5f3QDBAu+vfhzv9FFbZrn9YPR7V0Y29kT8K XNK4DANKwUA6jVuwI8HJHbRJMc2TWlc1TQqIlKB6oVc/uA2yHMx84sQZ4GwjTWA6Kjkf TmF6ESxFTXC4QWQxY97rlsXC3tt6JY8/uTZ6Fi9tquNL6xI4nthj4NQtbnYk45LPaZaG mGuooJSqJsYGpCp5Sp2YV14+/0m06hFbfqix+ZYejDto67G6TtCyLF+HOnBPUxjMTNVP VOajBa+cs/jfiu0GTrcSQ+P9tiU1XN/k6HcY8d2K13T0G5PKiN91LnuN1Wybyh9UCG/M j/4Q== MIME-Version: 1.0 Date: Mon, 25 Jun 2012 10:16:41 +0800 Subject: image lib supports arbitrary canvas coordinate From: oyster To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1340590604 news.xs4all.nl 6854 [2001:888:2000:d::a6]:52738 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24412 Can any image(not for line plot, but for pixel set) lib behaves like a person? that is to say: when we are doing image processing( for exapmle, http://www.freebasic.net/forum/viewtopic.php?f=17&t=20057&p=176300#p176300) , the new image maybe have a bigger canvas size than the original image's, and sometimes, nagative coordinate is needed from the math-side viewpoint, Of cause, we can do which by pre-caculating the proper canvas size, coordinate translation in code, but that is tedious Any lib can support some code like followings? thanks [psedu-code] newImg=Image.new('RGB', (200,300)) #begin with a canvas size=200*300, so the x is between[0, 199], y is between [0, 299] newImg.putpixel((500, 600), 'black') #the lib expands the canvas automatically, so till now the canvas size=501* 601 newImage.save('fin.jpg', border=(top=10, bottom=20, left=30, right=40)) #size of fin.jpg is (501+30+40)*(601+10+20) [/code]