Textures and Materials
Gallery Texture and Gallery Picker

Gallery Textures and the Gallery Picker

A user chooses an image from their camera roll. That image is then used as a background in the effect.

The gallery picker lets people add an image from their phone’s camera roll to an effect, like a green screen.

To create an effect with the gallery picker, all you need to do is add the gallery texture to a material in your scene. The material can be applied to any object, for example a 3D object or a rectangle to create a segmentation effect.

You can also download and adapt this template project. The project is similar to Instagram's Green Screen effect. It lets someone add a photo or video from their device to the background of an effect. The project includes a script and patch graph that detects the width and height of the photo or video and resizes it in-line with the size of the device screen.


In the Simulator

When you've added the gallery texture, you'll see an Add Media button in the Simulator. Click this to test the gallery texture by importing an image from your computer.

In the Instagram app

To send the effect to the Instagram app:

  1. Click the Test on Device icon in the toolbar.
  2. Next to Instagram, select Send.
The user is sending their effect to Instagram for testing.

In Meta Spark Player

In Meta Spark Player, tap the Add Media button to test an effect with the gallery texture using images or videos from your camera.

If you don't see any preview options, make sure to select an experience for your project in the project properties.

How effects appear in the camera

If an effect includes the gallery texture, an add media button will appear at the bottom of the effect:

The Add Media button, as seen on Instagram.

People can then browse and add images from their media library.


Edit the gallery texture’s properties to change how it appears in the effect.

Holding texture

Selecting this box lets you select an initial texture to show in the effect. This texture will be replaced with the image selected by the person using your effect.


Choose a color or texture:

  • If the Type is set to Texture, add an image file here.
  • If the Type is set to color, select a color from the menu.

Used by

Any materials using the texture. Click the arrow to the left of the material to show any other assets indirectly using the texture. For example, any objects that the material is applied to.


When planning effects that use the gallery texture, it’s worth considering:

  • Only one camera roll texture can be selected by users at a time.
  • People can select either photos or videos to add to effects with the gallery texture in.
  • People can select square, horizontal or vertical images or videos, so you might need to resize the image to fit the area where you want to use it.