image lib supports arbitrary canvas coordinate

O

oyster

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]
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top