How to stretch the middle section of an image to a new width in Gimp

First off, I don’t use Gimp that often, so what I’m asking may be simple and I’ve missed something obvious. But…

enter image description here

I’m trying to modify the following image in Gimp. The image size is 489×63 however I need it to be 500×20 but most importantly I need each end to remain the same shape without distorting (i.e a perfect semi circle). If I scale (unlinked) to the required size the ends distort an become squashed.

I’ve tried scaling (linked) to the correct height 20px which makes the width 155px, but then I couldn’t figure out how to essentially stretch the middle section until the width was 500px.

Any help appreciated


Gimp is not the best solution for distorting/stretching simple geometrical objects. This be done better with a vector graphics application, e.g. Inkscape.

Nevertheless it is possible with Gimp but it will take a little more time:

  1. Scale image to the desired height but keep aspect ratio
  2. Use the crop tool with “allow growing” option to enlarge the canvas to
    the desired width

    Enlarged canvas with empty space

  3. Select the right end of the bar with a floating selection.

    Selecting right end of the bar

  4. Move this selection to the ríght leaving the center blank (hold Ctrl for horizontal move only)

    Moving selection the the right

  5. Create another selection, now of the center bar to copy and paste it several times to fill the center.

    Filling in the center with copy-paste

Of course we could also just scale that selection width but pasting it several times is faster

Source : Link , Question Author : DMK , Answer Author : Stevoisiak

Leave a Comment