0

here is my code

import Image
import ImageDraw

img = Image.new("RGB", (400,400), "white")
draw = ImageDraw.Draw(img)

coords = [(100,70), (220, 310), (200,200)]
dotSize = 2

for (x,y) in coords:
    draw.rectangle([x,y,x+dotSize-1,y+dotSize-1], fill="black")
im.save(contactMap,"JPEG")

want I am wanting to do is. After I have plotting my coordinate on my image, i want to save the image, and then increase the size of this image what functions are there in PIL that I can use to achieve my goal?

John Smith
  • 1,089
  • 3
  • 18
  • 37
  • You could have undeleted your old question after editing it. You want to be careful with deleting questions; if you do that too often an automatic system may place you on a question ban, as deleted questions are seen as a sign you are asking only low quality questions. – Martijn Pieters Feb 12 '13 at 13:40
  • Ok, thanks for the advice, I am new on stack overflow so don't know the protocols. I'll take that on board :) – John Smith Feb 12 '13 at 13:43
  • will it be helpful? http://stackoverflow.com/questions/273946/how-do-i-resize-an-image-using-pil-and-maintain-its-aspect-ratio – DominiCane Feb 12 '13 at 14:01
  • @JohnSmith you generally don't want to upscale a rasterized image. I suggest the opposite in this situation, create a larger image and then downscale to the size you want. In `PIL` an `Image` instance has the method `resize` for doing that (as can be seen in the current answer). – mmgp Feb 12 '13 at 19:19

1 Answers1

1

Use resize:

img.save("a.jpg","JPEG")

img2 = img.resize( (800, 800))
img2.save("b.jpg","JPEG")
MatthieuW
  • 2,292
  • 15
  • 25