I need a PHP page that will take an image and resize to how Apple’s iOS does it, which is really strange, but I’ll be sure to add some examples. What it does it takes the the image, and places the 2 halves of the image on opposite sides, and fills the middle with the 2 pixels that began in the middle, creating a larger image from a smaller one.
Say here’s what goes in to the php function:

And would be outputted by php like this:

I’m not very good with php and GD so I would have no idea how to even start this sort of thing. But the images would need to be resized to 320px in width and the height would stay the same. Thank you so much to anyone who can write this sort of image manipulation code.
Here you go: