# How to tidy and rename layers automatically using TinyImage

> Arrange Figma layers into a grid, rename them with sequential numbers or custom patterns, update page numbers, and match layer order to the canvas using TinyImage.

- Canonical page: https://www.hypermatic.com/tutorials/how-to-tidy-and-rename-layers-automatically-using-tiny-image/
- Product: tinyimage
- Published: 2026-09-17T00:00:00.000Z
- Updated: 2026-09-17T00:00:00.000Z
- Video: https://www.youtube.com/watch?v=zXv4KhSr9qY

## Steps

1. Run TinyImage and open the Tidy tab.
2. Select the layers, enable Grid alignment in Actions, and click Tidy Layers.
3. In Preferences, adjust horizontal and vertical spacing and choose Auto, Rows or Columns, then run Tidy again.
4. Enable Renaming and set the starting frame number in Preferences.
5. Choose Replace for numbered names or Custom pattern to combine variables such as {n}, {total} and {name}, then click Tidy Layers.
6. To add page numbers, name the relevant text layers {current}, enable Presentation pager, and run Tidy on the selected frames.
7. Enable Layer order and click Tidy Layers to match the Layers panel order to the visual order on the canvas.

#### Video Transcript

Today I'm going to be showing you a quick tutorial on how you can automatically arrange and tidy up your Figma layers and also automatically rename them as well using the TinyImage Figma plugin. To get started, all we need to do is go to our Figma file, go down to the actions icon in the toolbar down here, and then if you click on that and search for TinyImage. Under the Figma plugins tab, if you click on TinyImage, you can run the Figma plugin by either clicking on this run button down here, or I'd recommend clicking on the save icon next to that. That's going to let you save the Figma plugin and run it from your Figma plugins list.

I've already clicked on the save icon, so I'm just going to go back to my Figma canvas. If you right-click anywhere and go down to plugins, and then go down to saved plugins, you can find the TinyImage item that we just saved and then click on open TinyImage to run the Figma plugin. If you're new to the Figma plugin, the way that it works is it basically has a bunch of different features to help you out with image compression and tidying up images. By default, it's going to be on the compression tab, so you can export your Figma layers to compressed assets. You can also create PDFs and GIFs and things like that. But for today's tutorial, we're just going to be exclusively looking at the tidy tab.

If you go to your Figma plugin and click on this tidy tab at the top menu here, that's going to switch into the tidy canvas mode that we're going to be looking at today. I'm going to show you how to use these features now, assuming that you've got a few different layers on your canvas that you want to tidy up. For example, you can see I've got a bunch of different frames here which are kind of just a little bit jumbled and not in any particular grid or good layout. What we can do is automatically tidy these up just by selecting those layers and making sure the grid alignment toggle is enabled. Then you can just go ahead and click on the tidy layers button in the Figma plugin. That's going to automatically tidy those into a nice grid.

I just used the default settings, but you can also go to the preferences tab in the tidy panel. You can do things like change the grid spacing, for example. At the moment, it's set to 80 pixels, but you might want to tidy that up. You might want to make it a bit tighter, around 20 pixels, and you can definitely do that. You can also decide what layout you want to use. You can automatically choose the best layout via the Figma plugin, or if you know you want to put it into rows or columns depending on the kind of arrangement you want to do, you can override that option as well.

I'll just show you what that looks like with the layers selected. We've tidied up the spacing, and if we hit tidy again, you can see that this time we now have a 20-pixel gap there. That's just a bit of a tighter layout, so you've got complete control over that grid spacing however you like. The other thing that we can do is rename the layers. If we go back to our actions panel here and enable the renaming option, this is going to automatically rename the layers as well. Again, you can customize this in the preferences. By default, it's just going to rename them as frame numbers.

If I select those layers and then click the tidy button this time, you can see it's automatically gone through and renamed those layers based on the starting frame number that we've got down here. It's renamed it from 001 to 002, 003, and so on. You can basically just do a quick rename using that option, and that's going to do that as a default naming convention. However, you might not always want that exact naming convention. You've also got the option to change the renaming strategy down here. At the moment, it's just set to replace, where it replaces the entire frame name with the number.

But we can actually do a custom pattern by selecting this custom pattern option. This basically allows us to do a custom pattern based on some different variables that are available. If you click on that link that's just underneath the input here, it'll bring you to the documentation page, which gives you a list of all the variables that you have access to. Things like the layer's current name, so you can use the existing name of the layer, you can get the parent name of the layer, you can get the current page, you can get the row and column number, and you can kind of mix and match these into different formats.

There are a few different options down here that you can see. For example, if we wanted to do this one here, which would basically give us the current number and the total number of frames plus the existing frame name, we could use that. I'll just paste that one in here as a bit of an example. You can see if we add a dash in here, that's also going to be included. Maybe I'll just call this one tutorial at the very end to show you some hard-coded text there as well.

If we select those and then with the renaming option enabled, I'm just going to click on tidy layers again. I'm just going to select the frames I want to rename and tidy, click on the tidy layers button. You'll notice that this time the renaming has followed our custom pattern. If we go back to the preferences tab, you can see that it's totally matched up with that. We've got the current number, which is the end variable, and then we've got the total number of frames, which is the total variable. The name variable just took whatever the existing layer name was before and inserted that there around our hyphens. Then I hardcoded the word tutorial at the end, so that's also been added.

You've got quite a bit of flexibility with the naming pattern. It's completely up to you what convention you want to make, but that just offers a little bit of flexibility there as well. The other cool thing we can do is create a custom page number variable. That's going to basically allow us to populate a custom text layer or multiple text layers in each of our frames just by giving it a current name. You can see here that we've got a field called pager variable. By default, this is just set to curly bracket current and then close curly bracket. What that means is if you name any text layer in your frames with that variable, in this case the current variable, what it's going to do is if we go back to our actions panel, you can see here that we've basically got this presentation pager option.

If you enable this presentation pager option, it's going to add a canvas order number to any matching text layers which we've just got set up here. I'll show you what that looks like as well. One more time, I'm just going to highlight our layers that we want to rename and add this pager to. You can see here they're currently just a blank text layer. It's just got a hyphen in it. You'll see now if we use that pager number, which we've got in there already, and then click on tidy, you'll notice that it's gone ahead and updated each of those layers with the pager order. You can see here that it's basically swapped out those page numbers and it's automatically gone ahead and added those in.

The other thing that we can do is finally enable the layer ordering. If you want to enable the layer ordering so that the layers match the canvas order, for example, these might be a little bit jumbled. If we just undo those changes, I'll show you what I mean here. You've basically got these in the correct order at the moment, but let's say that you just had them all kind of over the place. You might have this frame over here, and this frame is like at the very end or at the very top. They might be completely out of order. What you can do is automatically rearrange your layers in the sidebar here based on the order of the canvas.

We can enable that by enabling the layer order. If I just go ahead and select all of those, and then I go to the tidy layers button again, you can see here that it's now rearranged the layers so that they're all in the order that matches up with the canvas. That means that cover is now first, challenge is now second, audience is third, and so on. This is a really easy way of matching your Figma layer order up with the visual order that you've got your layers in without having to manually drag and drop those around, which can be a little bit tedious.

That's essentially the four different options that you've got to play with. Again, these are all customizable, so you can go through and really fine-tune those to your own liking. As I mentioned, there's a detailed documentation page that you can check out as well. You can just click on the link down here to go to that one, or you can just go to the docs.hypermatic.com site and go to the TinyImage page and go down to the organize layers with tidy option down here. That's going to give you a whole bunch of detail about how you can customize each of those more advanced features as well.

That's basically a quick overview of the four different functions you can use to tidy and arrange your layers without having to manually do all that work yourself. This is going to be a really nice way of automating that. You can again customize this basically to whatever you want, and that's going to depend on your own workflow and what you're going to be using the Figma plugin to do for those layers. Thank you as always for watching, and we'll be back with more Figma tutorials like this one very soon.
