1

I have a map image and I want to crop a selected areas of this map using ONLY php.I find ways of cropping but all are in rectangles shape.but I want a polygon shape of my source image,and I have no Idea where to start. here is my img

enter image description here

I want to save pieces of this map(whiting area borders) as a seperate image.

Shirin Abdolahi
  • 1,047
  • 8
  • 18

1 Answers1

0

after ages of searching.I finally create polygons I want in photoshop.and use them as overlays. I place my overlay images on original image and then save the new image generated witch is the croped image I wanted to be .(this procejure is done by php not photoshop).

Shirin Abdolahi
  • 1,047
  • 8
  • 18
  • Your original question specified *only* PHP and your final solution is to include Photoshop? Doesn't that defeat the purpose? – Mr. Llama Oct 08 '14 at 21:37
  • with photoshop I create a layout images. what I try to do is a continues work with difrrent image,so once I create layouts I can continue and copy layout on orignaliimage(usingphp). my mistake in explainin.sry – Shirin Abdolahi Oct 08 '14 at 21:42
  • brilliant. but masking isn't a good idea? no PS needed, it's clean and fine for other maps. – Pooya Oct 14 '14 at 21:29
  • what is masking? @Pooya – Shirin Abdolahi Oct 14 '14 at 21:30
  • you just need to draw a polygon in a new image exactly like your area (in black). and mask the new image with your map. black pixels stay and other will remove. trim the image and you have a clean cropped area. – Pooya Oct 14 '14 at 21:34
  • I dont want the black pixels, I want the image to be croppet as it is. – Shirin Abdolahi Oct 14 '14 at 21:37
  • 1
    take a look at this: http://stackoverflow.com/questions/7203160/php-gd-use-one-image-to-mask-another-image-including-transparency – Pooya Oct 14 '14 at 21:40