0

Working with GIMP I need to use the grid. It is aligned on the top-left corner of the image, but I need it to be centered, splitting the incomplete squares on both the sides. I tried with Image > Configure Grid..., but it only allows me to manually set an offset value. How can I make GIMP automatically center the grid?

Update: I need the tools to snap to the grid, so a rendered one is not good for me.

0

Without doing maths

  • Create a layer which is at least one grid step higher/wider than the canvas
  • Render the grid on it
  • Move the layer to center it
  • Layer>Layer to image size to crop the excess.
  • Sorry, I forgot to specify why I need the grid (just updated) - I want to use it like a "guide" for the tools to snap to, so rendering to the layer doesn't fit for me. Anyway, how do I render the grid? – Ntakwetet Nov 10 '19 at 14:15
  • @Ntakwetet Filters > Render > Pattern > Grid - yeah a rendered grid won't help if you need snap to grid, since it's just an image. – Billy Kerr Nov 10 '19 at 14:22
0

As far as I know, there's no automatic way to centre the grid, since it would depend on the size of the grid, and the size of the canvas. I suppose one could write or find a script/extension for this, but I don't know of one. However, it's easy enough to work out the required offset using some simple arithmetic

For the sake of an example, suppose you have a square grid that is 45px, and a canvas size that's 1920px wide. Note that you can find out the canvas size of your document by clicking Image > Canvas Size.

  • 1920/45=42.666 - so that's 42 grid squares, with the remainder being 0.666
  • 0.666*45 = 29.97, rounding up to the nearest pixel gives 30px
  • The horizontal offset you need is therefore 30/2 = 15px

You could also do the same calculations for the height of the canvas to work out the required vertical offset if you also need it centred vertically.

0

There is a script to render a grid as a path, and you can use View>Snap to active path to have the path act as a guide. But you would also have to move the path afterwards to center it (Move tool in "Path" mode), since the script only takes an offset. The script is here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.