image lib supports arbitrary canvas coordinate

Discussion in 'Python' started by oyster, Jun 25, 2012.

  1. oyster

    oyster Guest

    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]
     
    oyster, Jun 25, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q3JhaWc=?=

    coordinate design and development

    =?Utf-8?B?Q3JhaWc=?=, Jun 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    362
    =?Utf-8?B?Q3JhaWc=?=
    Jun 6, 2005
  2. Honestmath
    Replies:
    5
    Views:
    591
    Honestmath
    Dec 13, 2004
  3. Askari
    Replies:
    2
    Views:
    738
    Askari
    Aug 30, 2004
  4. PhilC
    Replies:
    2
    Views:
    925
    PhilC
    Oct 25, 2004
  5. Replies:
    10
    Views:
    297
    Rick Johnson
    Mar 15, 2013
Loading...

Share This Page