(Face Palm, I finished my answer then realized you are using Sketch not Photoshop, hopefully you have the ability to use similar steps with Sketch, if not hoping this will help others with a similar issue using Photoshop lol)
This may not be as automated as you were hoping for, but I do know of a way you could achieve this effect. I am just going to answer under the assumption that you don’t have specific shapes/icons in mind and that this would be used as a background image for a website (judging by your example image). Okay I’m just going to lay this out steps style.
- Go to the website Subtle Patterns
- Pick a pattern that you like, I’m using “Geometry 2” in my example
- Download the pattern folder and open the png image (mine is named “geometry2”) in Photoshop.
- Make a pattern out of the image by following these steps:
Click on Edit > Define Pattern > Enter a name for the pattern
- Make a new Photoshop file for your background image (mine is sized 1920 by 1080 )
- Apply the pattern by using these steps:
Click on create new fill or adjustment layer > Pattern > Click the pattern drop down menu to find the pattern you made then click it > Adjust the scale if you wish (I’m going with 260%) > Click OK
Note: Remember you can use Subtle Patterns commerically, but you need to credit them. See this link for more info on that: https://www.toptal.com/designers/subtlepatterns/faq/
7. You are done unless you want no shapes in the middle as in your example image in which case you can follow these steps (as I did): Click on the eyedropper and hover over the main background color (mine is greyish) then click on the color to grab it > Click on the brush tool > Paint over the middle of the page or wherever you want your text/buttons, and paint away any pieces of shapes that may be left behind