sounds to me like you need top, bottom, left, right images (and images for 4 corners), with a central image that you can repeat. Then a little CSS to put them all together correctly. Very similar to how people made rounded corners! The real trick gets a repeating central image. This can be simplified only by the size of your center div in steps that match the size of the center image you ended up with.
TBH I donβt even know if it is possible to come up with a central magician who will not look like a patchwork quilt when it repeats.
CHANGE I had a better idea!
If you create images that effectively mask to βskipβ you a grassy image. You can use the css sprite technique to determine the size of the image, and then overlay the side / corner images to get a torn edge effect. On the right, css would be pulled out of a larger image large enough to handle your maximum expected tile.
source share